Skip to content

Commit d5d026d

Browse files
committed
Set old index
1 parent 4706e4b commit d5d026d

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

PathTracking/pure_pursuit/pure_pursuit.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ def calc_target_index(state, cx, cy):
8787
dy = [state.rear_y - icy for icy in cy]
8888
d = [abs(math.sqrt(idx ** 2 + idy ** 2)) for (idx, idy) in zip(dx, dy)]
8989
ind = d.index(min(d))
90+
old_nearest_point_index = ind
9091
else:
9192
index = old_nearest_point_index
9293
distance_this_index = calc_distance(state, cx[index], cy[index])

0 commit comments

Comments
 (0)