Skip to content
Snippets Groups Projects
Commit 2af253fa authored by Dennis Mannhart's avatar Dennis Mannhart Committed by Lorenz Meier
Browse files

FlightTaskManual: sticks not to be finite

activation method not needed
parent 6a7a7d7f
No related branches found
No related tags found
No related merge requests found
......@@ -65,21 +65,6 @@ bool FlightTaskManual::updateInitialize()
return ret;
}
bool FlightTaskManual::activate()
{
bool ret = FlightTask::activate();
if (_sticks_data_required) {
// need valid stick inputs
ret = ret && PX4_ISFINITE(_sticks(0))
&& PX4_ISFINITE(_sticks(1))
&& PX4_ISFINITE(_sticks(2))
&& PX4_ISFINITE(_sticks(3));
}
return ret;
}
bool FlightTaskManual::_evaluateSticks()
{
/* Sticks are rescaled linearly and exponentially to [-1,1] */
......@@ -111,7 +96,13 @@ bool FlightTaskManual::_evaluateSticks()
_applyGearSwitch(gear_switch);
}
return true;
// valid stick inputs are required
const bool valid_sticks = PX4_ISFINITE(_sticks(0))
&& PX4_ISFINITE(_sticks(1))
&& PX4_ISFINITE(_sticks(2))
&& PX4_ISFINITE(_sticks(3));
return valid_sticks;
} else {
/* Timeout: set all sticks to zero */
......
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