ui brightness: fix exposure scale factor (#26104)

old-commit-hash: f957f3391d
taco
Willem Melching 3 years ago committed by GitHub
parent daa35e27c0
commit e31ca17926
  1. 3
      selfdrive/ui/ui.cc

@ -163,7 +163,8 @@ static void update_state(UIState *s) {
scene.longitudinal_control = sm["carParams"].getCarParams().getOpenpilotLongitudinalControl();
}
if (sm.updated("wideRoadCameraState")) {
scene.light_sensor = 100.0f - sm["wideRoadCameraState"].getWideRoadCameraState().getExposureValPercent();
float scale = (sm["wideRoadCameraState"].getWideRoadCameraState().getSensor() == cereal::FrameData::ImageSensor::AR0321) ? 6.0f : 1.0f;
scene.light_sensor = std::max(100.0f - scale * sm["wideRoadCameraState"].getWideRoadCameraState().getExposureValPercent(), 0.0f);
}
scene.started = sm["deviceState"].getDeviceState().getStarted() && scene.ignition;
}

Loading…
Cancel
Save