Skip to content

Commit f81140e

Browse files
committed
📝 Renamed method name __call__ with search_target_index in Trajectory class
Thanks to @AtsushiSakai remarks AtsushiSakai#269 (comment)
1 parent 811bdc1 commit f81140e

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
@@ -75,7 +75,7 @@ def __init__(self, cx, cy):
7575
self.cy = cy
7676
self.old_nearest_point_index = None
7777

78-
def __call__(self, state):
78+
def search_target_index(self, state):
7979
if self.old_nearest_point_index is None:
8080
# search nearest point index
8181
dx = [state.rear_x - icx for icx in self.cx]
@@ -110,7 +110,7 @@ def __call__(self, state):
110110

111111
def pure_pursuit_control(state, trajectory, pind):
112112

113-
ind = trajectory(state)
113+
ind = trajectory.search_target_index(state)
114114

115115
if pind >= ind:
116116
ind = pind
@@ -163,7 +163,7 @@ def main():
163163
states = States()
164164
states.append(time, state)
165165
trajectory = Trajectory(cx, cy)
166-
target_ind = trajectory(state)
166+
target_ind = trajectory.search_target_index(state)
167167

168168
while T >= time and lastIndex > target_ind:
169169
ai = PIDControl(target_speed, state.v)

0 commit comments

Comments
 (0)