資源簡介
移動機器人路徑規劃 幾種A*算法改進matlab實現,可直接運行。適用于初學者基于A*算法進行改進,容易理解并上手,

代碼片段和文件信息
classdef?Astar?????properties?(SetAccess=private?GetAccess=private)
????????start
????????goal
????????occgrid?????%?occupancy?grid?as?provided?by?user
????????occgridnav??%?inflated?occupancy?grid
????????w2g?????????%?transform?from?world?coordinates?to?grid?coordinates
????????T
????????%?info?kept?per?cell?(state)
????????b???????%?backpointer?(0?means?not?set)
????????t???????%?tag:?NEW?OPEN?CLOSED
????????g???????%?distance?map?path?cost
????????path
????????line
????????H0
????????heuristicmethod?????%?defferent?methods?to?enconding?the?distance?of?geven?node?to?the?goal
????????validplan???????????%?a?plan?has?been?computed?for?current?costmap
????????openlist????????????%?list?of?open?states:?2xN?matrixeach?open?point?is?a?column?row?1?=?index?of?cell?row?2?=?k
????????openlist_maxlen?????%?keep?track?of?maximum?length????????
????????%?tag?state?values
????????NEW?=?0;
????????OPEN?=?1;
????????CLOSED?=?2;????????
????end?????
????properties?(SetAccess=private?GetAccess=public)
????????niter?=?0;
????????costmap????????????%?world?cost?map:?obstacle?=?Inf
????end???????
????methods?(Access=public)
????????%%?initialization?and?properties?options
????????function?as?=?Astar(world?varargin)
????????%?Create?a?Navigation?object????????
????????%?as?=?Astar(OCCGRID?OPTIONS)?is?a?Navigation?object?that?holds?an
????????%?occupancy?grid?OCCGRID.??A?number?of?options?can?be?be?passed.
????????%
????????%?Options::
????????%?‘inflate‘K?????Inflate?all?obstacles?by?K?cells.
????????%
????????%?Notes::
????????%?-?In?the?occupancy?grid?a?value?of?zero?means?free?space?and?non-zero?means
????????%???occupied?(not?driveable).
????????%?-?Obstacle?inflation?is?performed?with?a?round?structuring?element?(kcircle)?
????????%???with?radius?given?by?the?‘inflate‘?option.
????????%?-?Inflation?requires?either?MVTB?or?IPT?installed.
???????????if?nargin?>=?1?
????????????????%?first?argument?is?the?map
????????????????map?=?world;
????????????????if?isnumeric(map)?&&?~isscalar(map)
????????????????????as.occgrid?=?map;
????????????????????as.w2g?=?SE2(0?0?0);
????????????????elseif?isstruct(map)
?????????????????????as.occgrid?=?map.map;
?????????????????????as.w2g?=?as.T;
????????????????end
???????????end????????????
????????????%?default?values?of?options
????????????opt.inflate?=?0;
????????????opt.transform?=?SE2;
????????????opt?=?tb_optparse(opt?varargin);
????????????%?optionally?inflate?the?obstacles
????????????if?opt.inflate?>?0
????????????????if?exist(‘idilate‘‘E:\RoboticsLab\vision-4.1\rvctools\vision‘)?==?2
????????????????????%?use?MVTB
????????????????????as.occgridnav?=?idilate(as.occgrid?kcircle(opt.inflate));
????????????????elseif?exist(‘imdilate‘‘E:\RoboticsLab\vision-4.1\rvctools\vision‘)?==?2
????????????????????%?use?IPT
????????????????????as.occgridnav?=?imdilate(as.occgrid?strel(‘disk‘opt.inflate));
????????????????else
?????????????
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件??????37235??2018-05-16?19:29??Astar\Astar.m
?????文件??????35667??2018-05-08?00:32??Astar\DoubleAstar.m
?????文件??????36812??2018-05-15?16:24??Astar\ImprovednAstar.m
?????文件??????33510??2018-05-15?17:23??Astar\nAstar.m
?????目錄??????????0??2019-12-05?15:31??Astar
-----------?---------??----------?-----??----
???????????????143224????????????????????5
評論
共有 條評論