mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-29 12:14:07 +08:00
vtol main: only guard against transition to FW in certain flight modes, never to MC
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
This commit is contained in:
parent
5ebe41efbf
commit
342e9900f8
@ -150,11 +150,12 @@ void VtolAttitudeControl::vehicle_cmd_poll()
|
||||
|
||||
uint8_t result = vehicle_command_ack_s::VEHICLE_RESULT_ACCEPTED;
|
||||
|
||||
// deny any transition in auto takeoff mode, plus transition from RW to FW in land or RTL mode
|
||||
if (vehicle_status.nav_state == vehicle_status_s::NAVIGATION_STATE_AUTO_TAKEOFF
|
||||
|| (vehicle_status.vehicle_type == vehicle_status_s::VEHICLE_TYPE_ROTARY_WING
|
||||
&& (vehicle_status.nav_state == vehicle_status_s::NAVIGATION_STATE_AUTO_LAND
|
||||
|| vehicle_status.nav_state == vehicle_status_s::NAVIGATION_STATE_AUTO_RTL))) {
|
||||
// deny transition from MC to FW in Takeoff, Land, RTL and Orbit
|
||||
if (int(vehicle_command.param1 + 0.5f) == vtol_vehicle_status_s::VEHICLE_VTOL_STATE_FW &&
|
||||
(vehicle_status.nav_state == vehicle_status_s::NAVIGATION_STATE_AUTO_TAKEOFF
|
||||
|| vehicle_status.nav_state == vehicle_status_s::NAVIGATION_STATE_AUTO_LAND
|
||||
|| vehicle_status.nav_state == vehicle_status_s::NAVIGATION_STATE_AUTO_RTL
|
||||
|| vehicle_status.nav_state == vehicle_status_s::NAVIGATION_STATE_ORBIT)) {
|
||||
|
||||
result = vehicle_command_ack_s::VEHICLE_RESULT_TEMPORARILY_REJECTED;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user