%% Modify Connection Types for Dubins Path
% Create a DubinsConnection object.

dubConnObj = robotics.DubinsConnection;

%
% Define start and goal poses as [x y theta] vectors.

startPose = [0 0 0];
goalPose = [1 1 pi];

%
% Calculate a valid path segment to connect the poses.

[pathSegObj,pathCosts] = connect(dubConnObj,startPose,goalPose);

%
% Show the generated path. Notice the direction of the turns.

show(pathSegObj{1})
pathSegObj{1}.MotionTypes

%
% Disable this specific motion sequence in a new connection object. Reduce the MinTurningRadius if the robot is more manueverable. Connect the poses again to get a different path.

dubConnObj = robotics.DubinsConnection('DisabledPathTypes',{'RLR'});
dubConnObj.MinTurningRadius = 0.5;

[pathSegObj, pathCosts] = connect(dubConnObj,startPose,goalPose);
pathSegObj{1}.MotionTypes
show(pathSegObj{1})

% Copyright 2018 The MathWorks, Inc.
%
%