rename enableCruise -> pcmCruise (#21546)

old-commit-hash: cb7e96f99d
commatwo_master
Adeeb Shihadeh 4 years ago committed by GitHub
parent 1ef1b65ca3
commit b7c1b9a6e8
  1. 2
      cereal
  2. 2
      selfdrive/car/gm/interface.py
  3. 2
      selfdrive/car/honda/carcontroller.py
  4. 12
      selfdrive/car/honda/interface.py
  5. 7
      selfdrive/car/interfaces.py
  6. 8
      selfdrive/controls/controlsd.py

@ -1 +1 @@
Subproject commit b372ab3ae1a3a1097e1de87e3092ca4b05cd0471
Subproject commit 2f64d4902eb033d027c4265db33ac8ec91e1e9eb

@ -20,7 +20,7 @@ class CarInterface(CarInterfaceBase):
ret = CarInterfaceBase.get_std_params(candidate, fingerprint)
ret.carName = "gm"
ret.safetyModel = car.CarParams.SafetyModel.gm
ret.enableCruise = False # stock cruise control is kept off
ret.pcmCruise = False # stock cruise control is kept off
# GM port is a community feature
# TODO: make a port that uses a car harness and it only intercepts the camera

@ -104,7 +104,7 @@ class CarController():
# Never send cancel command if we never enter cruise state (no cruise if pedal)
# Cancel cmd causes brakes to release at a standstill causing grinding
pcm_cancel_cmd = pcm_cancel_cmd and CS.CP.enableCruise
pcm_cancel_cmd = pcm_cancel_cmd and CS.CP.pcmCruise
# *** rate limit after the enable check ***
self.brake_last = rate_limit(brake, self.brake_last, -2., DT_CTRL)

@ -135,14 +135,14 @@ class CarInterface(CarInterfaceBase):
# WARNING: THIS DISABLES AEB!
ret.openpilotLongitudinalControl = Params().get_bool("DisableRadar")
ret.enableCruise = not ret.openpilotLongitudinalControl
ret.pcmCruise = not ret.openpilotLongitudinalControl
ret.communityFeature = ret.openpilotLongitudinalControl
else:
ret.safetyModel = car.CarParams.SafetyModel.hondaNidec
ret.enableGasInterceptor = 0x201 in fingerprint[0]
ret.openpilotLongitudinalControl = True
ret.enableCruise = not ret.enableGasInterceptor
ret.pcmCruise = not ret.enableGasInterceptor
ret.communityFeature = ret.enableGasInterceptor
if candidate == CAR.CRV_5G:
@ -509,7 +509,7 @@ class CarInterface(CarInterfaceBase):
ret.buttonEvents = buttonEvents
# events
events = self.create_common_events(ret, pcm_enable=self.CP.enableCruise)
events = self.create_common_events(ret, pcm_enable=self.CP.pcmCruise)
if self.CS.brake_error:
events.add(EventName.brakeUnavailable)
if self.CS.brake_hold and self.CS.CP.openpilotLongitudinalControl:
@ -517,12 +517,12 @@ class CarInterface(CarInterfaceBase):
if self.CS.park_brake:
events.add(EventName.parkBrake)
if self.CP.enableCruise and ret.vEgo < self.CP.minEnableSpeed:
if self.CP.pcmCruise and ret.vEgo < self.CP.minEnableSpeed:
events.add(EventName.belowEngageSpeed)
# it can happen that car cruise disables while comma system is enabled: need to
# keep braking if needed or if the speed is very low
if self.CP.enableCruise and not ret.cruiseState.enabled \
if self.CP.pcmCruise and not ret.cruiseState.enabled \
and (c.actuators.brake <= 0. or not self.CP.openpilotLongitudinalControl):
# non loud alert if cruise disables below 25mph as expected (+ a little margin)
if ret.vEgo < self.CP.minEnableSpeed + 2.:
@ -537,7 +537,7 @@ class CarInterface(CarInterfaceBase):
# do enable on both accel and decel buttons
if b.type in [ButtonType.accelCruise, ButtonType.decelCruise] and not b.pressed:
if not self.CP.enableCruise:
if not self.CP.pcmCruise:
events.add(EventName.buttonEnable)
# do disable on button down

@ -69,12 +69,11 @@ class CarInterfaceBase():
ret.steerMaxV = [1.]
ret.minSteerSpeed = 0.
# stock ACC by default
ret.enableCruise = True
ret.minEnableSpeed = -1. # enable is done by stock ACC, so ignore this
ret.pcmCruise = True # openpilot's state is tied to the PCM's cruise state on most cars
ret.minEnableSpeed = -1. # enable is done by stock ACC, so ignore this
ret.steerRatioRear = 0. # no rear steering, at least on the listed cars aboveA
ret.gasMaxBP = [0.]
ret.gasMaxV = [.5] # half max brake
ret.gasMaxV = [.5] # half max brake
ret.brakeMaxBP = [0.]
ret.brakeMaxV = [1.]
ret.openpilotLongitudinalControl = False

@ -356,9 +356,9 @@ class Controls:
self.v_cruise_kph_last = self.v_cruise_kph
# if stock cruise is completely disabled, then we can use our own set speed logic
if not self.CP.enableCruise:
if not self.CP.pcmCruise:
self.v_cruise_kph = update_v_cruise(self.v_cruise_kph, CS.buttonEvents, self.enabled)
elif self.CP.enableCruise and CS.cruiseState.enabled:
elif self.CP.pcmCruise and CS.cruiseState.enabled:
self.v_cruise_kph = CS.cruiseState.speed * CV.MS_TO_KPH
# decrease the soft disable timer at every step, as it's reset on
@ -507,7 +507,7 @@ class Controls:
CC.actuators = actuators
CC.cruiseControl.override = True
CC.cruiseControl.cancel = not self.CP.enableCruise or (not self.enabled and CS.cruiseState.enabled)
CC.cruiseControl.cancel = not self.CP.pcmCruise or (not self.enabled and CS.cruiseState.enabled)
if self.joystick_mode and self.sm.rcv_frame['testJoystick'] > 0 and self.sm['testJoystick'].buttons[0]:
CC.cruiseControl.cancel = True
@ -516,7 +516,7 @@ class Controls:
# brake discount removes a sharp nonlinearity
brake_discount = (1.0 - clip(actuators.brake * 3., 0.0, 1.0))
speed_override = max(0.0, (self.LoC.v_pid + CS.cruiseState.speedOffset) * brake_discount)
CC.cruiseControl.speedOverride = float(speed_override if self.CP.enableCruise else 0.0)
CC.cruiseControl.speedOverride = float(speed_override if self.CP.pcmCruise else 0.0)
CC.cruiseControl.accelOverride = float(self.CI.calc_accel_override(CS.aEgo, self.a_target,
CS.vEgo, self.v_target))

Loading…
Cancel
Save