Skip to content

Commit

Permalink
fix driver camera AE and grey panda deprecation (commaai#2426)
Browse files Browse the repository at this point in the history
  • Loading branch information
adeebshihadeh authored Oct 28, 2020
1 parent 26bccbd commit 8369e11
Show file tree
Hide file tree
Showing 10 changed files with 26 additions and 12 deletions.
3 changes: 2 additions & 1 deletion RELEASES.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion cereal/car.capnp
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ struct CarEvent @0x9b1657f34caf3ad3 {
fcw @79;
steerSaturated @80;
whitePandaUnsupported @81;
startupGreyPanda @82;
belowEngageSpeed @84;
noGps @85;
wrongCruiseMode @87;
Expand All @@ -112,7 +113,6 @@ struct CarEvent @0x9b1657f34caf3ad3 {
calibrationProgressDEPRECATED @47;
invalidGiraffeHondaDEPRECATED @49;
canErrorPersistentDEPRECATED @83;
startupWhitePandaDEPRECATED @82;
focusRecoverActiveDEPRECATED @86;
neosUpdateRequiredDEPRECATED @88;
}
Expand Down
8 changes: 4 additions & 4 deletions installer/updater/update.json
Original file line number Diff line number Diff line change
@@ -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"
}
2 changes: 0 additions & 2 deletions launch_chffrplus.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion launch_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion selfdrive/camerad/cameras/camera_common.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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)]++;
}
Expand Down
4 changes: 3 additions & 1 deletion selfdrive/car/car_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
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:
Expand All @@ -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


Expand Down
2 changes: 1 addition & 1 deletion selfdrive/controls/controlsd.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def __init__(self, sm=None, pm=None, can_sock=None):
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)
Expand Down
8 changes: 8 additions & 0 deletions selfdrive/controls/lib/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,14 @@ def wrong_car_mode_alert(CP: car.CarParams, sm: messaging.SubMaster, metric: 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",
Expand Down
4 changes: 4 additions & 0 deletions selfdrive/ui/android/ui.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
}
}

Expand Down

0 comments on commit 8369e11

Please sign in to comment.