mirror of
https://github.com/AtsushiSakai/PythonRobotics.git
synced 2026-01-13 20:28:07 -05:00
Merge pull request #190 from AfroDisco/patch-1
Fixed the sampling function from PRM
This commit is contained in:
@@ -249,8 +249,8 @@ def sample_points(sx, sy, gx, gy, rr, ox, oy, obkdtree):
|
||||
sample_x, sample_y = [], []
|
||||
|
||||
while len(sample_x) <= N_SAMPLE:
|
||||
tx = (random.random() - minx) * (maxx - minx)
|
||||
ty = (random.random() - miny) * (maxy - miny)
|
||||
tx = (random.random() * (maxx - minx)) + minx
|
||||
ty = (random.random() * (maxy - miny)) + miny
|
||||
|
||||
index, dist = obkdtree.search(np.array([tx, ty]).reshape(2, 1))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user