Skip to content
Snippets Groups Projects
Commit c3ba2687 authored by Dennis Mannhart's avatar Dennis Mannhart Committed by Daniel Agar
Browse files

FlightTask: if not in air, reActivate the task which will set the setpoints to current

vehicle state.
parent 1f0d559d
No related branches found
No related tags found
No related merge requests found
......@@ -130,6 +130,14 @@ const char *FlightTasks::errorToString(const int error)
return "This error is not mapped to a string or is unknown.";
}
void FlightTasks::reActivate()
{
if (_current_task.task) {
_current_task.task->activate();
}
}
void FlightTasks::_updateCommand()
{
// lazy subscription to command topic
......
......@@ -131,6 +131,11 @@ public:
*/
void setYawHandler(WeatherVane *ext_yaw_handler) {_current_task.task->setYawHandler(ext_yaw_handler);}
/**
* This method will re-activate current task.
*/
void reActivate();
private:
/**
......
......@@ -692,6 +692,8 @@ MulticopterPositionControl::run()
setpoint.yawspeed = NAN;
setpoint.yaw = _states.yaw;
constraints.landing_gear = vehicle_constraints_s::GEAR_KEEP;
// reactivate the task which will reset the setpoint to current state
_flight_tasks.reActivate();
}
// limit altitude only if local position is valid
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment