ManualControl: put input processing in separate testable function

This commit is contained in:
Matthias Grob
2023-05-09 16:53:00 +02:00
parent 8dc73c4621
commit 3b2b60adde
2 changed files with 13 additions and 6 deletions
+10 -6
View File
@@ -86,7 +86,16 @@ void ManualControl::Run()
updateParams();
}
const hrt_abstime now = hrt_absolute_time();
processInput(hrt_absolute_time());
// reschedule timeout
ScheduleDelayed(200_ms);
perf_end(_loop_perf);
}
void ManualControl::processInput(hrt_abstime now)
{
_selector.updateValidityOfChosenInput(now);
for (int i = 0; i < MAX_MANUAL_INPUT_COUNT; i++) {
@@ -267,11 +276,6 @@ void ManualControl::Run()
}
_last_time = now;
// reschedule timeout
ScheduleDelayed(200_ms);
perf_end(_loop_perf);
}
void ManualControl::updateParams()