mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-23 22:58:10 +08:00
navigator_main: DO_REPOSITION: only trigger reposition setpoint update if vehicle is armed
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
This commit is contained in:
@@ -234,7 +234,10 @@ void Navigator::run()
|
||||
// TODO: move DO_GO_AROUND handling to navigator
|
||||
publish_vehicle_command_ack(cmd, vehicle_command_s::VEHICLE_CMD_RESULT_ACCEPTED);
|
||||
|
||||
} else if (cmd.command == vehicle_command_s::VEHICLE_CMD_DO_REPOSITION) {
|
||||
} else if (cmd.command == vehicle_command_s::VEHICLE_CMD_DO_REPOSITION
|
||||
&& _vstatus.arming_state == vehicle_status_s::ARMING_STATE_ARMED) {
|
||||
// only update the reposition setpoint if armed, as it otherwise won't get executed until the vehicle switches to loiter,
|
||||
// which can lead to dangerous and unexpected behaviors (see loiter.cpp, there is an if(armed) in there too)
|
||||
|
||||
bool reposition_valid = true;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user