Skip to content

Commit dd4dc69

Browse files
committed
Locate the bug
1 parent 060f21d commit dd4dc69

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

GEMstack/onboard/planning/longitudinal_planning.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,10 +164,14 @@ def longitudinal_plan(path : Path, acceleration : float, deceleration : float, m
164164
# if the initial speed is greater than the max speed
165165
elif current_speed > max_speed:
166166
# We need to hit the breaks
167-
168-
next_point = points[cur_index+1]
169-
acc = acceleration
167+
acc = deceleration
170168
flag = 1
169+
# next point
170+
next_point = points[cur_index+1]
171+
if next_point[0] - cur_point[0] > rq * acc:
172+
tmp = cur_point[0] + (next_point[0] - cur_point[0]) / (acc * multi)
173+
flag = 0
174+
next_point = [tmp, next_point[1]]
171175
print("In case four")
172176
# slow down to max speed
173177
delta_t_to_max_speed = (current_speed - max_speed)/deceleration

0 commit comments

Comments
 (0)