This commit is contained in:
firestar5683
2026-06-19 23:05:28 -05:00
parent 7a3c1ede9a
commit 5d3d5a884b
39 changed files with 31 additions and 45 deletions
+7 -3
View File
@@ -157,7 +157,7 @@ def should_send_adas_status(CP, is_kaofui_car):
return True
if CP.carFingerprint in ASCM_INT:
return CP.carFingerprint == CAR.BUICK_LACROSSE_ASCM
return False
return CP.networkLocation != NetworkLocation.fwdCamera and CP.carFingerprint not in SDGM_CAR
@@ -259,7 +259,11 @@ def should_activate_auto_hold(hold_ready: bool, auto_hold_armed: bool, auto_hold
)
def should_neutralize_volt_long_on_driver_override(CP, gas_pressed: bool, brake_pressed: bool) -> bool:
def should_neutralize_volt_long_on_driver_override(CP, gas_pressed: bool, brake_pressed: bool,
gear_shifter=None) -> bool:
if CP.carFingerprint == CAR.CHEVROLET_VOLT_2019 and gear_shifter not in AUTO_HOLD_DRIVE_GEARS:
return False
return (
CP.carFingerprint in AUTO_HOLD_VOLT_CARS and
not CP.enableGasInterceptorDEPRECATED and
@@ -821,7 +825,7 @@ class CarController(CarControllerBase):
self.apply_gas = self.params.INACTIVE_REGEN
self.apply_brake = max(self.apply_brake, self.volt_one_pedal_brake)
if should_neutralize_volt_long_on_driver_override(self.CP, CS.out.gasPressed, CS.out.brakePressed):
if should_neutralize_volt_long_on_driver_override(self.CP, CS.out.gasPressed, CS.out.brakePressed, CS.out.gearShifter):
self.apply_gas = self.params.MAX_ACC_REGEN
self.apply_brake = 0
-3
View File
@@ -675,9 +675,6 @@ class CarInterface(CarInterfaceBase):
if remote_start_boots_comma:
ret.safetyConfigs[0].safetyParam |= GMSafetyFlags.FLAG_GM_REMOTE_START_BOOTS_COMMA.value
if candidate == CAR.BUICK_LACROSSE_ASCM:
ret.safetyConfigs[0].safetyParam |= GMSafetyFlags.FLAG_GM_LACROSSE_RADAR.value
volt_stock_friction_brake_safety = (
(gm_auto_hold or volt_one_pedal_mode) and
candidate in {
@@ -154,13 +154,13 @@ def test_live_camera_path_does_not_send_pt_keepalive():
assert get_adas_keepalive_step(cp, is_kaofui_car=True) is None
def test_only_lacrosse_ascm_int_sends_radar_status():
def test_ascm_int_cars_do_not_send_radar_status():
common = {
"networkLocation": CarParams.NetworkLocation.fwdCamera,
"radarUnavailable": False,
}
assert should_send_adas_status(SimpleNamespace(carFingerprint=CAR.BUICK_LACROSSE_ASCM, **common), is_kaofui_car=True)
assert not should_send_adas_status(SimpleNamespace(carFingerprint=CAR.BUICK_LACROSSE_ASCM, **common), is_kaofui_car=True)
assert not should_send_adas_status(SimpleNamespace(carFingerprint=CAR.CHEVROLET_VOLT_ASCM, **common), is_kaofui_car=True)
@@ -496,6 +496,16 @@ def test_volt_driver_override_neutralization_applies_on_stock_acc_path():
)
def test_volt_2019_driver_override_neutralization_skips_park_but_keeps_drive():
CP = SimpleNamespace(
carFingerprint=CAR.CHEVROLET_VOLT_2019,
enableGasInterceptorDEPRECATED=False,
)
assert not should_neutralize_volt_long_on_driver_override(CP, False, True, structs.CarState.GearShifter.park)
assert should_neutralize_volt_long_on_driver_override(CP, False, True, structs.CarState.GearShifter.drive)
def test_volt_driver_override_neutralization_skips_pedal_and_non_volt_paths():
assert not should_neutralize_volt_long_on_driver_override(
SimpleNamespace(
@@ -505,6 +515,15 @@ def test_volt_driver_override_neutralization_skips_pedal_and_non_volt_paths():
True,
False,
)
assert should_neutralize_volt_long_on_driver_override(
SimpleNamespace(
carFingerprint=CAR.CHEVROLET_VOLT_ASCM,
enableGasInterceptorDEPRECATED=False,
),
False,
True,
structs.CarState.GearShifter.park,
)
assert not should_neutralize_volt_long_on_driver_override(
SimpleNamespace(
carFingerprint=CAR.CHEVROLET_BOLT_CC_2018_2021,
@@ -139,24 +139,6 @@ class TestGMInterface:
assert list(car_params.longitudinalTuning.kiBP) == pytest.approx([0.0, 5.0, 15.0, 35.0])
assert list(car_params.longitudinalTuning.kiV) == pytest.approx([0.28, 0.26, 0.20, 0.16])
def test_lacrosse_radar_marker_is_not_set_on_volt_ascm(self):
fingerprint = _empty_fingerprint()
fingerprint[0][0x2FF] = 8
LacrosseInterface = interfaces[CAR.BUICK_LACROSSE_ASCM]
lacrosse_params = LacrosseInterface.get_params(
CAR.BUICK_LACROSSE_ASCM, fingerprint, [], alpha_long=True, is_release=False, docs=False,
starpilot_toggles=_test_starpilot_toggles(),
)
VoltInterface = interfaces[CAR.CHEVROLET_VOLT_ASCM]
volt_params = VoltInterface.get_params(
CAR.CHEVROLET_VOLT_ASCM, fingerprint, [], alpha_long=True, is_release=False, docs=False,
starpilot_toggles=_test_starpilot_toggles(),
)
assert lacrosse_params.safetyConfigs[0].safetyParam & GMSafetyFlags.FLAG_GM_LACROSSE_RADAR.value
assert not volt_params.safetyConfigs[0].safetyParam & GMSafetyFlags.FLAG_GM_LACROSSE_RADAR.value
def test_blazer_uses_earlier_stronger_low_speed_stop_tune(self):
CarInterface = interfaces[CAR.CHEVROLET_BLAZER]
fingerprint = _empty_fingerprint()
-2
View File
@@ -174,8 +174,6 @@ class GMSafetyFlags(IntFlag):
FLAG_GM_BOLT_2022_PEDAL = 4096
FLAG_GM_REMOTE_START_BOOTS_COMMA = 8192
FLAG_GM_PANDA_3D1_SCHED = 16384
# Context-specific alias: the 3D1 scheduler remains inactive on this camera-long ACC path.
FLAG_GM_LACROSSE_RADAR = 16384
FLAG_GM_PANDA_PADDLE_SCHED = 32768
-9
View File
@@ -545,7 +545,6 @@ static safety_config gm_init(uint16_t param) {
const uint16_t GM_PARAM_BOLT_2022_PEDAL = 4096;
const uint16_t GM_PARAM_REMOTE_START_BOOTS_COMMA = 8192;
const uint16_t GM_PARAM_PANDA_3D1_SCHED = 16384;
const uint16_t GM_PARAM_LACROSSE_RADAR = 16384;
const uint16_t GM_PARAM_PANDA_PADDLE_SCHED = 32768;
static const LongitudinalLimits GM_ASCM_LONG_LIMITS = {
@@ -582,11 +581,6 @@ static safety_config gm_init(uint16_t param) {
{0x184, 2, 8, .check_relay = true}, // camera bus
{0x200, 0, 6, .check_relay = false}, {0x1E1, 0, 7, .check_relay = false},
{0xBD, 0, 7, .check_relay = false}, {0x1F5, 0, 8, .check_relay = false}}; // pt bus
static const CanMsg GM_CAM_LONG_LACROSSE_RADAR_TX_MSGS[] = {{0x180, 0, 4, .check_relay = true}, {0x315, 0, 5, .check_relay = true}, {0x2CB, 0, 8, .check_relay = true}, {0x370, 0, 6, .check_relay = true}, {0x3D1, 0, 8, .check_relay = false}, // pt bus
{0xA1, 1, 7, .check_relay = false}, {0x306, 1, 8, .check_relay = false}, {0x308, 1, 7, .check_relay = false}, {0x310, 1, 2, .check_relay = false}, // obs bus
{0x184, 2, 8, .check_relay = true}, // camera bus
{0x200, 0, 6, .check_relay = false}, {0x1E1, 0, 7, .check_relay = false},
{0xBD, 0, 7, .check_relay = false}, {0x1F5, 0, 8, .check_relay = false}}; // pt bus
static const CanMsg GM_CAM_LONG_NO_CAMERA_TX_MSGS[] = {{0x180, 0, 4, .check_relay = false}, {0x315, 0, 5, .check_relay = false}, {0x2CB, 0, 8, .check_relay = false}, {0x370, 0, 6, .check_relay = false}, {0x3D1, 0, 8, .check_relay = false}, // pt bus
{0x409, 0, 7, .check_relay = false}, {0x40A, 0, 7, .check_relay = false},
@@ -733,7 +727,6 @@ static safety_config gm_init(uint16_t param) {
gm_zero_u8(gm_prndl2_state.spoof_data, 8U);
gm_cam_long = GET_FLAG(param, GM_PARAM_HW_CAM_LONG) && !gm_cc_long;
const bool gm_lacrosse_radar = GET_FLAG(param, GM_PARAM_LACROSSE_RADAR) && gm_ascm_int && gm_cam_long;
gm_pcm_cruise = (gm_hw == GM_CAM || gm_sdgm) && !gm_cam_long && !gm_force_ascm && !gm_pedal_long;
const bool gm_ascm_int_stock_cam = gm_ascm_int && (gm_hw == GM_CAM) && gm_pcm_cruise && !gm_cam_long && !gm_pedal_long && !gm_cc_long;
const bool gm_ascm_int_no_accel_pos = gm_ascm_int && (gm_hw == GM_CAM) && gm_force_brake_c9;
@@ -767,8 +760,6 @@ static safety_config gm_init(uint16_t param) {
} else if (gm_cam_long) {
if (gm_no_camera) {
ret = BUILD_SAFETY_CFG(gm_rx_checks, GM_CAM_LONG_NO_CAMERA_TX_MSGS);
} else if (gm_lacrosse_radar) {
ret = BUILD_SAFETY_CFG(gm_rx_checks, GM_CAM_LONG_LACROSSE_RADAR_TX_MSGS);
} else {
ret = BUILD_SAFETY_CFG(gm_rx_checks, GM_CAM_LONG_TX_MSGS);
}
+1 -6
View File
@@ -307,7 +307,7 @@ def test_gm_ascm_int_long_no_accel_pos_uses_stock_cam_rx_checks():
assert safety.safety_config_valid()
def test_lacrosse_radar_status_tx_requires_dedicated_camera_long_marker():
def test_ascm_int_camera_long_blocks_radar_status_tx():
safety = libsafety_py.libsafety
radar_status_msgs = (
(0xA1, 7),
@@ -322,11 +322,6 @@ def test_lacrosse_radar_status_tx_requires_dedicated_camera_long_marker():
for addr, length in radar_status_msgs:
assert not safety.safety_tx_hook(common.make_msg(1, addr, length))
safety.set_safety_hooks(CarParams.SafetyModel.gm, ascm_int_long | GMSafetyFlags.FLAG_GM_LACROSSE_RADAR)
safety.init_tests()
for addr, length in radar_status_msgs:
assert safety.safety_tx_hook(common.make_msg(1, addr, length))
volt_sdgm_long = GMSafetyFlags.HW_CAM | GMSafetyFlags.HW_CAM_LONG | GMSafetyFlags.HW_SDGM
safety.set_safety_hooks(CarParams.SafetyModel.gm, volt_sdgm_long)
safety.init_tests()
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+1 -1
View File
@@ -1,2 +1,2 @@
extern const uint8_t gitversion[19];
const uint8_t gitversion[19] = "DEV-05c2a90e-DEBUG";
const uint8_t gitversion[19] = "DEV-7a3c1ede-DEBUG";
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+1 -1
View File
@@ -1 +1 @@
DEV-05c2a90e-DEBUG
DEV-7a3c1ede-DEBUG