mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-06 10:58:52 +08:00
Fixes #6484: Bug in Offboard mode incorrect use of type_mask
This commit is contained in:
committed by
Lorenz Meier
parent
d5c923c7ef
commit
08891526fd
@@ -909,22 +909,24 @@ MavlinkReceiver::handle_message_set_position_target_local_ned(mavlink_message_t
|
||||
pos_sp_triplet.next.valid = false;
|
||||
pos_sp_triplet.current.valid = true;
|
||||
|
||||
if (is_takeoff_sp) {
|
||||
/* Order of statements matters. Takeoff can override loiter.
|
||||
* See https://github.com/mavlink/mavlink/pull/670 for a broader conversation. */
|
||||
if (is_loiter_sp) {
|
||||
pos_sp_triplet.current.type = position_setpoint_s::SETPOINT_TYPE_LOITER;
|
||||
|
||||
} else if (is_takeoff_sp) {
|
||||
pos_sp_triplet.current.type = position_setpoint_s::SETPOINT_TYPE_TAKEOFF;
|
||||
|
||||
} else if (is_land_sp) {
|
||||
pos_sp_triplet.current.type = position_setpoint_s::SETPOINT_TYPE_LAND;
|
||||
|
||||
} else if (is_loiter_sp) {
|
||||
pos_sp_triplet.current.type = position_setpoint_s::SETPOINT_TYPE_LOITER;
|
||||
|
||||
} else if (is_idle_sp) {
|
||||
pos_sp_triplet.current.type = position_setpoint_s::SETPOINT_TYPE_IDLE;
|
||||
|
||||
} else {
|
||||
pos_sp_triplet.current.type = position_setpoint_s::SETPOINT_TYPE_POSITION;
|
||||
}
|
||||
|
||||
|
||||
/* set the local pos values */
|
||||
if (!offboard_control_mode.ignore_position) {
|
||||
pos_sp_triplet.current.position_valid = true;
|
||||
|
||||
Reference in New Issue
Block a user