mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-31 18:47:21 +08:00
Auto Traj - Disable reActivate "reset" function for AutoLineSmoothVel Flight Task
This commit is contained in:
@@ -133,7 +133,7 @@ const char *FlightTasks::errorToString(const int error)
|
|||||||
void FlightTasks::reActivate()
|
void FlightTasks::reActivate()
|
||||||
{
|
{
|
||||||
if (_current_task.task) {
|
if (_current_task.task) {
|
||||||
_current_task.task->activate();
|
_current_task.task->reActivate();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -52,6 +52,14 @@ bool FlightTaskAutoLineSmoothVel::activate()
|
|||||||
return ret;
|
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()
|
void FlightTaskAutoLineSmoothVel::_setDefaultConstraints()
|
||||||
{
|
{
|
||||||
FlightTaskAuto::_setDefaultConstraints();
|
FlightTaskAuto::_setDefaultConstraints();
|
||||||
|
|||||||
@@ -50,6 +50,7 @@ public:
|
|||||||
virtual ~FlightTaskAutoLineSmoothVel() = default;
|
virtual ~FlightTaskAutoLineSmoothVel() = default;
|
||||||
|
|
||||||
bool activate() override;
|
bool activate() override;
|
||||||
|
void reActivate() override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
|
|||||||
@@ -38,6 +38,11 @@ bool FlightTask::activate()
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void FlightTask::reActivate()
|
||||||
|
{
|
||||||
|
activate();
|
||||||
|
}
|
||||||
|
|
||||||
bool FlightTask::updateInitialize()
|
bool FlightTask::updateInitialize()
|
||||||
{
|
{
|
||||||
_time_stamp_current = hrt_absolute_time();
|
_time_stamp_current = hrt_absolute_time();
|
||||||
|
|||||||
@@ -78,6 +78,11 @@ public:
|
|||||||
*/
|
*/
|
||||||
virtual bool activate();
|
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
|
* To be called to adopt parameters from an arrived vehicle command
|
||||||
* @return true if accepted, false if declined
|
* @return true if accepted, false if declined
|
||||||
|
|||||||
Reference in New Issue
Block a user