diff --git a/opendbc b/opendbc index b928a20513..eb56fff37a 160000 --- a/opendbc +++ b/opendbc @@ -1 +1 @@ -Subproject commit b928a205138975346a11fede0d3101e948875eee +Subproject commit eb56fff37a4a2738df7add08779db51a0a6f38e2 diff --git a/panda b/panda index cc0fdffee6..c925407461 160000 --- a/panda +++ b/panda @@ -1 +1 @@ -Subproject commit cc0fdffee6eb5251331dc58ebc03057521e45b15 +Subproject commit c925407461e46adf3282494af6daa00b2626ebb8 diff --git a/selfdrive/car/honda/carstate.py b/selfdrive/car/honda/carstate.py index fc262ba42c..31a641e90d 100644 --- a/selfdrive/car/honda/carstate.py +++ b/selfdrive/car/honda/carstate.py @@ -239,10 +239,12 @@ class CarState(CarStateBase): ret.gearShifter = self.parse_gear_shifter(self.shifter_values.get(gear, None)) if self.CP.enableGasInterceptor: - ret.gas = (cp.vl["GAS_SENSOR"]["INTERCEPTOR_GAS"] + cp.vl["GAS_SENSOR"]["INTERCEPTOR_GAS2"]) / 2. + # Same threshold as panda, equivalent to 1e-5 with previous DBC scaling + ret.gas = (cp.vl["GAS_SENSOR"]["INTERCEPTOR_GAS"] + cp.vl["GAS_SENSOR"]["INTERCEPTOR_GAS2"]) // 2 + ret.gasPressed = ret.gas > 492 else: ret.gas = cp.vl["POWERTRAIN_DATA"]["PEDAL_GAS"] - ret.gasPressed = ret.gas > 1e-5 + ret.gasPressed = ret.gas > 1e-5 ret.steeringTorque = cp.vl["STEER_STATUS"]["STEER_TORQUE_SENSOR"] ret.steeringTorqueEps = cp.vl["STEER_MOTOR_TORQUE"]["MOTOR_TORQUE"] diff --git a/selfdrive/car/tests/routes.py b/selfdrive/car/tests/routes.py index a3daaec118..b7b110c051 100644 --- a/selfdrive/car/tests/routes.py +++ b/selfdrive/car/tests/routes.py @@ -45,6 +45,8 @@ routes = [ TestRoute("0e7a2ba168465df5|2020-10-18--14-14-22", HONDA.ACURA_RDX_3G), TestRoute("a74b011b32b51b56|2020-07-26--17-09-36", HONDA.CIVIC), + # Checks there's no controls mismatches due to pedal thresholds + TestRoute("cfb32f0fb91b173b|2022-04-06--14-54-45", HONDA.CIVIC, segment=21), TestRoute("a859a044a447c2b0|2020-03-03--18-42-45", HONDA.CRV_EU), TestRoute("68aac44ad69f838e|2021-05-18--20-40-52", HONDA.CRV), TestRoute("14fed2e5fa0aa1a5|2021-05-25--14-59-42", HONDA.CRV_HYBRID), diff --git a/selfdrive/car/tests/test_models.py b/selfdrive/car/tests/test_models.py index 8cf997a649..7e02fd2a07 100755 --- a/selfdrive/car/tests/test_models.py +++ b/selfdrive/car/tests/test_models.py @@ -215,8 +215,6 @@ class TestCarModel(unittest.TestCase): # panda intentionally has a higher threshold if self.CP.carName == "toyota" and 15 < CS.gas < 15*1.5: gas_pressed = False - if self.CP.carName == "honda": - gas_pressed = False checks['gasPressed'] += gas_pressed != self.safety.get_gas_pressed_prev() # TODO: remove this exception once this mismatch is resolved