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:
Alessandro Simovic
2023-03-29 13:18:58 +02:00
parent 5ad1611391
commit 136e2fee9b
9 changed files with 107 additions and 179 deletions
@@ -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);