mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-31 02:16:53 +08:00
ignore wp altitude for intermediate landing wp so it doesn't descent before it is in landing mode
This commit is contained in:
@@ -458,9 +458,20 @@ Mission::set_mission_items()
|
||||
memcpy(&mission_item_next_position, &_mission_item, sizeof(struct mission_item_s));
|
||||
has_next_position_item = true;
|
||||
|
||||
/*
|
||||
* Ignoring waypoint altitude:
|
||||
* Set altitude to the same as we have now to prevent descending too fast into
|
||||
* the ground. Actual landing will descend anyway until it touches down.
|
||||
*/
|
||||
float altitude = _navigator->get_global_position()->alt;
|
||||
if (pos_sp_triplet->current.valid) {
|
||||
altitude = pos_sp_triplet->current.alt;
|
||||
}
|
||||
|
||||
_mission_item.nav_cmd = NAV_CMD_WAYPOINT;
|
||||
_mission_item.autocontinue = true;
|
||||
_mission_item.time_inside = 0;
|
||||
_mission_item.altitude = altitude;
|
||||
}
|
||||
|
||||
/* we just moved to the landing waypoint, now descend */
|
||||
|
||||
Reference in New Issue
Block a user