How to obtain optimal path between start and goal pose using pathPlannerRRT() and plan()?

조회 수: 3 (최근 30일)
I am currently working on path planning of a vehicle for an automatic parking system.
I am currently using pathPlannerRRT() and plan() to generate a path between start and goal pose. The problem that i am facing is, with the same start and goal pose each time i re-run my program, i am getting a different path. Different results each time I re-run indicates that the path being generated is not optimal. Sometimes it is close to optimal, sometimes its very wavy and sub optimal.
How can i better control the path being generated and how can i ensure that the path being generated is optimal?
This is the part of code where i am configuring the path planner:
motion_planner = pathPlannerRRT(cstmp,'MinIterations',2000,'ConnectionDistance',5,'MinTurningRadius',4,'ConnectionMethod','Reeds-Shepp','ApproximateSearch',false);
path = plan(motion_planner,curr_pose,goal_pose);

채택된 답변

Qu Cao
Qu Cao 2021년 6월 30일
Please set the random seed at the beginning to get consistent results across different runs:
rng(1);
motion_planner = pathPlannerRRT(cstmp,'MinIterations',2000,'ConnectionDistance',5,'MinTurningRadius',4,'ConnectionMethod','Reeds-Shepp','ApproximateSearch',false);
path = plan(motion_planner,curr_pose,goal_pose);
  댓글 수: 2
Tarun Santosh
Tarun Santosh 2021년 7월 4일
By setting a random seed, the program is giving repeatable results but if possible could you explain how this is working? Why setting a random seed is making the results from pathPlannerRRT repeatable?
Qu Cao
Qu Cao 2021년 7월 4일
A rapidly exploring random tree (RRT) is an algorithm designed to efficiently search nonconvex, high-dimensional spaces by randomly building a space-filling tree.
rng controls the generation of random numbers.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Transportation Engineering에 대해 자세히 알아보기

제품


릴리스

R2020a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by