fix dcam AE feedback loop with IR LEDs (#21651)

old-commit-hash: 1c40b8092c
commatwo_master
Willem Melching 4 years ago committed by GitHub
parent 40fe85f18e
commit dee6218c5e
  1. 6
      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) {

Loading…
Cancel
Save