Skip to content

Commit

Permalink
Update long_mpc.py
Browse files Browse the repository at this point in the history
  • Loading branch information
CT921 committed Aug 7, 2023
1 parent 7d13198 commit a845ec7
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions selfdrive/controls/lib/longitudinal_mpc_lib/long_mpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,26 +358,26 @@ def update_TF(self, carstate, personality=log.LongitudinalPersonality.standard):
else:
raise NotImplementedError("Longitudinal personality not supported")

self.adjustable_follow_car = True if (self.CP.carFingerprint in (TSS2_CAR - RADAR_ACC_CAR) or (self.CP.flags & ToyotaFlags.SMART_DSU)) else False
if self.adjustable_follow_car or personality is not None:
if self.adjustable_follow_car:
profile_key = carstate.distanceLines
else:
profile_key = op_profile_key

if profile_key == 1: # No Cut In
self.t_follow = 0.85
self.stop_distance = 3.5

elif profile_key == 2: # Relaxed
self.t_follow = T_FOLLOW
self.stop_distance = STOP_DISTANCE
# self.adjustable_follow_car = True if (self.CP.carFingerprint in (TSS2_CAR - RADAR_ACC_CAR) or (self.CP.flags & ToyotaFlags.SMART_DSU)) else False
# if self.adjustable_follow_car or personality is not None:
# if self.adjustable_follow_car:
# profile_key = carstate.distanceLines
# else:
# profile_key = op_profile_key

if op_profile_key == 1: # No Cut In
self.t_follow = 0.85
self.stop_distance = 3.5

elif op_profile_key == 2: # Relaxed
self.t_follow = T_FOLLOW
self.stop_distance = STOP_DISTANCE

elif profile_key == 3: # Let You Cut In
self.t_follow = 1.8
self.stop_distance = 5.5
elif op_profile_key == 3: # Let You Cut In
self.t_follow = 1.8
self.stop_distance = 5.5

else:
else:
self.t_follow = T_FOLLOW
self.stop_distance = STOP_DISTANCE

Expand Down

0 comments on commit a845ec7

Please sign in to comment.