mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-01 10:01:35 +08:00
mission: handle precision landing inactivation properly
This commit is contained in:
committed by
Julian Oes
parent
a758ea1220
commit
7eee9deb4c
@@ -143,6 +143,10 @@ Mission::on_inactivation()
|
|||||||
cmd.param1 = -1.0f;
|
cmd.param1 = -1.0f;
|
||||||
cmd.param3 = 1.0f;
|
cmd.param3 = 1.0f;
|
||||||
_navigator->publish_vehicle_cmd(&cmd);
|
_navigator->publish_vehicle_cmd(&cmd);
|
||||||
|
|
||||||
|
if (_navigator->get_precland()->is_activated()) {
|
||||||
|
_navigator->get_precland()->on_inactivation();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -174,17 +178,6 @@ 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 */
|
||||||
@@ -270,6 +263,13 @@ Mission::on_active()
|
|||||||
|
|
||||||
do_abort_landing();
|
do_abort_landing();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (_work_item_type == WORK_ITEM_TYPE_PRECISION_LAND) {
|
||||||
|
_navigator->get_precland()->on_active();
|
||||||
|
|
||||||
|
} else if (_navigator->get_precland()->is_activated()) {
|
||||||
|
_navigator->get_precland()->on_inactivation();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
|
|||||||
Reference in New Issue
Block a user