Closed cengzezou closed 2 months ago
@cengzezou, appreciate your looking into this! That solution makes sense. If you have time to test out the solution, I'd be happy to merge a PR with the changes.
@cengzezou, I've implemented the changes. Let me know if it reflects what you had in mind.
Great work! I spot is a general issue in the use of step size in steer function. Maybe your other RRT implementations also suffer from the same issue. Please let me know if the following observations are wrong.
In your code,
steer
always takes a fixed step size which is fine tillq_new
gets very close to the target.Let's think about the case of
rrt-connect
. The second tree is repeatedly getting closer to a target vertexq_first
in the first tree, Eventually it reaches a point where distance betweenq_second
andq_first
is below edge lengthq
. If I understand your code correctly, in such a case the nextsteer
will move beyondq_first
to a positionq_last_steer
. This has two consequences:q_second
andq_first
are sampled within boundaries. Butq_last_steer
may not be. I suspect this is the cause of the out-of-bound errors reported by other users (your shouldn't need to definebound_point
function).q
-distance apart. But sadly,q_last_steer
will not yieldREACH
unless you increase the threshold1e-2
to the scale of edge lengthq
.This explains why
rrt-connect
does not exhibit superior efficiency against other planners. I suggest a quick fix by simply modifying the step size used in steer to bemin(q, norm(q_second-q_first))
.