14.11.2012 Views

Submitted version of the thesis - Airlab, the Artificial Intelligence ...

Submitted version of the thesis - Airlab, the Artificial Intelligence ...

Submitted version of the thesis - Airlab, the Artificial Intelligence ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

132 Appendix B. Documentation <strong>of</strong> <strong>the</strong> programming<br />

<strong>of</strong>fset1 = [−R robot∗cosA−vn(2)∗s1∗cosA; R robot∗sinA+vn(2)∗ s1∗sinA ];<br />

if (vn(2)∗s1∗sinA < 0)<br />

M = m rot(−pi/2−alpha );<br />

else<br />

M = m rot(pi/2−alpha );<br />

end<br />

m arr1 = M∗m arr + [ <strong>of</strong>fset1 <strong>of</strong>fset1 <strong>of</strong>fset1 ];<br />

v txt1 = M∗v txt + <strong>of</strong>fset1 ;<br />

fill (m arr1(1 ,:) , m arr1 (2 ,:) , ’g ’ );<br />

text(v txt1 (1) , v txt1 (2) , ’v {n2} ’ );<br />

end<br />

% ruota 3<br />

if (vt(3) ˜= 0)<br />

line ([0 , −vt(3)∗s1],[−R robot , −R robot ] , ’Color ’ ,[0 1 0]);<br />

<strong>of</strong>fset1 = [−vt(3)∗s1 ; −R robot ];<br />

if(−vt(3)∗s1 < 0)<br />

M = m rot(pi/2);<br />

else<br />

M = m rot(−pi/2);<br />

end<br />

m arr1 = M∗m arr + [ <strong>of</strong>fset1 <strong>of</strong>fset1 <strong>of</strong>fset1 ];<br />

v txt1 = M∗v txt + <strong>of</strong>fset1 ;<br />

fill (m arr1(1 ,:) , m arr1 (2 ,:) , ’g ’ );<br />

text(v txt1 (1) , v txt1 (2) , ’v {t3} ’ );<br />

end<br />

if (vn(3) ˜= 0)<br />

line ([0 , 0],[−R robot , −R robot−vn(3)∗s1 ] , ’Color ’ ,[0 1 0])<br />

<strong>of</strong>fset1 = [0; −R robot−vn(3)∗s1 ];<br />

if(−vn(3)∗s1 < 0)<br />

M = m rot(pi );<br />

else<br />

M = m rot (0);<br />

end<br />

m arr1 = M∗m arr + [ <strong>of</strong>fset1 <strong>of</strong>fset1 <strong>of</strong>fset1 ];<br />

v txt1 = M∗v txt + <strong>of</strong>fset1 ;<br />

fill (m arr1(1 ,:) , m arr1 (2 ,:) , ’g ’ );

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!