Honda Bosch: switch ACC_HUD between metric/imperial (#22428)

* Honda Bosch: switch ACC_HUD between metric/imperial

* bump opendbc
pull/22431/head
Willem Melching 4 years ago committed by GitHub
parent 2253cba98b
commit 26ce0fa0cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      opendbc
  2. 9
      selfdrive/car/honda/carstate.py

@ -1 +1 @@
Subproject commit 1bf5b62008b91456616fda342771a2ecd1b8c296 Subproject commit 8ca52eb1f84a76c07ab6385adf64c1ee6a1a5517

@ -80,9 +80,11 @@ def get_can_signals(CP, gearbox_msg, main_on_sig_msg):
if CP.carFingerprint in HONDA_BOSCH: if CP.carFingerprint in HONDA_BOSCH:
signals += [ signals += [
("EPB_STATE", "EPB_STATUS", 0), ("EPB_STATE", "EPB_STATUS", 0),
("IMPERIAL_UNIT", "CAR_SPEED", 1),
] ]
checks += [ checks += [
("EPB_STATUS", 50), ("EPB_STATUS", 50),
("CAR_SPEED", 10),
] ]
if not CP.openpilotLongitudinalControl: if not CP.openpilotLongitudinalControl:
@ -291,7 +293,12 @@ class CarState(CarStateBase):
ret.brakePressed = True ret.brakePressed = True
# TODO: discover the CAN msg that has the imperial unit bit for all other cars # TODO: discover the CAN msg that has the imperial unit bit for all other cars
self.is_metric = not cp.vl["HUD_SETTING"]["IMPERIAL_UNIT"] if self.CP.carFingerprint in (CAR.CIVIC) else False if self.CP.carFingerprint in (CAR.CIVIC, ):
self.is_metric = not cp.vl["HUD_SETTING"]["IMPERIAL_UNIT"]
elif self.CP.carFingerprint in HONDA_BOSCH:
self.is_metric = not cp.vl["CAR_SPEED"]["IMPERIAL_UNIT"]
else:
self.is_metric = False
if self.CP.carFingerprint in HONDA_BOSCH: if self.CP.carFingerprint in HONDA_BOSCH:
ret.stockAeb = (not self.CP.openpilotLongitudinalControl) and bool(cp.vl["ACC_CONTROL"]["AEB_STATUS"] and cp.vl["ACC_CONTROL"]["ACCEL_COMMAND"] < -1e-5) ret.stockAeb = (not self.CP.openpilotLongitudinalControl) and bool(cp.vl["ACC_CONTROL"]["AEB_STATUS"] and cp.vl["ACC_CONTROL"]["ACCEL_COMMAND"] < -1e-5)

Loading…
Cancel
Save