mirror of https://github.com/ArduPilot/ardupilot
Plane: reject guided destinations outside the fence
This commit is contained in:
parent
2877472f27
commit
e4f76cd27d
|
@ -841,6 +841,14 @@ MAV_RESULT GCS_MAVLINK_Plane::handle_command_int_do_reposition(const mavlink_com
|
|||
return MAV_RESULT_DENIED;
|
||||
}
|
||||
|
||||
#if AP_FENCE_ENABLED
|
||||
// reject destination if outside the fence
|
||||
if (!plane.fence.check_destination_within_fence(requested_position)) {
|
||||
LOGGER_WRITE_ERROR(LogErrorSubsystem::NAVIGATION, LogErrorCode::DEST_OUTSIDE_FENCE);
|
||||
return MAV_RESULT_DENIED;
|
||||
}
|
||||
#endif
|
||||
|
||||
// location is valid load and set
|
||||
if (((int32_t)packet.param2 & MAV_DO_REPOSITION_FLAGS_CHANGE_MODE) ||
|
||||
(plane.control_mode == &plane.mode_guided)) {
|
||||
|
|
Loading…
Reference in New Issue