Skip to content

Commit 9f74154

Browse files
committed
2 parents 40e5c2c + 7927c86 commit 9f74154

File tree

3 files changed

+39
-5
lines changed

3 files changed

+39
-5
lines changed

.github/FUNDING.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# These are supported funding model platforms
2+
patreon: myenigma
3+
custom: https://www.paypal.me/myenigmapay/

PathPlanning/ProbabilisticRoadMap/probabilistic_road_map.py

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -161,12 +161,18 @@ def generate_roadmap(sample_x, sample_y, rr, obkdtree):
161161

162162
def dijkstra_planning(sx, sy, gx, gy, ox, oy, rr, road_map, sample_x, sample_y):
163163
"""
164+
sx: start x position [m]
165+
sy: start y position [m]
164166
gx: goal x position [m]
165-
gx: goal x position [m]
167+
gy: goal y position [m]
166168
ox: x position list of Obstacles [m]
167169
oy: y position list of Obstacles [m]
168-
reso: grid resolution [m]
169-
rr: robot radius[m]
170+
rr: robot radius [m]
171+
road_map: ??? [m]
172+
sample_x: ??? [m]
173+
sample_y: ??? [m]
174+
175+
@return: Two lists of path coordinates ([x1, x2, ...], [y1, y2, ...]), empty list when no path was found
170176
"""
171177

172178
nstart = Node(sx, sy, 0.0, -1)
@@ -175,9 +181,12 @@ def dijkstra_planning(sx, sy, gx, gy, ox, oy, rr, road_map, sample_x, sample_y):
175181
openset, closedset = dict(), dict()
176182
openset[len(road_map) - 2] = nstart
177183

184+
path_found = True
185+
178186
while True:
179187
if not openset:
180188
print("Cannot find path")
189+
path_found = False
181190
break
182191

183192
c_id = min(openset, key=lambda o: openset[o].cost)
@@ -217,6 +226,9 @@ def dijkstra_planning(sx, sy, gx, gy, ox, oy, rr, road_map, sample_x, sample_y):
217226
openset[n_id].pind = c_id
218227
else:
219228
openset[n_id] = node
229+
230+
if path_found is False:
231+
return [], []
220232

221233
# generate final course
222234
rx, ry = [ngoal.x], [ngoal.y]
@@ -249,8 +261,8 @@ def sample_points(sx, sy, gx, gy, rr, ox, oy, obkdtree):
249261
sample_x, sample_y = [], []
250262

251263
while len(sample_x) <= N_SAMPLE:
252-
tx = (random.random() - minx) * (maxx - minx)
253-
ty = (random.random() - miny) * (maxy - miny)
264+
tx = (random.random() * (maxx - minx)) + minx
265+
ty = (random.random() * (maxy - miny)) + miny
254266

255267
index, dist = obkdtree.search(np.array([tx, ty]).reshape(2, 1))
256268

users_comments.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,25 @@ Mr AtsushiSakai .. <br>Your work and teaching is light for me <br>thank you very
208208

209209
--Karim Anass
210210

211+
---
212+
213+
Thank You
214+
215+
--Anonymous
216+
217+
---
218+
219+
I've learned the robotics from the traditional way of solving problem through finding packages and reading papers. This amazing project is unbelievably helpful for new-comers to learn and get familiar with the algorithms. Gods know how many hours you've taken to sort all the materials and written everything into one single coherent project. I'm truly amazed and deepest appreciation.
220+
221+
--Ewing Kang
222+
223+
---
224+
225+
Hey, I'm a student and I just recently got into robotics, and visited your repository multiple times. Today I was super happy to find the link to Patreon! I am impressed by didactic quality of the repo, keep up the good work!
226+
227+
--Carolina Bianchi
228+
229+
211230
=========
212231

213232
# Citations

0 commit comments

Comments
 (0)