@@ -138,26 +138,6 @@ def search_best_feasible_path(self, path_indexs):
138138
139139 return False , None , None , None , None , None , None , None
140140
141- def calc_tracking_path (self , path ):
142- path = np .array (path [::- 1 ])
143- ds = 0.2
144- for i in range (10 ):
145- lx = path [- 1 , 0 ]
146- ly = path [- 1 , 1 ]
147- lyaw = path [- 1 , 2 ]
148- move_yaw = math .atan2 (path [- 2 , 1 ] - ly , path [- 2 , 0 ] - lx )
149- if abs (lyaw - move_yaw ) >= math .pi / 2.0 :
150- print ("back" )
151- ds *= - 1
152-
153- lstate = np .array (
154- [lx + ds * math .cos (lyaw ), ly + ds * math .sin (lyaw ), lyaw ])
155- # print(lstate)
156-
157- path = np .vstack ((path , lstate ))
158-
159- return path
160-
161141 def check_tracking_path_is_feasible (self , path ):
162142 # print("check_tracking_path_is_feasible")
163143 cx = np .array (path [:, 0 ])
@@ -311,9 +291,9 @@ def find_near_nodes(self, newNode):
311291 nnode = len (self .nodeList )
312292 r = 50.0 * math .sqrt ((math .log (nnode ) / nnode ))
313293 # r = self.expandDis * 5.0
314- dlist = [(node .x - newNode .x ) ** 2 +
315- (node .y - newNode .y ) ** 2 +
316- (node .yaw - newNode .yaw ) ** 2
294+ dlist = [(node .x - newNode .x ) ** 2
295+ + (node .y - newNode .y ) ** 2
296+ + (node .yaw - newNode .yaw ) ** 2
317297 for node in self .nodeList ]
318298 nearinds = [dlist .index (i ) for i in dlist if i <= r ** 2 ]
319299 return nearinds
@@ -336,7 +316,7 @@ def rewire(self, newNode, nearinds):
336316 # print("rewire")
337317 self .nodeList [i ] = tNode
338318
339- def DrawGraph (self , rnd = None ):
319+ def DrawGraph (self , rnd = None ): # pragma: no cover
340320 """
341321 Draw Graph
342322 """
@@ -359,9 +339,9 @@ def DrawGraph(self, rnd=None):
359339 plt .pause (0.01 )
360340
361341 def GetNearestListIndex (self , nodeList , rnd ):
362- dlist = [(node .x - rnd .x ) ** 2 +
363- (node .y - rnd .y ) ** 2 +
364- (node .yaw - rnd .yaw ) ** 2 for node in nodeList ]
342+ dlist = [(node .x - rnd .x ) ** 2
343+ + (node .y - rnd .y ) ** 2
344+ + (node .yaw - rnd .yaw ) ** 2 for node in nodeList ]
365345 minind = dlist .index (min (dlist ))
366346
367347 return minind
0 commit comments