motion-planning / rrt-algorithms

n-dimensional RRT, RRT* (RRT-Star)
MIT License
600 stars 173 forks source link

Add random world generation. Also move sanity checks to "O is not None". #18

Closed tahsinkose closed 5 years ago

tahsinkose commented 5 years ago

Hi there,

I have implemented a random world generation function at SearchSpace class. Also moved the sanity checks, because they were producing errors when O is None.

Since current implementation only supports rectangles, cubes and etc. (hyperrectangles in general) the world generation code is specialized. There are some constraints in it. None of the sides of a hyperrectangle cannot be higher than 0.1 of the total span in that particular dimensions and cannot be lower than 2.0 units. In some cases, this hardcoded constraint could result in an infinite loop. But it is very easy to put a timeout logic into the loop and use the obstacles sampled thus far.

As the rationale, I believe this is a handy bench-marking tool especially in a research setting. Also for the probabilistic accuracy it can provide a metric for the general case. One might want to try the algorithm without hard-coding the obstacles and stress in highly cluttered environments.

SZanlongo commented 5 years ago

Appreciate the demo obstacle generation! It'll be great for anyone who wants to compare different approaches or just get a feel for how this works.