mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-11 00:21:35 +08:00
Check system type for SET_ATTITUDE_TARGET attitude publising
Check if system type is VTOL and publish attitude to proper uORB topic
This commit is contained in:
committed by
Nuno Marques
parent
8bf60662fa
commit
35b0778499
@@ -85,6 +85,20 @@ MavlinkReceiver::MavlinkReceiver(Mavlink *parent) :
|
||||
_parameters_manager(parent),
|
||||
_mavlink_timesync(parent)
|
||||
{
|
||||
unsigned int system_type = _mavlink->get_system_type();
|
||||
|
||||
if (system_type == MAV_TYPE_VTOL_DUOROTOR ||
|
||||
system_type == MAV_TYPE_VTOL_QUADROTOR ||
|
||||
system_type == MAV_TYPE_VTOL_TILTROTOR ||
|
||||
system_type == MAV_TYPE_VTOL_RESERVED2 ||
|
||||
system_type == MAV_TYPE_VTOL_RESERVED3 ||
|
||||
system_type == MAV_TYPE_VTOL_RESERVED4 ||
|
||||
system_type == MAV_TYPE_VTOL_RESERVED5) {
|
||||
_is_vtol = true;
|
||||
|
||||
} else {
|
||||
_is_vtol = false;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
@@ -1411,7 +1425,12 @@ MavlinkReceiver::handle_message_set_attitude_target(mavlink_message_t *msg)
|
||||
}
|
||||
}
|
||||
|
||||
_att_sp_pub.publish(att_sp);
|
||||
if (!_is_vtol) {
|
||||
_att_sp_pub.publish(att_sp);
|
||||
|
||||
} else {
|
||||
_mc_virtual_att_sp_pub.publish(att_sp);
|
||||
}
|
||||
}
|
||||
|
||||
/* Publish attitude rate setpoint if bodyrate and thrust ignore bits are not set */
|
||||
|
||||
Reference in New Issue
Block a user