How to use and what is thrust_body

I am working with mavlink latest version 0.11.2 , I have upgraded from 0.9.0, in old version there was no thrust_body defined inside struct SET_ATTITUDE_TARGET_DATA, what should be the initial value i should give to it , I am trying [-1.0,0.0,1.0] taking refrence from https://docs.rs/mavlink/latest/mavlink/ardupilotmega/struct.SET_ATTITUDE_TARGET_DATA.html#structfield.thrust_body
I am not sure from definition what doe it do ? Any explanation would be great.

pub struct SET_ATTITUDE_TARGET_DATA {
    pub time_boot_ms: u32,
    pub q: [f32; 4],
    pub body_roll_rate: f32,
    pub body_pitch_rate: f32,
    pub body_yaw_rate: f32,
    pub thrust: f32,
    pub target_system: u8,
    pub target_component: u8,
    pub type_mask: AttitudeTargetTypemask,
    pub thrust_body: [f32; 3],
}

That field does not exist in SET_ATTITUDE_TARGET_DATA unless you explicitly enable the emit-extensions feature. The documentation used to exclude fields enabled by the emit-extensions feature, but now it includes those fields; you don't have to (and cannot) use those fields if you don't enable that feature.

If you do enable that feature, you can safely set thrust_body to an arbitrary value like [0.0, 0.0, 0.0], since it will ignored unless you include ATTITUDE_TARGET_TYPEMASK_THRUST_BODY_SET in the type_mask.

Thrust setpoints appear to be used for offboard mode in PX4. Perhaps they are used for other things, but I am not an expert in this area.

1 Like

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.