clean up
pull/24875/head
Shane Smiskol 3 years ago
parent c45bc8c77b
commit a437afec01
  1. 2
      selfdrive/car/gm/carcontroller.py
  2. 12
      selfdrive/car/gm/interface.py
  3. 5
      selfdrive/car/gm/values.py

@ -116,7 +116,7 @@ class CarController:
lka_critical = lka_active and abs(actuators.steer) > 0.9
lka_icon_status = (lka_active, lka_critical)
# SW_GMLAN not yet on cam harness
# SW_GMLAN not yet on cam harness, no HUD alerts
if self.CP.networkLocation != NetworkLocation.fwdCamera and (self.frame % self.params.CAMERA_KEEPALIVE_STEP == 0 or lka_icon_status != self.lka_icon_status_last):
steer_alert = hud_alert in (VisualAlert.steerRequired, VisualAlert.ldw)
can_sends.append(gmcan.create_lka_icon_command(CanBus.SW_GMLAN, lka_active, lka_critical, steer_alert))

@ -55,16 +55,16 @@ class CarInterface(CarInterfaceBase):
else:
ret.transmissionType = TransmissionType.automatic
if candidate in CAMERA_ACC_CAR: # non-ASCM, camera integration
ret.openpilotLongitudinalControl = False # stock ACC
if candidate in CAMERA_ACC_CAR:
ret.openpilotLongitudinalControl = False
ret.networkLocation = NetworkLocation.fwdCamera
ret.radarOffCan = True # no radar
ret.pcmCruise = True
else: # ASCM, OBD-II harness
ret.openpilotLongitudinalControl = True
ret.networkLocation = NetworkLocation.gateway
ret.radarOffCan = False
ret.openpilotLongitudinalControl = True
ret.pcmCruise = False # For ASCM, stock non-adaptive cruise control is kept off
ret.pcmCruise = False # stock non-adaptive cruise control is kept off
# These cars have been put into dashcam only due to both a lack of users and test coverage.
# These cars likely still work fine. Once a user confirms each car works and a test route is
@ -89,8 +89,6 @@ class CarInterface(CarInterfaceBase):
# supports stop and go, but initial engage must (conservatively) be above 18mph
ret.minEnableSpeed = 18 * CV.MPH_TO_MS
# TODO: Should this be changed to -1?
# Newer cars (that are still ASCM-based) use -1 for minEnableSpeed with the comment "engage speed is decided by pcm"
if candidate == CAR.VOLT:
ret.mass = 1607. + STD_CARGO_KG
@ -163,9 +161,7 @@ class CarInterface(CarInterfaceBase):
tire_stiffness_factor = 1.0
ret.steerActuatorDelay = 0.2
# Set Panda to camera forwarding mode
if ret.networkLocation == NetworkLocation.fwdCamera:
# TODO: Depends on Panda PR #962 (Cam Harness forwarding, stock ACC)
ret.safetyConfigs[0].safetyParam |= Panda.FLAG_GM_HW_CAM
# TODO: get actual value, for now starting with reasonable value for

@ -10,11 +10,6 @@ Ecu = car.CarParams.Ecu
class CarControllerParams:
# TODO: Different cars have different min steer speed, usually around 3-5 mph
# TODO: Delta up and down limits may require adjustment based on excessive rate limiting
# TODO: Min steer speed seems to be about 3 MPH; may differ per car
# TODO: Unsure of driver values
# TODO: MAX_GAS, ZERO_GAS and MAX_BRAKE, MAX_ACC_REGEN are based on a specific volt year...
STEER_MAX = 300 # GM limit is 3Nm. Used by carcontroller to generate LKA output
STEER_STEP = 2 # Control frames per command (50hz)
STEER_DELTA_UP = 7 # Delta rates require review due to observed EPS weakness

Loading…
Cancel
Save