Testing Ground: add Gen1 Bolt lateral tune (slot 2)

This commit is contained in:
firestar5683
2026-03-06 01:21:41 -06:00
parent 97605eb016
commit a43027c1ad
2 changed files with 11 additions and 4 deletions
+5 -4
View File
@@ -40,10 +40,11 @@ TESTING_GROUNDS_SLOT_DEFINITIONS = (
},
{
"id": TESTING_GROUND_2,
"name": "Unused",
"description": "",
"aLabel": "A",
"bLabel": "B",
"name": "Gen1 Bolt Lane Changes",
"description": "Gen1 Bolt right-side sigmoid test for smoother right lane changes.",
"aLabel": "A - Installed tune",
"bLabel": "B - Right sigmoid a -10%",
"cLabel": "C - Right sigmoid a -15%",
},
{
"id": TESTING_GROUND_3,
+6
View File
@@ -10,6 +10,7 @@ from openpilot.selfdrive.car.gm.radar_interface import RADAR_HEADER_MSG
from openpilot.selfdrive.car.gm.values import CAR, CruiseButtons, CarControllerParams, EV_CAR, CAMERA_ACC_CAR, CanBus, GMFlags, CC_ONLY_CAR, SDGM_CAR, ASCM_INT, CC_REGEN_PADDLE_CAR, set_red_panda_canbus
from openpilot.selfdrive.car.interfaces import CarInterfaceBase, TorqueFromLateralAccelCallbackType, FRICTION_THRESHOLD, LateralAccelFromTorqueCallbackType, get_friction_threshold
from openpilot.selfdrive.controls.lib.drive_helpers import get_friction
from openpilot.frogpilot.common.testing_grounds import testing_ground
ButtonType = car.CarState.ButtonEvent.Type
FrogPilotButtonType = custom.FrogPilotCarState.ButtonEvent.Type
@@ -104,6 +105,11 @@ class CarInterface(CarInterfaceBase):
# Left is positive
side_key = "left" if lateral_acceleration >= 0 else "right"
a, b, c, d = non_linear_torque_params[side_key]
if side_key == "right":
if testing_ground.use(2, "B"):
a *= 0.9
elif testing_ground.use(2, "C"):
a *= 0.85
sig_input = a * lateral_acceleration
sig = np.sign(sig_input) * (1 / (1 + exp(-fabs(sig_input))) - 0.5)
steer_torque = (sig * b) + (lateral_acceleration * c) + d