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

29 ビュー (過去 30 日間)
Kashish Pilyal 2021 年 5 月 27 日

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
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 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 Center および File ExchangeMotion Planning についてさらに検索

### Community Treasure Hunt

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

Start Hunting!

Translated by