MCPcopy
hub / github.com/AtsushiSakai/PythonRobotics / main

Function main

PathPlanning/HybridAStar/a_star.py:183–226  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

181
182
183def main():
184 print(__file__ + " start!!")
185
186 # start and goal position
187 sx = 10.0 # [m]
188 sy = 10.0 # [m]
189 gx = 50.0 # [m]
190 gy = 50.0 # [m]
191 grid_size = 2.0 # [m]
192 robot_size = 1.0 # [m]
193
194 ox, oy = [], []
195
196 for i in range(60):
197 ox.append(i)
198 oy.append(0.0)
199 for i in range(60):
200 ox.append(60.0)
201 oy.append(i)
202 for i in range(61):
203 ox.append(i)
204 oy.append(60.0)
205 for i in range(61):
206 ox.append(0.0)
207 oy.append(i)
208 for i in range(40):
209 ox.append(20.0)
210 oy.append(i)
211 for i in range(40):
212 ox.append(40.0)
213 oy.append(60.0 - i)
214
215 if show_animation: # pragma: no cover
216 plt.plot(ox, oy, ".k")
217 plt.plot(sx, sy, "xr")
218 plt.plot(gx, gy, "xb")
219 plt.grid(True)
220 plt.axis("equal")
221
222 rx, ry, _ = dp_planning(sx, sy, gx, gy, ox, oy, grid_size, robot_size)
223
224 if show_animation: # pragma: no cover
225 plt.plot(rx, ry, "-r")
226 plt.show()
227
228
229if __name__ == '__main__':

Callers 1

a_star.pyFile · 0.70

Calls 2

dp_planningFunction · 0.85
plotMethod · 0.45

Tested by

no test coverage detected