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

조회 수: 28 (최근 30일)
Kashish Pilyal
Kashish Pilyal 2021년 5월 27일
답변: Divija Aleti 2021년 6월 23일
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