mirror of
https://github.com/AtsushiSakai/PythonRobotics.git
synced 2026-04-22 03:00:22 -04:00
fix bug
This commit is contained in:
@@ -50,7 +50,7 @@ def dijkstra_planning(sx, sy, gx, gy, ox, oy, reso, rr):
|
||||
# print("current", current)
|
||||
|
||||
# show graph
|
||||
plt.plot(current.x, current.y, "xc")
|
||||
plt.plot(current.x * reso, current.y * reso, "xc")
|
||||
if len(closedset.keys()) % 10 == 0:
|
||||
plt.pause(0.001)
|
||||
matplotrecorder.save_frame()
|
||||
@@ -86,12 +86,12 @@ def dijkstra_planning(sx, sy, gx, gy, ox, oy, reso, rr):
|
||||
openset[n_id] = node
|
||||
|
||||
# generate final course
|
||||
rx, ry = [ngoal.x], [ngoal.y]
|
||||
rx, ry = [ngoal.x * reso], [ngoal.y * reso]
|
||||
pind = ngoal.pind
|
||||
while pind != -1:
|
||||
n = closedset[pind]
|
||||
rx.append(n.x)
|
||||
ry.append(n.y)
|
||||
rx.append(n.x * reso)
|
||||
ry.append(n.y * reso)
|
||||
pind = n.pind
|
||||
|
||||
return rx, ry
|
||||
|
||||
Reference in New Issue
Block a user