pedal: only send command while actuators active (#22942)

old-commit-hash: 70c1f19304
commatwo_master
Adeeb Shihadeh 3 years ago committed by GitHub
parent e8717f23de
commit e08be1e178
  1. 2
      selfdrive/car/honda/carcontroller.py
  2. 4
      selfdrive/car/toyota/carcontroller.py
  3. 2
      selfdrive/car/toyota/interface.py

@ -232,7 +232,7 @@ class CarController():
# This prevents unexpected pedal range rescaling
# Sending non-zero gas when OP is not enabled will cause the PCM not to respond to throttle as expected
# when you do enable.
if enabled:
if active:
apply_gas = clip(gas_mult * (gas - brake + wind_brake*3/4), 0., 1.)
else:
apply_gas = 0.0

@ -37,7 +37,7 @@ class CarController():
self.packer = CANPacker(dbc_name)
def update(self, enabled, CS, frame, actuators, pcm_cancel_cmd, hud_alert,
def update(self, enabled, active, CS, frame, actuators, pcm_cancel_cmd, hud_alert,
left_line, right_line, lead, left_lane_depart, right_lane_depart):
# *** compute control surfaces ***
@ -53,7 +53,7 @@ class CarController():
elif CS.out.vEgo > MIN_ACC_SPEED + PEDAL_HYST_GAP:
self.use_interceptor = False
if self.use_interceptor and enabled:
if self.use_interceptor and active:
# only send negative accel when using interceptor. gas handles acceleration
# +0.18 m/s^2 offset to reduce ABS pump usage when OP is engaged
MAX_INTERCEPTOR_GAS = interp(CS.out.vEgo, [0.0, MIN_ACC_SPEED], [0.2, 0.5])

@ -375,7 +375,7 @@ class CarInterface(CarInterfaceBase):
# to be called @ 100hz
def apply(self, c):
can_sends = self.CC.update(c.enabled, self.CS, self.frame,
can_sends = self.CC.update(c.enabled, c.active, self.CS, self.frame,
c.actuators, c.cruiseControl.cancel,
c.hudControl.visualAlert, c.hudControl.leftLaneVisible,
c.hudControl.rightLaneVisible, c.hudControl.leadVisible,

Loading…
Cancel
Save