mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-20 00:03:33 +08:00
VTOL rate control architecture improvements (#10819)
* attitude and rate setpoint message: use 3D array for thrust demand * FixedWingAttitudeControl: rework airspeed scaling * move airspeed and scaling calculation into separate method * if vtol in hover and airspeed disabled use minimum airspeed instead of trim airspeed
This commit is contained in:
@@ -3138,7 +3138,7 @@ protected:
|
||||
msg.body_pitch_rate = att_rates_sp.pitch;
|
||||
msg.body_yaw_rate = att_rates_sp.yaw;
|
||||
|
||||
msg.thrust = att_sp.thrust;
|
||||
msg.thrust = att_sp.thrust_body[0];
|
||||
|
||||
mavlink_msg_attitude_target_send_struct(_mavlink->get_channel(), &msg);
|
||||
|
||||
|
||||
@@ -1447,8 +1447,11 @@ MavlinkReceiver::handle_message_set_attitude_target(mavlink_message_t *msg)
|
||||
att_sp.yaw_sp_move_rate = 0.0f;
|
||||
}
|
||||
|
||||
// TODO: We assume offboard is only used for multicopters which produce thrust along the
|
||||
// body z axis. If we want to support fixed wing as well we need to handle it differently here, e.g.
|
||||
// in that case we should assign att_sp.thrust_body[0]
|
||||
if (!_offboard_control_mode.ignore_thrust) { // dont't overwrite thrust if it's invalid
|
||||
att_sp.thrust = set_attitude_target.thrust;
|
||||
att_sp.thrust_body[2] = -set_attitude_target.thrust;
|
||||
}
|
||||
|
||||
if (_att_sp_pub == nullptr) {
|
||||
@@ -1472,7 +1475,7 @@ MavlinkReceiver::handle_message_set_attitude_target(mavlink_message_t *msg)
|
||||
}
|
||||
|
||||
if (!_offboard_control_mode.ignore_thrust) { // dont't overwrite thrust if it's invalid
|
||||
rates_sp.thrust = set_attitude_target.thrust;
|
||||
rates_sp.thrust_body[2] = -set_attitude_target.thrust;
|
||||
}
|
||||
|
||||
if (_rates_sp_pub == nullptr) {
|
||||
|
||||
Reference in New Issue
Block a user