mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-22 11:53:34 +08:00
Navigator: Use maximum flight altitude to limit missions
This change limits all mission items to the maximum flight altitude. The mission will still be executed and flown, but the vehicle will never exceed the mission altitude. This ensures the vehicle can always reach the mission items. Wether or not the entire mission should be rejected if it falls outside of the fenced area is enforced in the mission feasibility checker function.
This commit is contained in:
@@ -508,6 +508,7 @@ Mission::set_mission_items()
|
||||
|
||||
/* update position setpoint triplet */
|
||||
pos_sp_triplet->previous.valid = false;
|
||||
mission_apply_limitation(&_mission_item);
|
||||
mission_item_to_position_setpoint(_mission_item, &pos_sp_triplet->current);
|
||||
pos_sp_triplet->next.valid = false;
|
||||
|
||||
@@ -764,6 +765,7 @@ Mission::set_mission_items()
|
||||
set_align_mission_item(&_mission_item, &mission_item_next_position);
|
||||
|
||||
/* set position setpoint to target during the transition */
|
||||
mission_apply_limitation(&_mission_item);
|
||||
mission_item_to_position_setpoint(mission_item_next_position, &pos_sp_triplet->current);
|
||||
}
|
||||
|
||||
@@ -806,6 +808,7 @@ Mission::set_mission_items()
|
||||
/*********************************** set setpoints and check next *********************************************/
|
||||
|
||||
/* set current position setpoint from mission item (is protected against non-position items) */
|
||||
mission_apply_limitation(&_mission_item);
|
||||
mission_item_to_position_setpoint(_mission_item, &pos_sp_triplet->current);
|
||||
|
||||
/* issue command if ready (will do nothing for position mission items) */
|
||||
@@ -832,6 +835,7 @@ Mission::set_mission_items()
|
||||
/* try to process next mission item */
|
||||
if (has_next_position_item) {
|
||||
/* got next mission item, update setpoint triplet */
|
||||
mission_apply_limitation(&_mission_item);
|
||||
mission_item_to_position_setpoint(mission_item_next_position, &pos_sp_triplet->next);
|
||||
|
||||
} else {
|
||||
@@ -1183,6 +1187,7 @@ Mission::do_abort_landing()
|
||||
_mission_item.origin = ORIGIN_ONBOARD;
|
||||
|
||||
struct position_setpoint_triplet_s *pos_sp_triplet = _navigator->get_position_setpoint_triplet();
|
||||
mission_apply_limitation(&_mission_item);
|
||||
mission_item_to_position_setpoint(_mission_item, &pos_sp_triplet->current);
|
||||
_navigator->set_position_setpoint_triplet_updated();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user