mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-23 15:43:33 +08:00
Navigator Mission RTL (#8749)
* Add return to land to mission This method uses the planned mission for rtl. If a landing sequence is present it will continue the mission and land. If not it will fly back the mission and loiter/land at the home position.
This commit is contained in:
committed by
Daniel Agar
parent
fdfa764913
commit
84578748f4
@@ -677,6 +677,15 @@ MissionBlock::set_idle_item(struct mission_item_s *item)
|
||||
item->origin = ORIGIN_ONBOARD;
|
||||
}
|
||||
|
||||
void
|
||||
MissionBlock::set_vtol_transition_item(struct mission_item_s *item, const uint8_t new_mode)
|
||||
{
|
||||
item->nav_cmd = NAV_CMD_DO_VTOL_TRANSITION;
|
||||
item->params[0] = (float) new_mode;
|
||||
item->yaw = _navigator->get_global_position()->yaw;
|
||||
item->autocontinue = true;
|
||||
}
|
||||
|
||||
void
|
||||
MissionBlock::mission_apply_limitation(mission_item_s &item)
|
||||
{
|
||||
@@ -705,3 +714,14 @@ MissionBlock::mission_apply_limitation(mission_item_s &item)
|
||||
* Add other limitations here
|
||||
*/
|
||||
}
|
||||
|
||||
float
|
||||
MissionBlock::get_absolute_altitude_for_item(struct mission_item_s &mission_item) const
|
||||
{
|
||||
if (mission_item.altitude_is_relative) {
|
||||
return mission_item.altitude + _navigator->get_home_position()->alt;
|
||||
|
||||
} else {
|
||||
return mission_item.altitude;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user