Skip to content

Commit

Permalink
DLP: don't delay on checking status (commaai#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
sunnyhaibin authored Feb 11, 2023
1 parent 4d65697 commit a42d9e2
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions selfdrive/controls/lib/lateral_planner.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ def __init__(self, CP, use_lanelines=True, wide_camera=False):
self.dynamic_lane_profile = int(self.param_s.get("DynamicLaneProfile", encoding="utf8"))
self.dynamic_lane_profile_status = False
self.dynamic_lane_profile_status_buffer = False
self.second = 0.0

self.standstill_elapsed = 0.0
self.standstill = False
Expand All @@ -59,10 +58,7 @@ def reset_mpc(self, x0=np.zeros(4)):
self.lat_mpc.reset(x0=self.x0)

def update(self, sm):
self.second += DT_MDL
if self.second > 1.0:
self.dynamic_lane_profile = int(self.param_s.get("DynamicLaneProfile", encoding="utf8"))
self.second = 0.0
self.dynamic_lane_profile = int(self.param_s.get("DynamicLaneProfile", encoding='utf8'))
self.standstill = sm['carState'].standstill
# clip speed , lateral planning is not possible at 0 speed
self.v_ego = max(MIN_SPEED, sm['carState'].vEgo)
Expand Down

0 comments on commit a42d9e2

Please sign in to comment.