Skip to content

Commit 58c2a80

Browse files
committed
Set index to ind
1 parent 54c872a commit 58c2a80

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

PathTracking/pure_pursuit/pure_pursuit.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,10 @@ def calc_target_index(state, cx, cy):
9393
old_nearest_point_index = ind
9494
else:
9595
ind = old_nearest_point_index
96-
distance_this_index = calc_distance(state, cx[index], cy[index])
96+
distance_this_index = calc_distance(state, cx[ind], cy[ind])
9797
while True:
98-
index = index + 1 if (index + 1) < len(cx) else index
99-
distance_next_index = calc_distance(state, cx[index], cy[index])
98+
ind = ind + 1 if (ind + 1) < len(cx) else ind
99+
distance_next_index = calc_distance(state, cx[ind], cy[ind])
100100
if distance_this_index < distance_next_index:
101101
break
102102
distance_this_index = distance_next_index

0 commit comments

Comments
 (0)