mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-07 14:51:36 +08:00
reset the position lock only if current triplet latitude and longitude
are valid
This commit is contained in:
@@ -178,10 +178,12 @@ bool FlightTaskAuto::_evaluateTriplets()
|
|||||||
} else {
|
} else {
|
||||||
tmp_target(0) = _lock_position_xy(0);
|
tmp_target(0) = _lock_position_xy(0);
|
||||||
tmp_target(1) = _lock_position_xy(1);
|
tmp_target(1) = _lock_position_xy(1);
|
||||||
_lock_position_xy.setAll(NAN);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
// reset locked position if current lon and lat are valid
|
||||||
|
_lock_position_xy.setAll(NAN);
|
||||||
|
|
||||||
// Convert from global to local frame.
|
// Convert from global to local frame.
|
||||||
map_projection_project(&_reference_position,
|
map_projection_project(&_reference_position,
|
||||||
_sub_triplet_setpoint->get().current.lat, _sub_triplet_setpoint->get().current.lon, &tmp_target(0), &tmp_target(1));
|
_sub_triplet_setpoint->get().current.lat, _sub_triplet_setpoint->get().current.lon, &tmp_target(0), &tmp_target(1));
|
||||||
|
|||||||
Reference in New Issue
Block a user