From 8369e11417047d8cf7677a995f7f828e214765da Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Tue, 27 Oct 2020 17:06:48 -0700 Subject: [PATCH] fix driver camera AE and grey panda deprecation (#2426) --- RELEASES.md | 3 ++- cereal/car.capnp | 2 +- installer/updater/update.json | 8 ++++---- launch_chffrplus.sh | 2 -- launch_env.sh | 2 +- selfdrive/camerad/cameras/camera_common.cc | 3 ++- selfdrive/car/car_helpers.py | 4 +++- selfdrive/controls/controlsd.py | 2 +- selfdrive/controls/lib/events.py | 8 ++++++++ selfdrive/ui/android/ui.cc | 4 ++++ 10 files changed, 26 insertions(+), 12 deletions(-) diff --git a/RELEASES.md b/RELEASES.md index 8149ce4d..c3a5bd0e 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -1,5 +1,6 @@ -Version 0.7.10 (2020-10-26) +Version 0.7.10 (2020-10-29) ======================== + * Grey panda is deprecated, upgrade to comma two or black panda * NEOS update: update to Python 3.8.2 and lower CPU frequency * Improved thermals due to reduced CPU frequency * Update SNPE to 1.41.0 diff --git a/cereal/car.capnp b/cereal/car.capnp index 558107a4..2c34b450 100644 --- a/cereal/car.capnp +++ b/cereal/car.capnp @@ -95,6 +95,7 @@ struct CarEvent @0x9b1657f34caf3ad3 { fcw @79; steerSaturated @80; whitePandaUnsupported @81; + startupGreyPanda @82; belowEngageSpeed @84; noGps @85; wrongCruiseMode @87; @@ -112,7 +113,6 @@ struct CarEvent @0x9b1657f34caf3ad3 { calibrationProgressDEPRECATED @47; invalidGiraffeHondaDEPRECATED @49; canErrorPersistentDEPRECATED @83; - startupWhitePandaDEPRECATED @82; focusRecoverActiveDEPRECATED @86; neosUpdateRequiredDEPRECATED @88; } diff --git a/installer/updater/update.json b/installer/updater/update.json index 046793a8..ef02bfae 100644 --- a/installer/updater/update.json +++ b/installer/updater/update.json @@ -1,7 +1,7 @@ { - "ota_url": "https://commadist.azureedge.net/neosupdate/ota-signed-ba3ecb158edc760beda0d32e0eea4311031e460afa97fc180dc83f76cf512694.zip", - "ota_hash": "ba3ecb158edc760beda0d32e0eea4311031e460afa97fc180dc83f76cf512694", - "recovery_url": "https://commadist.azureedge.net/neosupdate/recovery-e35dc1939dab4c6c2cbae3f225b07515f1a5c02afb232dc22e93f17c9840499f.img", + "ota_url": "https://commadist.azureedge.net/neosupdate/ota-signed-e85f507777cb6b22f88ba1c8be6bbaa2630c484b971344b645fca2d1c461cd47.zip", + "ota_hash": "e85f507777cb6b22f88ba1c8be6bbaa2630c484b971344b645fca2d1c461cd47", + "recovery_url": "https://commadist.azureedge.net/neosupdate/recovery-db31ffe79dfd60be966fba6d1525a5081a920062b883644dc8f5734bcc6806bb.img", "recovery_len": 15926572, - "recovery_hash": "e35dc1939dab4c6c2cbae3f225b07515f1a5c02afb232dc22e93f17c9840499f" + "recovery_hash": "db31ffe79dfd60be966fba6d1525a5081a920062b883644dc8f5734bcc6806bb" } diff --git a/launch_chffrplus.sh b/launch_chffrplus.sh index 9686c436..e7fd3a25 100755 --- a/launch_chffrplus.sh +++ b/launch_chffrplus.sh @@ -27,8 +27,6 @@ function two_init { [ -d "/proc/irq/733" ] && echo 3 > /proc/irq/733/smp_affinity_list # USB for LeEco [ -d "/proc/irq/736" ] && echo 3 > /proc/irq/736/smp_affinity_list # USB for OP3T - # restrict unbound kworkers to first two cores - #find /sys/devices/virtual/workqueue -name cpumask -exec sh -c 'echo 3 > {}' ';' # Check for NEOS update if [ $(< /VERSION) != "$REQUIRED_NEOS_VERSION" ]; then diff --git a/launch_env.sh b/launch_env.sh index ac578fac..ca8f4e8a 100755 --- a/launch_env.sh +++ b/launch_env.sh @@ -7,7 +7,7 @@ export OPENBLAS_NUM_THREADS=1 export VECLIB_MAXIMUM_THREADS=1 if [ -z "$REQUIRED_NEOS_VERSION" ]; then - export REQUIRED_NEOS_VERSION="15" + export REQUIRED_NEOS_VERSION="15-1" fi if [ -z "$PASSIVE" ]; then diff --git a/selfdrive/camerad/cameras/camera_common.cc b/selfdrive/camerad/cameras/camera_common.cc index ac44903f..47120bcd 100644 --- a/selfdrive/camerad/cameras/camera_common.cc +++ b/selfdrive/camerad/cameras/camera_common.cc @@ -293,7 +293,8 @@ void set_exposure_target(CameraState *c, const uint8_t *pix_ptr, bool front, int uint8_t lum = pix_ptr[(y * b->yuv_width) + x]; lum_binning[lum]++; } else { - const uint8_t *pix = &pix_ptr[y * b->rgb_width * 3 + x * 3]; + // TODO: should get rid of RGB here + const uint8_t *pix = &pix_ptr[y * b->rgb_stride + x * 3]; unsigned int lum = (unsigned int)(pix[0] + pix[1] + pix[2]); lum_binning[std::min(lum / 3, 255u)]++; } diff --git a/selfdrive/car/car_helpers.py b/selfdrive/car/car_helpers.py index e79b03cc..3df7c4c5 100644 --- a/selfdrive/car/car_helpers.py +++ b/selfdrive/car/car_helpers.py @@ -14,7 +14,7 @@ EventName = car.CarEvent.EventName HwType = log.HealthData.HwType -def get_startup_event(car_recognized, controller_available): +def get_startup_event(car_recognized, controller_available, hw_type): if comma_remote and tested_branch: event = EventName.startup else: @@ -24,6 +24,8 @@ def get_startup_event(car_recognized, controller_available): event = EventName.startupNoCar elif car_recognized and not controller_available: event = EventName.startupNoControl + elif hw_type == HwType.greyPanda: + event = EventName.startupGreyPanda return event diff --git a/selfdrive/controls/controlsd.py b/selfdrive/controls/controlsd.py index 8dd19a54..a9149806 100755 --- a/selfdrive/controls/controlsd.py +++ b/selfdrive/controls/controlsd.py @@ -131,7 +131,7 @@ class Controls: self.sm['dMonitoringState'].awarenessStatus = 1. self.sm['dMonitoringState'].faceDetected = False - self.startup_event = get_startup_event(car_recognized, controller_available) + self.startup_event = get_startup_event(car_recognized, controller_available, hw_type) if not sounds_available: self.events.add(EventName.soundsUnavailable, static=True) diff --git a/selfdrive/controls/lib/events.py b/selfdrive/controls/lib/events.py index be23d3b0..0c094d40 100644 --- a/selfdrive/controls/lib/events.py +++ b/selfdrive/controls/lib/events.py @@ -252,6 +252,14 @@ EVENTS: Dict[int, Dict[str, Union[Alert, Callable[[Any, messaging.SubMaster, boo Priority.LOWER, VisualAlert.none, AudibleAlert.none, 0., 0., 15.), }, + EventName.startupGreyPanda: { + ET.PERMANENT: Alert( + "WARNING: Grey panda is deprecated", + "Upgrade to comma two or black panda", + AlertStatus.userPrompt, AlertSize.mid, + Priority.LOWER, VisualAlert.none, AudibleAlert.none, 0., 0., 15.), + }, + EventName.invalidGiraffeToyota: { ET.PERMANENT: Alert( "Unsupported Giraffe Configuration", diff --git a/selfdrive/ui/android/ui.cc b/selfdrive/ui/android/ui.cc index 24a0db2a..08b734a6 100644 --- a/selfdrive/ui/android/ui.cc +++ b/selfdrive/ui/android/ui.cc @@ -59,6 +59,10 @@ static void handle_display_state(UIState *s, bool user_input) { int display_mode = s->awake ? HWC_POWER_MODE_NORMAL : HWC_POWER_MODE_OFF; LOGW("setting display mode %d", display_mode); framebuffer_set_power(s->fb, display_mode); + + if (s->awake) { + system("service call window 18 i32 1"); + } } }