Browse Source

Plane: use sanitize method rather than location_sanitize function

mission-4.1.18
Peter Barker 6 years ago committed by Andrew Tridgell
parent
commit
a372428ec5
  1. 2
      ArduPlane/GCS_Mavlink.cpp
  2. 10
      ArduPlane/commands_logic.cpp

2
ArduPlane/GCS_Mavlink.cpp

@ -776,7 +776,7 @@ MAV_RESULT GCS_MAVLINK_Plane::handle_command_int_packet(const mavlink_command_in
requested_position.loiter_ccw = 1; requested_position.loiter_ccw = 1;
} }
if (location_sanitize(plane.current_loc, requested_position)) { if (requested_position.sanitize(plane.current_loc)) {
// if the location wasn't already sane don't load it // if the location wasn't already sane don't load it
return MAV_RESULT_FAILED; // failed as the location is not valid return MAV_RESULT_FAILED; // failed as the location is not valid
} }

10
ArduPlane/commands_logic.cpp

@ -408,7 +408,7 @@ void Plane::do_landing_vtol_approach(const AP_Mission::Mission_Command& cmd)
{ {
//set target alt //set target alt
Location loc = cmd.content.location; Location loc = cmd.content.location;
location_sanitize(current_loc, loc); loc.sanitize(current_loc);
set_next_WP(loc); set_next_WP(loc);
// only set the direction if the quadplane landing radius override is not 0 // only set the direction if the quadplane landing radius override is not 0
@ -435,7 +435,7 @@ void Plane::loiter_set_direction_wp(const AP_Mission::Mission_Command& cmd)
void Plane::do_loiter_unlimited(const AP_Mission::Mission_Command& cmd) void Plane::do_loiter_unlimited(const AP_Mission::Mission_Command& cmd)
{ {
Location cmdloc = cmd.content.location; Location cmdloc = cmd.content.location;
location_sanitize(current_loc, cmdloc); cmdloc.sanitize(current_loc);
set_next_WP(cmdloc); set_next_WP(cmdloc);
loiter_set_direction_wp(cmd); loiter_set_direction_wp(cmd);
} }
@ -443,7 +443,7 @@ void Plane::do_loiter_unlimited(const AP_Mission::Mission_Command& cmd)
void Plane::do_loiter_turns(const AP_Mission::Mission_Command& cmd) void Plane::do_loiter_turns(const AP_Mission::Mission_Command& cmd)
{ {
Location cmdloc = cmd.content.location; Location cmdloc = cmd.content.location;
location_sanitize(current_loc, cmdloc); cmdloc.sanitize(current_loc);
set_next_WP(cmdloc); set_next_WP(cmdloc);
loiter_set_direction_wp(cmd); loiter_set_direction_wp(cmd);
@ -454,7 +454,7 @@ void Plane::do_loiter_turns(const AP_Mission::Mission_Command& cmd)
void Plane::do_loiter_time(const AP_Mission::Mission_Command& cmd) void Plane::do_loiter_time(const AP_Mission::Mission_Command& cmd)
{ {
Location cmdloc = cmd.content.location; Location cmdloc = cmd.content.location;
location_sanitize(current_loc, cmdloc); cmdloc.sanitize(current_loc);
set_next_WP(cmdloc); set_next_WP(cmdloc);
loiter_set_direction_wp(cmd); loiter_set_direction_wp(cmd);
@ -500,7 +500,7 @@ void Plane::do_loiter_to_alt(const AP_Mission::Mission_Command& cmd)
{ {
//set target alt //set target alt
Location loc = cmd.content.location; Location loc = cmd.content.location;
location_sanitize(current_loc, loc); loc.sanitize(current_loc);
set_next_WP(loc); set_next_WP(loc);
loiter_set_direction_wp(cmd); loiter_set_direction_wp(cmd);

Loading…
Cancel
Save