Hyundai longitudinal: display lead on HUD (#24667)

* use leadVisible

* add comment
old-commit-hash: 5c5bb0be11
taco
Shane Smiskol 3 years ago committed by GitHub
parent a11084a6c6
commit b2196a160f
  1. 5
      selfdrive/car/hyundai/carcontroller.py
  2. 4
      selfdrive/car/hyundai/hyundaican.py

@ -114,11 +114,10 @@ class CarController:
accel = clip(accel, CarControllerParams.ACCEL_MIN, CarControllerParams.ACCEL_MAX)
lead_visible = False
stopping = actuators.longControlState == LongCtrlState.stopping
set_speed_in_units = hud_control.setSpeed * (CV.MS_TO_MPH if CS.clu11["CF_Clu_SPEED_UNIT"] == 1 else CV.MS_TO_KPH)
can_sends.extend(hyundaican.create_acc_commands(self.packer, CC.enabled, accel, jerk, int(self.frame / 2), lead_visible,
set_speed_in_units, stopping, CS.out.gasPressed))
can_sends.extend(hyundaican.create_acc_commands(self.packer, CC.enabled, accel, jerk, int(self.frame / 2),
hud_control.leadVisible, set_speed_in_units, stopping, CS.out.gasPressed))
self.accel = accel
# 20 Hz LFA MFA message

@ -86,8 +86,8 @@ def create_acc_commands(packer, enabled, accel, jerk, idx, lead_visible, set_spe
"TauGapSet": 4,
"VSetDis": set_speed if enabled else 0,
"AliveCounterACC": idx % 0x10,
"ObjValid": 1 if lead_visible else 0,
"ACC_ObjStatus": 1 if lead_visible else 0,
"ObjValid": 0, # TODO: these two bits may allow for better longitudinal control
"ACC_ObjStatus": 0,
"ACC_ObjLatPos": 0,
"ACC_ObjRelSpd": 0,
"ACC_ObjDist": 0,

Loading…
Cancel
Save