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

pull/21652/head
Willem Melching 2021-07-19 12:41:32 +02:00 committed by GitHub
parent f9f43578d1
commit 1c40b8092c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -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) {