mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-02 03:49:12 +08:00
mission: ensure precland::on_inactivation() is called once landed
This commit is contained in:
committed by
Beat Küng
parent
6295a55a87
commit
7ebaf9a1cb
@@ -174,6 +174,17 @@ Mission::on_activation()
|
|||||||
void
|
void
|
||||||
Mission::on_active()
|
Mission::on_active()
|
||||||
{
|
{
|
||||||
|
if (_work_item_type == WORK_ITEM_TYPE_PRECISION_LAND) {
|
||||||
|
// switch out of precision land once landed
|
||||||
|
if (_navigator->get_land_detected()->landed) {
|
||||||
|
_navigator->get_precland()->on_inactivation();
|
||||||
|
_work_item_type = WORK_ITEM_TYPE_DEFAULT;
|
||||||
|
|
||||||
|
} else {
|
||||||
|
_navigator->get_precland()->on_active();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
check_mission_valid(false);
|
check_mission_valid(false);
|
||||||
|
|
||||||
/* check if anything has changed */
|
/* check if anything has changed */
|
||||||
@@ -263,17 +274,6 @@ Mission::on_active()
|
|||||||
|
|
||||||
do_abort_landing();
|
do_abort_landing();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_work_item_type == WORK_ITEM_TYPE_PRECISION_LAND) {
|
|
||||||
// switch out of precision land once landed
|
|
||||||
if (_navigator->get_land_detected()->landed) {
|
|
||||||
_navigator->get_precland()->on_inactivation();
|
|
||||||
_work_item_type = WORK_ITEM_TYPE_DEFAULT;
|
|
||||||
|
|
||||||
} else {
|
|
||||||
_navigator->get_precland()->on_active();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
|
|||||||
Reference in New Issue
Block a user