Honda: do same standstill check as panda (#24262)
* check standstill against panda * use XMISSION_SPEED for all, and compare to 0 * fix * only check for Honda for now * update comment * update refs * update refs and update check * phantom commit old-commit-hash: 6de434f2ecee89e86c011bece57cb205c4c047e3
This commit is contained in:
@@ -181,18 +181,14 @@ class CarState(CarStateBase):
|
||||
self.prev_cruise_setting = self.cruise_setting
|
||||
|
||||
# ******************* parse out can *******************
|
||||
# TODO: find wheels moving bit in dbc
|
||||
# STANDSTILL->WHEELS_MOVING bit can be noisy around zero, so use XMISSION_SPEED
|
||||
# panda checks if the signal is non-zero
|
||||
ret.standstill = cp.vl["ENGINE_DATA"]["XMISSION_SPEED"] < 1e-5
|
||||
if self.CP.carFingerprint in (CAR.ACCORD, CAR.ACCORDH, CAR.CIVIC_BOSCH, CAR.CIVIC_BOSCH_DIESEL, CAR.CRV_HYBRID, CAR.INSIGHT, CAR.ACURA_RDX_3G, CAR.HONDA_E):
|
||||
ret.standstill = cp.vl["ENGINE_DATA"]["XMISSION_SPEED"] < 0.1
|
||||
ret.doorOpen = bool(cp.vl["SCM_FEEDBACK"]["DRIVERS_DOOR_OPEN"])
|
||||
elif self.CP.carFingerprint == CAR.ODYSSEY_CHN:
|
||||
ret.standstill = cp.vl["ENGINE_DATA"]["XMISSION_SPEED"] < 0.1
|
||||
ret.doorOpen = bool(cp.vl["SCM_BUTTONS"]["DRIVERS_DOOR_OPEN"])
|
||||
elif self.CP.carFingerprint in (CAR.FREED, CAR.HRV):
|
||||
ret.standstill = not cp.vl["STANDSTILL"]["WHEELS_MOVING"]
|
||||
elif self.CP.carFingerprint in (CAR.ODYSSEY_CHN, CAR.FREED, CAR.HRV):
|
||||
ret.doorOpen = bool(cp.vl["SCM_BUTTONS"]["DRIVERS_DOOR_OPEN"])
|
||||
else:
|
||||
ret.standstill = not cp.vl["STANDSTILL"]["WHEELS_MOVING"]
|
||||
ret.doorOpen = any([cp.vl["DOORS_STATUS"]["DOOR_OPEN_FL"], cp.vl["DOORS_STATUS"]["DOOR_OPEN_FR"],
|
||||
cp.vl["DOORS_STATUS"]["DOOR_OPEN_RL"], cp.vl["DOORS_STATUS"]["DOOR_OPEN_RR"]])
|
||||
ret.seatbeltUnlatched = bool(cp.vl["SEATBELT_STATUS"]["SEATBELT_DRIVER_LAMP"] or not cp.vl["SEATBELT_STATUS"]["SEATBELT_DRIVER_LATCHED"])
|
||||
|
||||
@@ -245,6 +245,8 @@ class TestCarModel(unittest.TestCase):
|
||||
|
||||
if self.CP.carName == "honda":
|
||||
checks['mainOn'] += CS.cruiseState.available != self.safety.get_acc_main_on()
|
||||
# TODO: fix standstill mismatches for other makes
|
||||
checks['standstill'] += CS.standstill == self.safety.get_vehicle_moving()
|
||||
|
||||
CS_prev = CS
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
185f5f9c8d878ad4b98664afc7147400476208cc
|
||||
ea48ff4478914b6aff56a979a647fe13b4993711
|
||||
Reference in New Issue
Block a user