Skip to content

Commit 629399a

Browse files
carControl: add long and lat active fields (#23859)
* proof of concept * actuators packet describes which actuators are active * bump cereal * fixes * not needed for this PR * Do Toyota * add back controlsState.active * bump cereal * rest of cars * in actuators * add active back * which * use controlsState.active for now * will make an issue * Update selfdrive/controls/controlsd.py Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com> * move local lat_active checks into CC.latActive * remove redundant checks * move comment move comment * fix joystick mode * get enabled from carcontrol * do standstill check in controlsd * make sure we consider the gas press case for GM * use CC.actuators * fix * capitalization * Bump cereal Bump cereal * make intermediate actuators * similar convention to before * clean that up * update refs Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
1 parent b9484a6 commit 629399a

21 files changed

+86
-94
lines changed

cereal

selfdrive/car/ford/interface.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def update(self, c, can_strings):
6666
def apply(self, c):
6767

6868
ret = self.CC.update(c.enabled, self.CS, self.frame, c.actuators,
69-
c.hudControl.visualAlert, c.cruiseControl.cancel)
69+
c.hudControl.visualAlert, c.cruiseControl.cancel)
7070

7171
self.frame += 1
7272
return ret

selfdrive/car/gm/carcontroller.py

+7-8
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ def __init__(self, dbc_name, CP, VM):
2727
self.packer_obj = CANPacker(DBC[CP.carFingerprint]['radar'])
2828
self.packer_ch = CANPacker(DBC[CP.carFingerprint]['chassis'])
2929

30-
def update(self, c, enabled, CS, frame, actuators,
31-
hud_v_cruise, hud_show_lanes, hud_show_car, hud_alert):
30+
def update(self, c, CS, frame, actuators, hud_v_cruise, hud_show_lanes, hud_show_car, hud_alert):
3231

3332
P = self.params
3433

@@ -41,7 +40,7 @@ def update(self, c, enabled, CS, frame, actuators,
4140
if CS.lka_steering_cmd_counter != self.lka_steering_cmd_counter_last:
4241
self.lka_steering_cmd_counter_last = CS.lka_steering_cmd_counter
4342
elif (frame % P.STEER_STEP) == 0:
44-
lkas_enabled = c.active and not (CS.out.steerFaultTemporary or CS.out.steerFaultPermanent) and CS.out.vEgo > P.MIN_STEER_SPEED
43+
lkas_enabled = c.latActive and CS.out.vEgo > P.MIN_STEER_SPEED
4544
if lkas_enabled:
4645
new_steer = int(round(actuators.steer * P.STEER_MAX))
4746
apply_steer = apply_std_steer_torque_limits(new_steer, self.apply_steer_last, CS.out.steeringTorque, P)
@@ -58,7 +57,7 @@ def update(self, c, enabled, CS, frame, actuators,
5857

5958
# Gas/regen and brakes - all at 25Hz
6059
if (frame % 4) == 0:
61-
if not c.active:
60+
if not c.longActive:
6261
# Stock ECU sends max regen when not enabled.
6362
self.apply_gas = P.MAX_ACC_REGEN
6463
self.apply_brake = 0
@@ -68,15 +67,15 @@ def update(self, c, enabled, CS, frame, actuators,
6867

6968
idx = (frame // 4) % 4
7069

71-
at_full_stop = enabled and CS.out.standstill
72-
near_stop = enabled and (CS.out.vEgo < P.NEAR_STOP_BRAKE_PHASE)
70+
at_full_stop = c.longActive and CS.out.standstill
71+
near_stop = c.longActive and (CS.out.vEgo < P.NEAR_STOP_BRAKE_PHASE)
7372
can_sends.append(gmcan.create_friction_brake_command(self.packer_ch, CanBus.CHASSIS, self.apply_brake, idx, near_stop, at_full_stop))
74-
can_sends.append(gmcan.create_gas_regen_command(self.packer_pt, CanBus.POWERTRAIN, self.apply_gas, idx, enabled, at_full_stop))
73+
can_sends.append(gmcan.create_gas_regen_command(self.packer_pt, CanBus.POWERTRAIN, self.apply_gas, idx, c.longActive, at_full_stop))
7574

7675
# Send dashboard UI commands (ACC status), 25hz
7776
if (frame % 4) == 0:
7877
send_fcw = hud_alert == VisualAlert.fcw
79-
can_sends.append(gmcan.create_acc_dashboard_command(self.packer_pt, CanBus.POWERTRAIN, enabled, hud_v_cruise * CV.MS_TO_KPH, hud_show_car, send_fcw))
78+
can_sends.append(gmcan.create_acc_dashboard_command(self.packer_pt, CanBus.POWERTRAIN, c.longActive, hud_v_cruise * CV.MS_TO_KPH, hud_show_car, send_fcw))
8079

8180
# Radar needs to know current speed and yaw rate (50hz),
8281
# and that ADAS is alive (10hz)

selfdrive/car/gm/interface.py

+1-6
Original file line numberDiff line numberDiff line change
@@ -222,12 +222,7 @@ def apply(self, c):
222222
if hud_v_cruise > 70:
223223
hud_v_cruise = 0
224224

225-
# For Openpilot, "enabled" includes pre-enable.
226-
# In GM, PCM faults out if ACC command overlaps user gas.
227-
enabled = c.enabled and not self.CS.out.gasPressed
228-
229-
ret = self.CC.update(c, enabled, self.CS, self.frame,
230-
c.actuators,
225+
ret = self.CC.update(c, self.CS, self.frame, c.actuators,
231226
hud_v_cruise, hud_control.lanesVisible,
232227
hud_control.leadVisible, hud_control.visualAlert)
233228

selfdrive/car/honda/carcontroller.py

+6-8
Original file line numberDiff line numberDiff line change
@@ -112,12 +112,12 @@ def __init__(self, dbc_name, CP, VM):
112112

113113
self.params = CarControllerParams(CP)
114114

115-
def update(self, enabled, active, CS, frame, actuators, pcm_cancel_cmd,
115+
def update(self, c, CS, frame, actuators, pcm_cancel_cmd,
116116
hud_v_cruise, hud_show_lanes, hud_show_car, hud_alert):
117117

118118
P = self.params
119119

120-
if active:
120+
if c.longActive:
121121
accel = actuators.accel
122122
gas, brake = compute_gas_brake(actuators.accel, CS.out.vEgo, CS.CP.carFingerprint)
123123
else:
@@ -136,7 +136,7 @@ def update(self, enabled, active, CS, frame, actuators, pcm_cancel_cmd,
136136
else:
137137
hud_lanes = 0
138138

139-
if enabled:
139+
if c.enabled:
140140
if hud_show_car:
141141
hud_car = 2
142142
else:
@@ -152,8 +152,6 @@ def update(self, enabled, active, CS, frame, actuators, pcm_cancel_cmd,
152152
# steer torque is converted back to CAN reference (positive when steering right)
153153
apply_steer = int(interp(-actuators.steer * P.STEER_MAX, P.STEER_LOOKUP_BP, P.STEER_LOOKUP_V))
154154

155-
lkas_active = active
156-
157155
# Send CAN commands.
158156
can_sends = []
159157

@@ -165,7 +163,7 @@ def update(self, enabled, active, CS, frame, actuators, pcm_cancel_cmd,
165163
# Send steering command.
166164
idx = frame % 4
167165
can_sends.append(hondacan.create_steering_control(self.packer, apply_steer,
168-
lkas_active, CS.CP.carFingerprint, idx, CS.CP.openpilotLongitudinalControl))
166+
c.latActive, CS.CP.carFingerprint, idx, CS.CP.openpilotLongitudinalControl))
169167

170168
stopping = actuators.longControlState == LongCtrlState.stopping
171169

@@ -217,7 +215,7 @@ def update(self, enabled, active, CS, frame, actuators, pcm_cancel_cmd,
217215
if CS.CP.carFingerprint in HONDA_BOSCH:
218216
self.accel = clip(accel, P.BOSCH_ACCEL_MIN, P.BOSCH_ACCEL_MAX)
219217
self.gas = interp(accel, P.BOSCH_GAS_LOOKUP_BP, P.BOSCH_GAS_LOOKUP_V)
220-
can_sends.extend(hondacan.create_acc_commands(self.packer, enabled, active, accel, self.gas, idx, stopping, CS.CP.carFingerprint))
218+
can_sends.extend(hondacan.create_acc_commands(self.packer, c.enabled, c.longActive, accel, self.gas, idx, stopping, CS.CP.carFingerprint))
221219
else:
222220
apply_brake = clip(self.brake_last - wind_brake, 0.0, 1.0)
223221
apply_brake = int(clip(apply_brake * P.NIDEC_BRAKE_MAX, 0, P.NIDEC_BRAKE_MAX - 1))
@@ -236,7 +234,7 @@ def update(self, enabled, active, CS, frame, actuators, pcm_cancel_cmd,
236234
# This prevents unexpected pedal range rescaling
237235
# Sending non-zero gas when OP is not enabled will cause the PCM not to respond to throttle as expected
238236
# when you do enable.
239-
if active:
237+
if c.longActive:
240238
self.gas = clip(gas_mult * (gas - brake + wind_brake*3/4), 0., 1.)
241239
else:
242240
self.gas = 0.0

selfdrive/car/honda/interface.py

+3-5
Original file line numberDiff line numberDiff line change
@@ -427,11 +427,9 @@ def apply(self, c):
427427
else:
428428
hud_v_cruise = 255
429429

430-
ret = self.CC.update(c.enabled, c.active, self.CS, self.frame,
431-
c.actuators,
432-
c.cruiseControl.cancel,
433-
hud_v_cruise,
434-
hud_control.lanesVisible,
430+
ret = self.CC.update(c, self.CS, self.frame,
431+
c.actuators, c.cruiseControl.cancel,
432+
hud_v_cruise, hud_control.lanesVisible,
435433
hud_show_car=hud_control.leadVisible,
436434
hud_alert=hud_control.visualAlert)
437435

selfdrive/car/hyundai/carcontroller.py

+8-11
Original file line numberDiff line numberDiff line change
@@ -46,23 +46,20 @@ def __init__(self, dbc_name, CP, VM):
4646
self.last_resume_frame = 0
4747
self.accel = 0
4848

49-
def update(self, c, enabled, CS, frame, actuators, pcm_cancel_cmd, visual_alert, hud_speed,
49+
def update(self, c, CS, frame, actuators, pcm_cancel_cmd, visual_alert, hud_speed,
5050
left_lane, right_lane, left_lane_depart, right_lane_depart):
5151
# Steering Torque
5252
new_steer = int(round(actuators.steer * self.p.STEER_MAX))
5353
apply_steer = apply_std_steer_torque_limits(new_steer, self.apply_steer_last, CS.out.steeringTorque, self.p)
5454
self.steer_rate_limited = new_steer != apply_steer
5555

56-
# disable when temp fault is active, or below LKA minimum speed
57-
lkas_active = c.active and not CS.out.steerFaultTemporary and CS.out.vEgo >= CS.CP.minSteerSpeed
58-
59-
if not lkas_active:
56+
if not c.latActive:
6057
apply_steer = 0
6158

6259
self.apply_steer_last = apply_steer
6360

6461
sys_warning, sys_state, left_lane_warning, right_lane_warning = \
65-
process_hud_alert(enabled, self.car_fingerprint, visual_alert,
62+
process_hud_alert(c.enabled, self.car_fingerprint, visual_alert,
6663
left_lane, right_lane, left_lane_depart, right_lane_depart)
6764

6865
can_sends = []
@@ -72,8 +69,8 @@ def update(self, c, enabled, CS, frame, actuators, pcm_cancel_cmd, visual_alert,
7269
if (frame % 100) == 0:
7370
can_sends.append([0x7D0, 0, b"\x02\x3E\x80\x00\x00\x00\x00\x00", 0])
7471

75-
can_sends.append(create_lkas11(self.packer, frame, self.car_fingerprint, apply_steer, lkas_active,
76-
CS.lkas11, sys_warning, sys_state, enabled,
72+
can_sends.append(create_lkas11(self.packer, frame, self.car_fingerprint, apply_steer, c.latActive,
73+
CS.lkas11, sys_warning, sys_state, c.enabled,
7774
left_lane, right_lane,
7875
left_lane_warning, right_lane_warning))
7976

@@ -89,7 +86,7 @@ def update(self, c, enabled, CS, frame, actuators, pcm_cancel_cmd, visual_alert,
8986

9087
if frame % 2 == 0 and CS.CP.openpilotLongitudinalControl:
9188
lead_visible = False
92-
accel = actuators.accel if c.active else 0
89+
accel = actuators.accel if c.longActive else 0
9390

9491
jerk = clip(2.0 * (accel - CS.out.aEgo), -12.7, 12.7)
9592

@@ -100,15 +97,15 @@ def update(self, c, enabled, CS, frame, actuators, pcm_cancel_cmd, visual_alert,
10097

10198
stopping = (actuators.longControlState == LongCtrlState.stopping)
10299
set_speed_in_units = hud_speed * (CV.MS_TO_MPH if CS.clu11["CF_Clu_SPEED_UNIT"] == 1 else CV.MS_TO_KPH)
103-
can_sends.extend(create_acc_commands(self.packer, enabled, accel, jerk, int(frame / 2), lead_visible, set_speed_in_units, stopping))
100+
can_sends.extend(create_acc_commands(self.packer, c.enabled, accel, jerk, int(frame / 2), lead_visible, set_speed_in_units, stopping))
104101
self.accel = accel
105102

106103
# 20 Hz LFA MFA message
107104
if frame % 5 == 0 and self.car_fingerprint in (CAR.SONATA, CAR.PALISADE, CAR.IONIQ, CAR.KIA_NIRO_EV, CAR.KIA_NIRO_HEV_2021,
108105
CAR.IONIQ_EV_2020, CAR.IONIQ_PHEV, CAR.KIA_CEED, CAR.KIA_SELTOS, CAR.KONA_EV,
109106
CAR.ELANTRA_2021, CAR.ELANTRA_HEV_2021, CAR.SONATA_HYBRID, CAR.KONA_HEV, CAR.SANTA_FE_2022,
110107
CAR.KIA_K5_2021, CAR.IONIQ_HEV_2022, CAR.SANTA_FE_HEV_2022, CAR.GENESIS_G70_2020, CAR.SANTA_FE_PHEV_2022):
111-
can_sends.append(create_lfahda_mfc(self.packer, enabled))
108+
can_sends.append(create_lfahda_mfc(self.packer, c.enabled))
112109

113110
# 5 Hz ACC options
114111
if frame % 20 == 0 and CS.CP.openpilotLongitudinalControl:

selfdrive/car/hyundai/interface.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -352,8 +352,8 @@ def update(self, c, can_strings):
352352

353353
def apply(self, c):
354354
hud_control = c.hudControl
355-
ret = self.CC.update(c, c.enabled, self.CS, self.frame, c.actuators,
356-
c.cruiseControl.cancel, hud_control.visualAlert, hud_control.setSpeed, hud_control.leftLaneVisible,
357-
hud_control.rightLaneVisible, hud_control.leftLaneDepart, hud_control.rightLaneDepart)
355+
ret = self.CC.update(c, self.CS, self.frame, c.actuators, c.cruiseControl.cancel, hud_control.visualAlert,
356+
hud_control.setSpeed, hud_control.leftLaneVisible, hud_control.rightLaneVisible,
357+
hud_control.leftLaneDepart, hud_control.rightLaneDepart)
358358
self.frame += 1
359359
return ret

selfdrive/car/mazda/carcontroller.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def update(self, c, CS, frame):
1919
apply_steer = 0
2020
self.steer_rate_limited = False
2121

22-
if c.active:
22+
if c.latActive:
2323
# calculate steer and also set limits due to driver torque
2424
new_steer = int(round(c.actuators.steer * CarControllerParams.STEER_MAX))
2525
apply_steer = apply_std_steer_torque_limits(new_steer, self.apply_steer_last,

selfdrive/car/nissan/carcontroller.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def __init__(self, dbc_name, CP, VM):
1818

1919
self.packer = CANPacker(dbc_name)
2020

21-
def update(self, c, enabled, CS, frame, actuators, cruise_cancel, hud_alert,
21+
def update(self, c, CS, frame, actuators, cruise_cancel, hud_alert,
2222
left_line, right_line, left_lane_depart, right_lane_depart):
2323

2424
can_sends = []
@@ -30,7 +30,7 @@ def update(self, c, enabled, CS, frame, actuators, cruise_cancel, hud_alert,
3030

3131
steer_hud_alert = 1 if hud_alert in (VisualAlert.steerRequired, VisualAlert.ldw) else 0
3232

33-
if c.active:
33+
if c.latActive:
3434
# # windup slower
3535
if self.last_angle * apply_angle > 0. and abs(apply_angle) > abs(self.last_angle):
3636
angle_rate_lim = interp(CS.out.vEgo, CarControllerParams.ANGLE_DELTA_BP, CarControllerParams.ANGLE_DELTA_V)
@@ -68,12 +68,12 @@ def update(self, c, enabled, CS, frame, actuators, cruise_cancel, hud_alert,
6868
can_sends.append(nissancan.create_cancel_msg(self.packer, CS.cancel_msg, cruise_cancel))
6969

7070
can_sends.append(nissancan.create_steering_control(
71-
self.packer, apply_angle, frame, enabled, self.lkas_max_torque))
71+
self.packer, apply_angle, frame, c.enabled, self.lkas_max_torque))
7272

7373
if lkas_hud_msg and lkas_hud_info_msg:
7474
if frame % 2 == 0:
7575
can_sends.append(nissancan.create_lkas_hud_msg(
76-
self.packer, lkas_hud_msg, enabled, left_line, right_line, left_lane_depart, right_lane_depart))
76+
self.packer, lkas_hud_msg, c.enabled, left_line, right_line, left_lane_depart, right_lane_depart))
7777

7878
if frame % 50 == 0:
7979
can_sends.append(nissancan.create_lkas_hud_info_msg(

selfdrive/car/nissan/interface.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def update(self, c, can_strings):
7979

8080
def apply(self, c):
8181
hud_control = c.hudControl
82-
ret = self.CC.update(c, c.enabled, self.CS, self.frame, c.actuators,
82+
ret = self.CC.update(c, self.CS, self.frame, c.actuators,
8383
c.cruiseControl.cancel, hud_control.visualAlert,
8484
hud_control.leftLaneVisible, hud_control.rightLaneVisible,
8585
hud_control.leftLaneDepart, hud_control.rightLaneDepart)

selfdrive/car/subaru/carcontroller.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def __init__(self, dbc_name, CP, VM):
1515
self.p = CarControllerParams(CP)
1616
self.packer = CANPacker(DBC[CP.carFingerprint]['pt'])
1717

18-
def update(self, c, enabled, CS, frame, actuators, pcm_cancel_cmd, visual_alert, left_line, right_line, left_lane_depart, right_lane_depart):
18+
def update(self, c, CS, frame, actuators, pcm_cancel_cmd, visual_alert, left_line, right_line, left_lane_depart, right_lane_depart):
1919

2020
can_sends = []
2121

@@ -30,7 +30,7 @@ def update(self, c, enabled, CS, frame, actuators, pcm_cancel_cmd, visual_alert,
3030
apply_steer = apply_std_steer_torque_limits(new_steer, self.apply_steer_last, CS.out.steeringTorque, self.p)
3131
self.steer_rate_limited = new_steer != apply_steer
3232

33-
if not c.active:
33+
if not c.latActive:
3434
apply_steer = 0
3535

3636
if CS.CP.carFingerprint in PREGLOBAL_CARS:
@@ -69,7 +69,7 @@ def update(self, c, enabled, CS, frame, actuators, pcm_cancel_cmd, visual_alert,
6969
self.es_distance_cnt = CS.es_distance_msg["Counter"]
7070

7171
if self.es_lkas_cnt != CS.es_lkas_msg["Counter"]:
72-
can_sends.append(subarucan.create_es_lkas(self.packer, CS.es_lkas_msg, enabled, visual_alert, left_line, right_line, left_lane_depart, right_lane_depart))
72+
can_sends.append(subarucan.create_es_lkas(self.packer, CS.es_lkas_msg, c.enabled, visual_alert, left_line, right_line, left_lane_depart, right_lane_depart))
7373
self.es_lkas_cnt = CS.es_lkas_msg["Counter"]
7474

7575
new_actuators = actuators.copy()

selfdrive/car/subaru/interface.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ def update(self, c, can_strings):
123123

124124
def apply(self, c):
125125
hud_control = c.hudControl
126-
ret = self.CC.update(c, c.enabled, self.CS, self.frame, c.actuators,
126+
ret = self.CC.update(c, self.CS, self.frame, c.actuators,
127127
c.cruiseControl.cancel, hud_control.visualAlert,
128128
hud_control.leftLaneVisible, hud_control.rightLaneVisible, hud_control.leftLaneDepart, hud_control.rightLaneDepart)
129129
self.frame += 1

selfdrive/car/tesla/carcontroller.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ def __init__(self, dbc_name, CP, VM):
1212
self.pt_packer = CANPacker(DBC[CP.carFingerprint]['pt'])
1313
self.tesla_can = TeslaCAN(self.packer, self.pt_packer)
1414

15-
def update(self, c, enabled, CS, frame, actuators, cruise_cancel):
15+
def update(self, c, CS, frame, actuators, cruise_cancel):
1616
can_sends = []
1717

1818
# Temp disable steering on a hands_on_fault, and allow for user override
1919
hands_on_fault = (CS.steer_warning == "EAC_ERROR_HANDS_ON" and CS.hands_on_level >= 3)
20-
lkas_enabled = c.active and (not hands_on_fault)
20+
lkas_enabled = c.latActive and (not hands_on_fault)
2121

2222
if lkas_enabled:
2323
apply_angle = actuators.steeringAngleDeg

selfdrive/car/tesla/interface.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,6 @@ def update(self, c, can_strings):
7171
return self.CS.out
7272

7373
def apply(self, c):
74-
ret = self.CC.update(c, c.enabled, self.CS, self.frame, c.actuators, c.cruiseControl.cancel)
74+
ret = self.CC.update(c, self.CS, self.frame, c.actuators, c.cruiseControl.cancel)
7575
self.frame += 1
7676
return ret

selfdrive/car/toyota/carcontroller.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ def __init__(self, dbc_name, CP, VM):
2222
self.gas = 0
2323
self.accel = 0
2424

25-
def update(self, enabled, active, CS, frame, actuators, pcm_cancel_cmd, hud_alert,
25+
def update(self, c, CS, frame, actuators, pcm_cancel_cmd, hud_alert,
2626
left_line, right_line, lead, left_lane_depart, right_lane_depart):
2727

2828
# gas and brake
29-
if CS.CP.enableGasInterceptor and active:
29+
if CS.CP.enableGasInterceptor and c.longActive:
3030
MAX_INTERCEPTOR_GAS = 0.5
3131
# RAV4 has very sensitive gas pedal
3232
if CS.CP.carFingerprint in (CAR.RAV4, CAR.RAV4H, CAR.HIGHLANDER, CAR.HIGHLANDERH):
@@ -49,15 +49,15 @@ def update(self, enabled, active, CS, frame, actuators, pcm_cancel_cmd, hud_aler
4949
self.steer_rate_limited = new_steer != apply_steer
5050

5151
# Cut steering while we're in a known fault state (2s)
52-
if not active or CS.steer_state in (9, 25):
52+
if not c.latActive or CS.steer_state in (9, 25):
5353
apply_steer = 0
5454
apply_steer_req = 0
5555
else:
5656
apply_steer_req = 1
5757

5858
# TODO: probably can delete this. CS.pcm_acc_status uses a different signal
5959
# than CS.cruiseState.enabled. confirm they're not meaningfully different
60-
if not enabled and CS.pcm_acc_status:
60+
if not c.enabled and CS.pcm_acc_status:
6161
pcm_cancel_cmd = 1
6262

6363
# on entering standstill, send standstill request
@@ -122,7 +122,7 @@ def update(self, enabled, active, CS, frame, actuators, pcm_cancel_cmd, hud_aler
122122
send_ui = True
123123

124124
if (frame % 100 == 0 or send_ui):
125-
can_sends.append(create_ui_command(self.packer, steer_alert, pcm_cancel_cmd, left_line, right_line, left_lane_depart, right_lane_depart, enabled))
125+
can_sends.append(create_ui_command(self.packer, steer_alert, pcm_cancel_cmd, left_line, right_line, left_lane_depart, right_lane_depart, c.enabled))
126126

127127
if frame % 100 == 0 and CS.CP.enableDsu:
128128
can_sends.append(create_fcw_command(self.packer, fcw_alert))

selfdrive/car/toyota/interface.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ def update(self, c, can_strings):
273273
# to be called @ 100hz
274274
def apply(self, c):
275275
hud_control = c.hudControl
276-
ret = self.CC.update(c.enabled, c.active, self.CS, self.frame,
276+
ret = self.CC.update(c, self.CS, self.frame,
277277
c.actuators, c.cruiseControl.cancel,
278278
hud_control.visualAlert, hud_control.leftLaneVisible,
279279
hud_control.rightLaneVisible, hud_control.leadVisible,

0 commit comments

Comments
 (0)