diff --git a/selfdrive/boardd/boardd.cc b/selfdrive/boardd/boardd.cc index c770845af6..b260e23272 100644 --- a/selfdrive/boardd/boardd.cc +++ b/selfdrive/boardd/boardd.cc @@ -411,6 +411,8 @@ void hardware_control_thread() { bool prev_charging_disabled = false; unsigned int cnt = 0; + FirstOrderFilter integ_lines_filter(0, 10.0, 0.05); + while (!do_exit && panda->connected) { cnt++; sm.update(1000); // TODO: what happens if EINTR is sent while in sm.update? @@ -443,6 +445,10 @@ void hardware_control_thread() { if (sm.updated("driverCameraState")) { auto event = sm["driverCameraState"]; int cur_integ_lines = event.getDriverCameraState().getIntegLines(); + + if (Hardware::TICI()) { + cur_integ_lines = integ_lines_filter.update(cur_integ_lines * 2.5); + } last_front_frame_t = event.getLogMonoTime(); if (cur_integ_lines <= CUTOFF_IL) {