Skip to content

Commit

Permalink
Navigator: land: set lat/lon fields of triplet to NAN if global posit…
Browse files Browse the repository at this point in the history
…ion is not valid

Signed-off-by: Silvan Fuhrer <[email protected]>
  • Loading branch information
sfuhrer authored and MaEtUgR committed Oct 31, 2024
1 parent 53dda35 commit aa25964
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/modules/navigator/mission_block.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit aa25964

Please sign in to comment.