RRTstar with own occupancy map

9 次查看(过去 30 天)
Michael
Michael 2023-1-16
回答: Sakshay 2023-3-14
I´m a beginner and i think there is an easy way to solve my problem, but I don´t find a solution.
I´m trying to generate my own occupancy map and run the RRTstar algorithm on it (2D). I use those two cites in the help center and want to connect both codes, Create an optimal RRT path planner (RRT*) - MATLAB - MathWorks Deutschland, Create occupancy grid with binary values - MATLAB - MathWorks Deutschland (Image to Binary Occupancy Grid Example). I can run my occupancy map, but when i want to connect it to the rrtstar code, its not possible, because this code needs an .mat map and not .png.
Do you have a solution? Is my aproach useful or is there an simpler way to model this?

回答(1 个)

Sakshay
Sakshay 2023-3-14
Hello Michael,
As per my understanding, you want to use a Custom Occupancy Map with the RRT* Path Planning algorithm.
The Binary Occupancy Map that you are creating using the mentioned documentation can be directly used with the RRT* algorithm. An example code for the same would look like:
% Create Binary Occupancy Map
map = binaryOccupancyMap(10,10,10);
% Initialize Path Planning
ss = stateSpaceSE2;
sv = validatorOccupancyMap(ss);
sv.Map = map;
sv.ValidationDistance = 0.01;
ss.StateBounds = [map.XWorldLimits; map.YWorldLimits; [-pi pi]];
% Initialize Planner
planner = plannerRRTStar(ss,sv, ...
ContinueAfterGoalReached=true, ...
MaxIterations=2500, ...
MaxConnectionDistance=0.3);
% Plan Path
start = [0.5 0.5 0];
goal = [2.5 0.2 0];
[pthObj,solnInfo] = plan(planner,start,goal);
For more information on Occupany Grids, you can refer to the following documentation:

类别

Help CenterFile Exchange 中查找有关 Mapping 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by