mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-09 09:28:31 -04:00
AC_WPNav: do not calculate NEU vector from invalid location
This commit is contained in:
parent
14f43f24a9
commit
89cfdb678f
@ -603,17 +603,20 @@ bool AC_WPNav::set_spline_destination(const Location& destination, bool stopped_
|
||||
return false;
|
||||
}
|
||||
|
||||
Vector3f next_dest_neu; // left uninitialised for valgrind
|
||||
if (seg_end_type == SEGMENT_END_STRAIGHT ||
|
||||
seg_end_type == SEGMENT_END_SPLINE) {
|
||||
// make altitude frames consistent
|
||||
if (!next_destination.change_alt_frame(destination.get_alt_frame())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// convert next destination to vector
|
||||
Vector3f next_dest_neu;
|
||||
bool next_dest_terr_alt;
|
||||
if (!get_vector_NEU(next_destination, next_dest_neu, next_dest_terr_alt)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// set target as vector from EKF origin
|
||||
return set_spline_destination(dest_neu, dest_terr_alt, stopped_at_start, seg_end_type, next_dest_neu);
|
||||
|
Loading…
Reference in New Issue
Block a user