<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8">
<meta name="generator" content="pdf2htmlEX">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<link rel="stylesheet" href="https://static.pudn.com/base/css/base.min.css">
<link rel="stylesheet" href="https://static.pudn.com/base/css/fancy.min.css">
<link rel="stylesheet" href="https://static.pudn.com/prod/directory_preview_static/62b5aa5df3cc394cf1c157a3/raw.css">
<script src="https://static.pudn.com/base/js/compatibility.min.js"></script>
<script src="https://static.pudn.com/base/js/pdf2htmlEX.min.js"></script>
<script>
try{
pdf2htmlEX.defaultViewer = new pdf2htmlEX.Viewer({});
}catch(e){}
</script>
<title></title>
</head>
<body>
<div id="sidebar" style="display: none">
<div id="outline">
</div>
</div>
<div id="pf1" class="pf w0 h0" data-page-no="1"><div class="pc pc1 w0 h0"><img class="bi x0 y0 w1 h1" alt="" src="https://static.pudn.com/prod/directory_preview_static/62b5aa5df3cc394cf1c157a3/bg1.jpg"><div class="c x0 y1 w2 h2"><div class="t m0 x1 h3 y2 ff1 fs0 fc0 sc0 ls0 ws0">算法设计原则:</div><div class="t m0 x1 h3 y3 ff2 fs0 fc0 sc1 ls0 ws0">1)<span class="ff1">与任何障碍物不发生碰撞;</span></div><div class="t m0 x1 h3 y4 ff2 fs0 fc0 sc1 ls0 ws0">2)<span class="ff1">路径尽可能短</span>,<span class="ff1">运行时间尽可能少;</span></div><div class="t m0 x1 h3 y5 ff2 fs0 fc0 sc1 ls0 ws0">3)<span class="ff1">应与障碍物保持一定的安全距离;</span></div><div class="t m0 x1 h3 y6 ff2 fs0 fc0 sc1 ls0 ws0">4)<span class="ff1">路径曲线尽可能平滑。</span></div><div class="t m0 x1 h3 y7 ff3 fs0 fc0 sc1 ls0 ws0">1.<span class="ff1 sc0">环境信息与编码:</span></div><div class="t m0 x2 h3 y8 ff1 fs0 fc0 sc1 ls0 ws0">为了模拟机器人的工作环境,需要对其工作空间建立模型来表</div><div class="t m0 x1 h3 y9 ff1 fs0 fc0 sc1 ls0 ws0">示。只考虑机器人工作空间的平面状况,不考虑高度问题,本论文</div><div class="t m0 x1 h3 ya ff1 fs0 fc0 sc1 ls0 ws0">采用栅格法划分机器人的工作空间,将机器人工作环境分解成一系</div><div class="t m0 x1 h3 yb ff1 fs0 fc0 sc1 ls0 ws0">列具有二值信息的网格单元。假设机器人的工作空间可以用二维平</div><div class="t m0 x1 h3 yc ff1 fs0 fc0 sc1 ls0 ws0">面图形表示,而且障碍物的尺寸、大小和位置己知,在机器人运动</div><div class="t m0 x1 h3 yd ff1 fs0 fc0 sc1 ls0 ws0">过程中障碍物的位置不发生变化。为了方便起见,机器人的工作空</div><div class="t m0 x1 h3 ye ff1 fs0 fc0 sc1 ls0 ws0">间用正方形表示<span class="ff2">(</span>不是正方形时,可以扩大障碍物,将工作空间填充</div><div class="t m0 x1 h3 yf ff1 fs0 fc0 sc1 ls0 ws0">成正方形<span class="ff2">)</span>,用尺寸相同的栅格将工作空间划分<span class="ff2">(</span>栅格的大小以机器</div><div class="t m0 x1 h3 y10 ff1 fs0 fc0 sc1 ls0 ws0">人通过为准<span class="ff2">)</span>。</div><div class="t m0 x1 h3 y11 ff1 fs0 fc0 sc1 ls0 ws0">在二维空间中采用栅格法来建立机器人的工作空间模型,按照机器</div></div></div><div class="pi" data-data='{"ctm":[1.611850,0.000000,0.000000,1.611850,0.000000,0.000000]}'></div></div>
</body>
</html>
<div id="pf2" class="pf w0 h0" data-page-no="2"><div class="pc pc2 w0 h0"><img class="bi x0 y0 w1 h1" alt="" src="https://static.pudn.com/prod/directory_preview_static/62b5aa5df3cc394cf1c157a3/bg2.jpg"><div class="c x0 y1 w2 h2"><div class="t m0 x1 h3 y2 ff1 fs0 fc0 sc1 ls0 ws0">人及工作空间的大小来确定栅格的数目,以保证机器人可以在其中</div><div class="t m0 x1 h3 y12 ff1 fs0 fc0 sc1 ls0 ws0">自由移动。</div><div class="t m0 x2 h3 y13 ff1 fs0 fc0 sc1 ls0 ws0">栅格的标识也就是栅格的编码方法有下述两种方法<span class="ff2">:①</span>直角坐标</div><div class="t m0 x1 h3 y14 ff1 fs0 fc0 sc1 ls0 ws0">法。如图所示,以栅格阵左下角为坐标原点,水平向右为<span class="ff2">x</span>轴正方向,</div><div class="t m0 x1 h3 y15 ff1 fs0 fc0 sc1 ls0 ws0">竖直向上为<span class="ff2">y</span>轴正方向,每一栅格区间对应坐标轴上的一个单位长度。</div><div class="t m0 x1 h3 y16 ff1 fs0 fc0 sc1 ls0 ws0">任一栅格均可用直角坐标<span class="ff2">(x,y)</span>唯一标识。</div><div class="t m0 x2 h3 y17 ff2 fs0 fc0 sc1 ls0 ws0">②<span class="ff1">序号法。如图</span>1<span class="ff1">所示,按从左到右,从下到上的顺序,从栅格</span></div><div class="t m0 x1 h3 y18 ff1 fs0 fc0 sc1 ls0 ws0">阵左下角第一个栅格开始,给每一个栅格一个序号<span class="ff2">p(</span>从零开始计<span class="ff2">)</span>,</div><div class="t m0 x1 h3 y19 ff1 fs0 fc0 sc1 ls0 ws0">则序号<span class="ff2">p</span>与栅格块</div><div class="t m0 x3 h3 y1a ff1 fs0 fc0 sc1 ls0 ws0"> </div></div></div><div class="pi" data-data='{"ctm":[1.611850,0.000000,0.000000,1.611850,0.000000,0.000000]}'></div></div>
<div id="pf3" class="pf w0 h0" data-page-no="3"><div class="pc pc3 w0 h0"><img class="bi x0 y0 w1 h1" alt="" src="https://static.pudn.com/prod/directory_preview_static/62b5aa5df3cc394cf1c157a3/bg3.jpg"><div class="c x0 y1 w2 h2"><div class="t m0 x2 h3 y2 ff2 fs0 fc0 sc1 ls0 ws0"> <span class="ff1">图</span>1 <span class="ff1">用直角坐标系建立的栅格</span></div><div class="t m0 x2 h3 y12 ff1 fs0 fc0 sc1 ls0 ws0">用序号法对每个小栅格进行编号,其中每个编号<span class="ff2">P</span>都与其直角坐</div><div class="t m0 x1 h3 y1b ff1 fs0 fc0 sc1 ls0 ws0">标一一对应,其映射关系为</div><div class="t m0 x4 h3 y1c ff2 fs0 fc0 sc1 ls0 ws0">p=x+10y <span class="_ _0"></span><span class="ff1">(</span>1-1<span class="ff1">)</span></div><div class="t m0 x1 h3 y1d ff1 fs0 fc0 sc1 ls0 ws0">而在<span class="ff2">MATLAB</span>语言中,<span class="ff2">x</span>和<span class="ff2">y</span>与<span class="ff2">P</span>的关系为</div><div class="t m0 x5 h3 y1e ff2 fs0 fc0 sc1 ls0 ws0">x=rem (p,10) <span class="_ _0"></span><span class="ff1">(</span>1-2<span class="ff1">)</span></div><div class="t m0 x5 h4 y1f ff2 fs0 fc0 sc1 ls0 ws0">y=x (P,10) (1-3)</div><div class="t m0 x2 h3 y20 ff1 fs0 fc0 sc1 ls0 ws0">其中,<span class="ff2">rem</span>表示取余操作,<span class="ff2">x</span>表示取整操作。对已建立的栅格</div><div class="t m0 x1 h3 y21 ff1 fs0 fc0 sc1 ls0 ws0">加入序号编码后的图形见图<span class="ff2">1</span>。因为遗传算法在搜索和优化上具有的</div><div class="t m0 x1 h3 y22 ff1 fs0 fc0 sc1 ls0 ws0">优势,所以采用遗传算法来进行机器人路径的规划。用遗传算法对</div><div class="t m0 x1 h3 y23 ff1 fs0 fc0 sc1 ls0 ws0">机器人的路径进行规划时,可将直角坐标法同序号法相结合使用,</div><div class="t m0 x1 h3 y24 ff1 fs0 fc0 sc1 ls0 ws0">根据条件的不同按照映射关系进行变换。这样既减少了个体长度及</div><div class="t m0 x1 h3 y25 ff1 fs0 fc0 sc1 ls0 ws0">编码的复杂度,又可以保证机器人处于栅格中心位置,避免了与其</div><div class="t m0 x1 h3 y26 ff1 fs0 fc0 sc1 ls0 ws0">周围障碍物的碰撞。</div><div class="t m0 x2 h3 y27 ff1 fs0 fc0 sc1 ls0 ws0">为了使每次的路径寻优都尽量向接近目标点的方向运动,当前</div><div class="t m0 x1 h3 y28 ff1 fs0 fc0 sc1 ls0 ws0">栅格邻接方位的位置显得极为重要。对于<span class="ff2">8</span>个邻接方位,<span class="ff2">8</span>个方位分</div></div></div><div class="pi" data-data='{"ctm":[1.611850,0.000000,0.000000,1.611850,0.000000,0.000000]}'></div></div>
<div id="pf4" class="pf w0 h0" data-page-no="4"><div class="pc pc4 w0 h0"><img class="bi x0 y0 w1 h1" alt="" src="https://static.pudn.com/prod/directory_preview_static/62b5aa5df3cc394cf1c157a3/bg4.jpg"><div class="c x0 y1 w2 h2"><div class="t m0 x1 h3 y2 ff1 fs0 fc0 sc1 ls0 ws0">别为:右下,右,右上,上,左上,左,左下,下。</div><div class="t m0 x2 h3 y3 ff1 fs0 fc0 sc1 ls0 ws0">方位距离表示当前栅格到它的邻接栅格的距离,定义为两个栅</div><div class="t m0 x1 h5 y29 ff1 fs0 fc0 sc1 ls0 ws0">格之间的中心距离。可以看<span class="ff4">出</span>,当前栅格和它相邻的<span class="ff2">8</span>个方位的距离</div><div class="t m0 x1 h3 y2a ff1 fs0 fc0 sc1 ls0 ws0">为定义为</div><div class="t m0 x6 h4 y2b ff5 fs0 fc0 sc1 ls0 ws0"> <span class="_ _1"> </span><span class="ff2"> (1-4)</span></div><div class="t m0 x2 h5 y2c ff1 fs0 fc0 sc1 ls0 ws0">由于<span class="ff4">地</span>图的表示有两种方<span class="ff4">式</span>,有序号法,如上所述,和直角坐</div><div class="t m0 x1 h5 y2d ff1 fs0 fc0 sc1 ls0 ws0">标法。因<span class="ff4">此</span>,在机器人<span class="ff4">地</span>图的表示中,需要一个结<span class="ff4">构</span>来表示这两种</div><div class="t m0 x1 h3 y2e ff1 fs0 fc0 sc1 ls0 ws0">表示方法的对应关系。</div><div class="t m0 x1 h6 y2f ff6 fs0 fc0 sc1 ls0 ws0">typedef struct Grid</div><div class="t m0 x1 h7 y30 ff5 fs0 fc0 sc1 ls0 ws0">{</div><div class="t m0 x1 h6 y31 ff6 fs0 fc0 sc1 ls0 ws0">DPOINT m_left_up;</div><div class="t m0 x1 h6 y32 ff6 fs0 fc0 sc1 ls0 ws0">DPOINT m_left_down;</div><div class="t m0 x1 h6 y33 ff6 fs0 fc0 sc1 ls0 ws0">DPOINT m_right_up;</div><div class="t m0 x1 h6 y34 ff6 fs0 fc0 sc1 ls0 ws0">DPOINT m_right_down;</div><div class="t m0 x1 h6 y35 ff6 fs0 fc0 sc1 ls0 ws0">DPOINT m_center;</div><div class="t m0 x1 h6 y36 ff6 fs0 fc0 sc1 ls0 ws0">int property;</div><div class="t m0 x1 h6 y37 ff6 fs0 fc0 sc1 ls0 ws0">int serial_ number;</div><div class="t m0 x1 h6 y38 ff5 fs0 fc0 sc1 ls0 ws0">}<span class="ff6">GRID ,*PGRID;</span></div><div class="t m0 x1 h5 y39 ff1 fs0 fc0 sc1 ls0 ws0">在结<span class="ff4">构<span class="ff6">GRID</span></span>中,以栅格的<span class="ff4">四</span>个<span class="ff4">顶</span>点,一个中心点栅格<span class="ff4">属性</span>以及栅格</div><div class="t m0 x1 h5 y3a ff1 fs0 fc0 sc1 ls0 ws0">序号表示一个栅格的信息。其中,栅格的<span class="ff4">四</span>个<span class="ff4">顶</span>点为:左上点</div></div></div><div class="pi" data-data='{"ctm":[1.611850,0.000000,0.000000,1.611850,0.000000,0.000000]}'></div></div>