mirror of
https://github.com/zhm-real/PathPlanning.git
synced 2026-08-30 00:50:46 +08:00
update
This commit is contained in:
@@ -66,9 +66,9 @@ class rrtstar():
|
||||
Xnear = near(self,xnew)
|
||||
self.V.append(xnew) # add point
|
||||
# visualization(self)
|
||||
# minimal path and minimal cost
|
||||
# minimal path and minimal Cost
|
||||
xmin, cmin = xnearest, cost(self, xnearest) + getDist(xnearest, xnew)
|
||||
# connecting along minimal cost path
|
||||
# connecting along minimal Cost path
|
||||
for xnear in Xnear:
|
||||
xnear = tuple(xnear)
|
||||
c1 = cost(self, xnear) + getDist(xnew, xnear)
|
||||
|
||||
@@ -199,7 +199,7 @@ def steer(initparams, x, y):
|
||||
return xnew
|
||||
|
||||
def cost(initparams, x):
|
||||
'''here use the additive recursive cost function'''
|
||||
'''here use the additive recursive Cost function'''
|
||||
if x == initparams.x0:
|
||||
return 0
|
||||
return cost(initparams, initparams.Parent[x]) + getDist(x, initparams.Parent[x])
|
||||
|
||||
Reference in New Issue
Block a user