I am using the Dubins connection object to find the shortest path, but it seems like it's not the shortest path.
5 views (last 30 days)
Show older comments
I am using the code below because I want to find the shortest path for the LRL mode. Therefore, I have included all other modes except LRL in disablepathtype.
dubConnObj = dubinsConnection;
startPose = [4.61 2.43 deg2rad(20.0)];
goalPose = [5.45 10.55 deg2rad(80.0)];
dubConnObj = dubinsConnection('DisabledPathTypes',{'RLR', 'LSL', 'LSR', 'RSL', 'RSR'});
dubConnObj.MinTurningRadius = 2.5;
[pathSegObj, pathCosts] = connect(dubConnObj,startPose,goalPose);
show(pathSegObj{1})
However, the LRL path displayed by MATLAB does not seem to be the shortest path.
The orange line represents the path shown by MATLAB. Yet, if I follow the LRL path along another circle (the black circle) that simultaneously touches the two circles tangent to the starting and ending points, the distance seems shorter.
I'm wondering if the MATLAB code is not considering this, or if there are other parameters involved. Thank you!
2 Comments
Manikanta Aditya
on 6 Mar 2024
Hi, Try checking this.
dubConnObj = dubinsConnection;
startPose = [4.61 2.43 deg2rad(20.0)];
goalPose = [5.45 10.55 deg2rad(80.0)];
dubConnObj.MinTurningRadius = 2.5;
[pathSegObj, pathCosts] = connect(dubConnObj,startPose,goalPose);
show(pathSegObj{1})
Answers (1)
Milan Bansal
on 28 Mar 2024
Hi Yeunjoo
I understand that you have plotted the shortest path in LRL (left-right-left) mode using "dubinsConnection" but you are not sure if the plotted path is the shortest or not and if there is an alternate path possible.
The "dubinsConnection" object in MATLAB is designed to compute the shortest path between two poses (positions and orientations) for a Dubins vehicle, given its minimum turning radius constraint. A Dubins vehicle is one that moves forward at a constant speed, can turn with a minimum radius, but cannot move backwards. In this particular problem, the directions of the path is also fixed.
There are three constraints to the problem:
1.) Left-Right-Left (LRL mode) 2.) Minimum radius 3.) Poses
The path along the black circle is not possible, as it must be violating one of these constraints. Therefore, the path drawn by MATLAB is the shortest path between the start and goal points.
However, if you wish to further reduce the length of the path, try reducing the minimum radius constraint. Please refer to the code snippet below.
% Initialize the Dubins connection object with disabled path types except LRL
dubConnObj = dubinsConnection('DisabledPathTypes', {'RLR', 'LSL', 'LSR', 'RSL', 'RSR'});
% Set the minimum turning radius for the Dubins paths
dubConnObj.MinTurningRadius = 1.75;
% Define the start and goal poses [x, y, theta]
startPose = [4.61 2.43 deg2rad(20.0)];
goalPose = [5.45 10.55 deg2rad(80.0)];
% Find the shortest path and its cost
[pathSegObj, pathCosts] = connect(dubConnObj, startPose, goalPose);
% Display the path
show(pathSegObj{1});
Please refer to the following documentation link to learn more about "dubinsConnection" object.
Please refer to the following documentation link to learn more about "connect" function.
Hope this helps!
0 Comments
See Also
Categories
Find more on Motion Planning in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!