mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-21 15:27:36 +08:00
en-/disable mc position controller using explicit control mode flag
This commit is contained in:
committed by
Mathieu Bresciani
parent
17ea92bb54
commit
514845592b
@@ -3328,6 +3328,14 @@ Commander::update_control_mode()
|
||||
break;
|
||||
}
|
||||
|
||||
_vehicle_control_mode.flag_multicopter_position_control_enabled =
|
||||
(_status.vehicle_type == vehicle_status_s::VEHICLE_TYPE_ROTARY_WING)
|
||||
&& (_vehicle_control_mode.flag_control_altitude_enabled
|
||||
|| _vehicle_control_mode.flag_control_climb_rate_enabled
|
||||
|| _vehicle_control_mode.flag_control_position_enabled
|
||||
|| _vehicle_control_mode.flag_control_velocity_enabled
|
||||
|| _vehicle_control_mode.flag_control_acceleration_enabled);
|
||||
|
||||
_vehicle_control_mode.timestamp = hrt_absolute_time();
|
||||
_control_mode_pub.publish(_vehicle_control_mode);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user