mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-09 14:01:36 +08:00
Make LandingTargetEstimator a lib and run on work_queue
Currently only precision landing is using the LandingTargetEstimator and it is a waste to have it running in the background all the time. With this change the estimator is only started once the precision landing flight task is activated, and stopped when the flight task is deactivated.
This commit is contained in:
+10
@@ -45,6 +45,16 @@
|
||||
|
||||
static constexpr const char *LOST_TARGET_ERROR_MESSAGE = "Lost landing target while landing";
|
||||
|
||||
FlightTaskAutoPrecisionLanding::FlightTaskAutoPrecisionLanding()
|
||||
{
|
||||
_landing_target_estimator.Start();
|
||||
}
|
||||
|
||||
FlightTaskAutoPrecisionLanding::~FlightTaskAutoPrecisionLanding()
|
||||
{
|
||||
_landing_target_estimator.Stop();
|
||||
}
|
||||
|
||||
bool FlightTaskAutoPrecisionLanding::activate(const trajectory_setpoint_s &last_setpoint)
|
||||
{
|
||||
bool ret = FlightTask::activate(last_setpoint);
|
||||
|
||||
Reference in New Issue
Block a user