mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-07-04 21:12:07 +08:00
fix dcam AE feedback loop with IR LEDs (#21651)
old-commit-hash: 1c40b8092ccc5370b69104fa027f244b829b19a5
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user