Thrust_body meaning for a quadcopter

Hello,
I am trying to understand the thrust_body variable meaning in PX4 multicopter control.

Is the thrust_body not implemented to achieve acceleration in any XYZ direction?

In the documentation I see the following statement:

# For clarification: For multicopters thrust_body[0] and thrust[1] are usually 0 and thrust[2] is the negative throttle demand.

In the SITL simulation I am able to send the mavlink command to set the thrust_body setpoint (to any desired value in XYZ components) and I get only the vertical motion of the quadcopter.

p.s. I am using the set_attitude_target_send command in common mavlink dialect:

connection.mav.set_attitude_target_send(
            int(time.time()),  # time_boot_ms (not used)
            connection.target_system,
            connection.target_component,
            mavlink2.ATTITUDE_TARGET_TYPEMASK_THRUST_BODY_SET,
            [1.0, 0.0, 0.0, 0.0],  # Quaternion (not used)
            0.0, 0.0, 0.0,  # Roll, Pitch, Yaw rates (not used)
            0.707, # thrust 0.707 is the stabile thrust
            thrust_body=thrust_body)  # thrust_body

Hi @alpha358,
yes, the thrust_body vector is used to achieve different linear accelerations in the 3D space.
You have to keep in mind how a multirotor works. Usually, the rotors can produce only a thrust along the Z axis (perpendicular to the floor, let’s say), and with that, it is able to takeoff and land. Then, to move in the XY plane, it changes the orientation of the thrust vector by changing the orientation of the drone’s body.
This is a simplification of the kinematic of a standard multirotor and that’s why you need only the vertical thrust, because the other vector components are generated by changing the angles (rool and pitch) of the drone.

Thank you for clarification,
I thought that thrust_body setpoint would cause the the multirotor to rotate to achieve the thrust vector defined by thrust_body command.
Apparently this is not the case.

You can give a look to the multirotor control.
It has a cascade of controllers:

  1. The position control: takes as input the desired position and gives as output the desired velocity to reach the position.
  2. Velocity control: takes the desired velocity (from the Position control and eventually a feedforward) and gives as output the desired acceleration.
  3. The desired 3D linear acceleration (or thrust, if you multiply for a constant) is used to generate the desired roll and pitch angles
  4. The angle control: takes as input the desired angles and gives as output the desired angular rates
  5. The rate controller: takes as input the desired angular rates and gives as output the angular accelerations (or torques if you multiply for the inertia matrix)

Finally, the vertical thrust and the 3 torques are used with the allocation matrix to generate the relative angular velocities for each motor.

This is the flow of the multirotor control