From dff758f71b1a21927541400cd7e1adeb73438f07 Mon Sep 17 00:00:00 2001 From: firestar5683 <168790843+firestar5683@users.noreply.github.com> Date: Thu, 23 Apr 2026 09:25:35 -0500 Subject: [PATCH] Volt no camera? --- opendbc_repo/opendbc/car/gm/carcontroller.py | 12 ++++++++++-- opendbc_repo/opendbc/car/gm/tests/test_gm.py | 17 ++++++++++++++++- 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/opendbc_repo/opendbc/car/gm/carcontroller.py b/opendbc_repo/opendbc/car/gm/carcontroller.py index 9bfb815dd..d982dda16 100644 --- a/opendbc_repo/opendbc/car/gm/carcontroller.py +++ b/opendbc_repo/opendbc/car/gm/carcontroller.py @@ -53,6 +53,15 @@ def should_spoof_dash_speed(CP, starpilot_toggles): return True +def should_send_acc_dashboard_status(CP, dash_speed_spoof_active): + status_car = CP.carFingerprint not in CC_ONLY_CAR or CP.carFingerprint == CAR.CHEVROLET_BOLT_ACC_2022_2023_PEDAL + volt_camera_no_camera = ( + CP.carFingerprint == CAR.CHEVROLET_VOLT_CAMERA and + bool(getattr(CP, "flags", 0) & GMFlags.NO_CAMERA.value) + ) + return status_car and (dash_speed_spoof_active or volt_camera_no_camera) + + ECM_CRUISE_SPOOF_CARS = { CAR.CHEVROLET_BOLT_CC_2017, CAR.CHEVROLET_BOLT_CC_2018_2021, @@ -556,8 +565,7 @@ class CarController(CarControllerBase): can_sends.append(gmcan.create_friction_brake_command(self.packer_ch, friction_brake_bus, self.apply_brake, idx, CC.enabled, near_stop, at_full_stop, self.CP)) - is_bolt_acc_pedal = self.CP.carFingerprint == CAR.CHEVROLET_BOLT_ACC_2022_2023_PEDAL - if dash_speed_spoof_active and (self.CP.carFingerprint not in CC_ONLY_CAR or is_bolt_acc_pedal): + if should_send_acc_dashboard_status(self.CP, dash_speed_spoof_active): send_fcw = hud_alert == VisualAlert.fcw can_sends.append(gmcan.create_acc_dashboard_command(self.packer_pt, CanBus.POWERTRAIN, CC.enabled, hud_v_cruise * CV.MS_TO_KPH, hud_control, send_fcw)) diff --git a/opendbc_repo/opendbc/car/gm/tests/test_gm.py b/opendbc_repo/opendbc/car/gm/tests/test_gm.py index ec93ae927..145379d68 100644 --- a/opendbc_repo/opendbc/car/gm/tests/test_gm.py +++ b/opendbc_repo/opendbc/car/gm/tests/test_gm.py @@ -6,7 +6,7 @@ from opendbc.can import CANPacker from opendbc.car import Bus, DT_CTRL from opendbc.car.car_helpers import interfaces from opendbc.car.gm import gmcan -from opendbc.car.gm.carcontroller import should_send_cc_button_spam, should_spoof_dash_speed +from opendbc.car.gm.carcontroller import should_send_acc_dashboard_status, should_send_cc_button_spam, should_spoof_dash_speed import opendbc.car.gm.interface as gm_interface from opendbc.car.common.conversions import Conversions as CV from opendbc.car.gm.fingerprints import FINGERPRINTS @@ -108,6 +108,21 @@ class TestGMCarController: assert should_spoof_dash_speed(cp, SimpleNamespace(disable_openpilot_long=False)) + def test_volt_camera_no_camera_sends_acc_dashboard_without_dash_spoof(self): + cp = SimpleNamespace(carFingerprint=CAR.CHEVROLET_VOLT_CAMERA, flags=GMFlags.NO_CAMERA.value) + + assert should_send_acc_dashboard_status(cp, dash_speed_spoof_active=False) + + def test_acc_dashboard_no_camera_exception_is_volt_camera_only(self): + assert not should_send_acc_dashboard_status( + SimpleNamespace(carFingerprint=CAR.CHEVROLET_VOLT_CAMERA, flags=0), + dash_speed_spoof_active=False, + ) + assert not should_send_acc_dashboard_status( + SimpleNamespace(carFingerprint=CAR.CHEVROLET_VOLT_CC, flags=GMFlags.NO_CAMERA.value), + dash_speed_spoof_active=False, + ) + def test_cc_button_spam_does_not_require_stock_cruise_enabled(self): cp = SimpleNamespace(flags=GMFlags.CC_LONG.value, minEnableSpeed=10.0) cc = SimpleNamespace(longActive=True)