From 6affbf97ebbc8a34922b7644f62c070135375f6e Mon Sep 17 00:00:00 2001 From: firestar5683 <168790843+firestar5683@users.noreply.github.com> Date: Wed, 7 Oct 2026 02:38:46 -0500 Subject: [PATCH] Restore Volt cruise engagement --- opendbc_repo/opendbc/car/gm/carstate.py | 4 +++- opendbc_repo/opendbc/car/gm/tests/test_volt_cc_gas.py | 5 +++++ opendbc_repo/opendbc/car/gm/tests/test_volt_transitions.py | 4 ++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/opendbc_repo/opendbc/car/gm/carstate.py b/opendbc_repo/opendbc/car/gm/carstate.py index 515feea27d..452c201628 100644 --- a/opendbc_repo/opendbc/car/gm/carstate.py +++ b/opendbc_repo/opendbc/car/gm/carstate.py @@ -502,7 +502,8 @@ class CarState(CarStateBase): ret.cruiseState.standstill = False ret.cruiseState.speed = pt_cp.vl["ECMCruiseControl"]["CruiseSetSpeed"] * CV.KPH_TO_MS ret.cruiseState.nonAdaptive = not (is_silverado_cc_stock_profile(self.CP) or - is_ordinary_cc_profile(self.CP) or is_conventional_cc_pedal_profile(self.CP)) + is_ordinary_cc_profile(self.CP) or is_conventional_cc_pedal_profile(self.CP) or + is_volt_cc_profile(self.CP)) if self.hybrid_profile is not None: ret.accFaulted = False ret.cruiseState.enabled = bool(pt_cp.vl["ECMCruiseControl"]["CruiseActive"]) @@ -569,6 +570,7 @@ class CarState(CarStateBase): ret.stockFcw = self.stock_fcw_alert != 0 if self.volt_cc_pedal_profile is not None: + ret.cruiseState.nonAdaptive = False ret.brakePressed = bool(pt_cp.vl["ECMEngineStatus"]["BrakePressed"]) ret.accFaulted = False # ACC status is not a conventional-cruise fault source. ret.cruiseState.enabled = bool(pt_cp.vl["ECMCruiseControl"]["CruiseActive"]) diff --git a/opendbc_repo/opendbc/car/gm/tests/test_volt_cc_gas.py b/opendbc_repo/opendbc/car/gm/tests/test_volt_cc_gas.py index b17a49c5dd..181453590c 100644 --- a/opendbc_repo/opendbc/car/gm/tests/test_volt_cc_gas.py +++ b/opendbc_repo/opendbc/car/gm/tests/test_volt_cc_gas.py @@ -33,6 +33,11 @@ class TestVoltCcGas(unittest.TestCase): for source in sources: native('rx', source, now // 1000) self.assertTrue(out.canValid) + self.assertFalse(out.cruiseState.nonAdaptive) + from openpilot.selfdrive.car.car_events import CarEvents + from openpilot.cereal import log + events = CarEvents(cp).update(out, structs.CarState(), structs.CarControl()) + self.assertNotIn(log.OnroadEvent.EventName.wrongCruiseMode, events.names) return cp, ci, packer, now @staticmethod diff --git a/opendbc_repo/opendbc/car/gm/tests/test_volt_transitions.py b/opendbc_repo/opendbc/car/gm/tests/test_volt_transitions.py index 3b5dce6369..0f704a2413 100644 --- a/opendbc_repo/opendbc/car/gm/tests/test_volt_transitions.py +++ b/opendbc_repo/opendbc/car/gm/tests/test_volt_transitions.py @@ -715,6 +715,7 @@ class TestVoltCcPedalProfiles(unittest.TestCase): self.assertIsNotNone(volt_cc_pedal_profile(cp)) def test_actual_parser_keeps_cc_engagement_and_pedal_telemetry_distinct(self): + from openpilot.selfdrive.car.car_events import CarEvents, EventName from itertools import product from opendbc.can import CANPacker, CANParser from opendbc.car import Bus @@ -762,6 +763,9 @@ class TestVoltCcPedalProfiles(unittest.TestCase): self.assertTrue(state.canValid) self.assertTrue(state.cruiseState.enabled) self.assertAlmostEqual(state.cruiseState.speed, 80 / 3.6, places=4) + self.assertFalse(state.cruiseState.nonAdaptive) + events = CarEvents(cp).update(state.as_reader(), structs.CarState().as_reader(), command.as_reader()) + self.assertNotIn(EventName.wrongCruiseMode, events.names) self.assertFalse(state.accFaulted) if release: self.assertFalse(any(a == 0x200 for a, _, _ in tx))