Start state is not valid based on planner's state validator

32 次查看(过去 30 天)
costmap = vehicleCostmap(DCMap,'CellSize',res);
%% Create Hybrid A* Path Planner
% the stateSpaceSE2 object stores parameters and states in the SE(2) state space,
% which is composed of state vectors represented by [x, y, θ]. x and y are
% Cartesian coordinates, and θ is the orientation angle.
space = stateSpaceSE2;
space.StateBounds = [-100 100; -100 100; -pi pi]; % [x,y,θ]
validator = validatorVehicleCostmap(space); % state validator based on 2-D costmap
% save the results in validator
validator.Map = costmap; % save costmap
validator.ValidationDistance = 1; % save validation distance
MinTurningRadius = 3; % minimum turning radius [m]
MotionPrimitiveLength = 2*pi*MinTurningRadius/4; % motion primitive length [m]
% create the hybrid A* path planner
planner = plannerHybridAStar(validator,'MinTurningRadius',MinTurningRadius,'MotionPrimitiveLength',MotionPrimitiveLength);
startPose = [50 5 0]; % Define the start position
goalPose = [5 0 0]; %Define the goal position
refPath = plan(planner,startPose,goalPose);
I get the above error and this is how the map looks like with the coordinates. I am using a vehicleCostmap instead of occupancy map here. The vehicleCostmap worked for a previous map.

回答(1 个)

Divija Aleti
Divija Aleti 2021-6-23
Hi Kashish,
From the figure, I can see that your map's x-bounds are [-40 40] and y-bounds are [-25 25].
The coordinates of your start position are [50 5]. But the upper limit for x as given by the map's bounds is 40 and the x-coordinate of the start position is greater than that. Hence the error.
I suggest you to choose a start position which falls inside the map's boundaries and doesn't coincide with any obstacle.
Hope this helps!
Regards,
Divija

类别

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

标签

产品

Community Treasure Hunt

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

Start Hunting!

Translated by