Hi,
Did some digging in the Maneuvers/Maneuver, and found that bind is defined such that the consume function is only called if the task is active:
|
bind(T* task_obj, bool always = false) |
|
{ |
|
if (always) |
|
{ |
|
Task::bind<M>(task_obj); |
|
} |
|
else |
|
{ |
|
void (Maneuver::* func)(const M*) = &Maneuver::consumeIfActive<M, T>; |
|
Task::bind<M>(this, func); |
|
} |
|
} |
|
|
Then I discovered that the consume functions of PathControlState and StopManeuver still check if the task is active:
|
Maneuver::consume(const IMC::PathControlState* pcs) |
|
{ |
|
if (!isActive()) |
|
return; |
|
|
and
|
Maneuver::consume(const IMC::StopManeuver* sm) |
|
{ |
|
(void)sm; |
|
|
|
if (isActive()) |
|
{ |
|
requestDeactivation(); |
|
|
|
IMC::ManeuverControlState mcs; |
|
mcs.state = IMC::ManeuverControlState::MCS_STOPPED; |
|
mcs.info = "stopped"; |
|
mcs.eta = 0; |
|
dispatch(mcs); |
|
} |
which should not be necessary (unless I'm missing something?).
Hi,
Did some digging in the Maneuvers/Maneuver, and found that bind is defined such that the consume function is only called if the task is active:
dune/src/DUNE/Maneuvers/Maneuver.hpp
Lines 146 to 158 in c0737b2
Then I discovered that the consume functions of PathControlState and StopManeuver still check if the task is active:
dune/src/DUNE/Maneuvers/Maneuver.cpp
Lines 156 to 160 in c0737b2
and
dune/src/DUNE/Maneuvers/Maneuver.cpp
Lines 139 to 152 in c0737b2
which should not be necessary (unless I'm missing something?).