自动泊车算法中混合A*粗路径的MATLAB实现

这里使用Matlab的navigation toolbox实现简单的混合A*粗路径。

Load the cost values of cells in the vehicle costmap of a parking lot.

load parkingLotCostVal.mat

Create a binaryOccupancyMap with cost values.

map = binaryOccupancyMap(costVal);

Create a stateValidator object for collision checking.

validator = validatorOccupancyMap;

Assign the map to the stateValidator object.

validator.Map = map;

Initialize the plannerHybridAStar object with the stateValidator object.
Specify the MinTurningRadius and MotionPrimitiveLength properties of the planner.

planner = plannerHybridAStar(validator,'MinTurningRadius'...
    ,8,'MotionPrimitiveLength',12,'AnalyticExpansionInterval',10);

Define start and goal poses for the vehicle as [x, y, theta] vectors.
x and y specify the position in meters, and theta specifies the orientation angle in radians.

startPose = [75 20 -pi/2]; % [meters, meters, radians]
goalPose = [90 54 pi/2];

Plan a path from the start pose to the goal pose.

   refpath = plan(planner,startPose,goalPose);

Visualize the path using show function

show(planner)
size(refpath.States)
figure
show(map)
hold on
plot(startPose(1),startPose(2),'g.','markersize',25)
plot(goalPose(1),goalPose(2),'r.','markersize',25)
for i = 1: size(refpath.States,1)
   plot(refpath.States(i,1),refpath.States(i,2),'b-*','markersize',2)
   drawnow
   hold on
end

在这里插入图片描述

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值