mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-14 07:03:34 +08:00
Navigator: land: set lat/lon fields of triplet to NAN if global position is not valid
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
This commit is contained in:
committed by
Matthias Grob
parent
53dda3576b
commit
aa25964942
@@ -827,8 +827,15 @@ MissionBlock::set_land_item(struct mission_item_s *item)
|
||||
item->nav_cmd = NAV_CMD_LAND;
|
||||
|
||||
// set land item to current position
|
||||
item->lat = _navigator->get_global_position()->lat;
|
||||
item->lon = _navigator->get_global_position()->lon;
|
||||
if (_navigator->get_local_position()->xy_global) {
|
||||
item->lat = _navigator->get_global_position()->lat;
|
||||
item->lon = _navigator->get_global_position()->lon;
|
||||
|
||||
} else {
|
||||
item->lat = (double)NAN;
|
||||
item->lon = (double)NAN;
|
||||
}
|
||||
|
||||
item->yaw = NAN;
|
||||
|
||||
item->altitude = 0;
|
||||
|
||||
Reference in New Issue
Block a user