pull/22407/head
Willem Melching 4 years ago
parent 38e4310631
commit 06c451a4ed
  1. 4
      selfdrive/car/honda/carcontroller.py
  2. 12
      selfdrive/car/honda/hondacan.py
  3. 2
      selfdrive/car/honda/interface.py

@ -107,7 +107,7 @@ class CarController():
self.params = CarControllerParams(CP)
def update(self, enabled, CS, frame, actuators, pcm_cancel_cmd,
def update(self, enabled, active, CS, frame, actuators, pcm_cancel_cmd,
hud_v_cruise, hud_show_lanes, hud_show_car, hud_alert):
P = self.params
@ -213,7 +213,7 @@ class CarController():
if CS.CP.carFingerprint in HONDA_BOSCH:
accel = clip(accel, P.BOSCH_ACCEL_MIN, P.BOSCH_ACCEL_MAX)
bosch_gas = interp(accel, P.BOSCH_GAS_LOOKUP_BP, P.BOSCH_GAS_LOOKUP_V)
can_sends.extend(hondacan.create_acc_commands(self.packer, enabled, accel, bosch_gas, idx, stopping, starting, CS.CP.carFingerprint))
can_sends.extend(hondacan.create_acc_commands(self.packer, enabled, active, accel, bosch_gas, idx, stopping, starting, CS.CP.carFingerprint))
else:
apply_brake = clip(self.brake_last - wind_brake, 0.0, 1.0)

@ -43,17 +43,17 @@ def create_brake_command(packer, apply_brake, pump_on, pcm_override, pcm_cancel_
return packer.make_can_msg("BRAKE_COMMAND", bus, values, idx)
def create_acc_commands(packer, enabled, accel, gas, idx, stopping, starting, car_fingerprint):
def create_acc_commands(packer, enabled, active, accel, gas, idx, stopping, starting, car_fingerprint):
commands = []
bus = get_pt_bus(car_fingerprint)
min_gas_accel = CarControllerParams.BOSCH_GAS_LOOKUP_BP[0]
control_on = 5 if enabled else 0
gas_command = gas if enabled and accel > min_gas_accel else -30000
accel_command = accel if enabled else 0
braking = 1 if enabled and accel < min_gas_accel else 0
standstill = 1 if enabled and stopping else 0
standstill_release = 1 if enabled and starting else 0
gas_command = gas if active and accel > min_gas_accel else -30000
accel_command = accel if active else 0
braking = 1 if active and accel < min_gas_accel else 0
standstill = 1 if active and stopping else 0
standstill_release = 1 if active and starting else 0
acc_control_values = {
# setting CONTROL_ON causes car to set POWERTRAIN_DATA->ACC_STATUS = 1

@ -418,7 +418,7 @@ class CarInterface(CarInterfaceBase):
else:
hud_v_cruise = 255
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,
hud_v_cruise,

Loading…
Cancel
Save