Skip to content

Commit

Permalink
Gap Adjust Cruise: Handle distance bar on cluster for Hyundai CAN-FD (c…
Browse files Browse the repository at this point in the history
  • Loading branch information
sunnyhaibin authored Sep 14, 2023
1 parent 1958fa9 commit 0b09c64
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion selfdrive/car/hyundai/carcontroller.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ def update(self, CC, CS, now_nanos):
can_sends.extend(hyundaicanfd.create_adrv_messages(self.packer, self.CAN, self.frame))
if self.frame % 2 == 0:
can_sends.append(hyundaicanfd.create_acc_control(self.packer, self.CAN, CC.enabled and CS.out.cruiseState.enabled, self.accel_last, accel, stopping, CC.cruiseControl.override,
set_speed_in_units))
set_speed_in_units, CS.gac_tr_cluster))
self.accel_last = accel
else:
# button presses
Expand Down
4 changes: 2 additions & 2 deletions selfdrive/car/hyundai/hyundaicanfd.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def create_lfahda_cluster(packer, CAN, enabled, lat_active, lateral_paused, blin
return packer.make_can_msg("LFAHDA_CLUSTER", CAN.ECAN, values)


def create_acc_control(packer, CAN, enabled, accel_last, accel, stopping, gas_override, set_speed):
def create_acc_control(packer, CAN, enabled, accel_last, accel, stopping, gas_override, set_speed, gac_tr_cluster):
jerk = 5
jn = jerk / 50
if not enabled or gas_override:
Expand All @@ -146,7 +146,7 @@ def create_acc_control(packer, CAN, enabled, accel_last, accel, stopping, gas_ov
"SET_ME_2": 0x4,
"SET_ME_3": 0x3,
"SET_ME_TMP_64": 0x64,
"DISTANCE_SETTING": 4,
"DISTANCE_SETTING": gac_tr_cluster,
}

return packer.make_can_msg("SCC_CONTROL", CAN.ECAN, values)
Expand Down

0 comments on commit 0b09c64

Please sign in to comment.