Auto Traj - Disable reActivate "reset" function for AutoLineSmoothVel Flight Task

This commit is contained in:
bresch 2018-10-23 15:24:57 +02:00 committed by Roman Bapst
parent 0209fa00bf
commit 2c63388fb7
5 changed files with 20 additions and 1 deletions

View File

@ -133,7 +133,7 @@ const char *FlightTasks::errorToString(const int error)
void FlightTasks::reActivate()
{
if (_current_task.task) {
_current_task.task->activate();
_current_task.task->reActivate();
}
}

View File

@ -52,6 +52,14 @@ bool FlightTaskAutoLineSmoothVel::activate()
return ret;
}
void FlightTaskAutoLineSmoothVel::reActivate()
{
// Don't reset during takeoff TODO: Find a proper solution
// The issue here is that with a small increment of velocity setpoint (generated by this flight task), the
// land detector doesn't detect takeoff and without takeoff detection, the
// flight task is always reset.
}
void FlightTaskAutoLineSmoothVel::_setDefaultConstraints()
{
FlightTaskAuto::_setDefaultConstraints();

View File

@ -50,6 +50,7 @@ public:
virtual ~FlightTaskAutoLineSmoothVel() = default;
bool activate() override;
void reActivate() override;
protected:

View File

@ -38,6 +38,11 @@ bool FlightTask::activate()
return true;
}
void FlightTask::reActivate()
{
activate();
}
bool FlightTask::updateInitialize()
{
_time_stamp_current = hrt_absolute_time();

View File

@ -78,6 +78,11 @@ public:
*/
virtual bool activate();
/**
* Call this to reset an active Flight Task
*/
virtual void reActivate();
/**
* To be called to adopt parameters from an arrived vehicle command
* @return true if accepted, false if declined