<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
<link rel="self" type="application/atom+xml" href="http://forum.robosavvy.com/feed.php?f=4&amp;t=7716" />

<title>RoboSavvy Forum</title>
<subtitle>Robosavvy Forum: The largest online community of Humanoid Robot Builders</subtitle>
<link href="http://forum.robosavvy.com/index.php" />
<updated>2012-01-16T14:03:51+01:00</updated>

<author><name><![CDATA[RoboSavvy Forum]]></name></author>
<id>http://forum.robosavvy.com/feed.php?f=4&amp;t=7716</id>
<entry>
<author><name><![CDATA[miaja1]]></name></author>
<updated>2012-01-16T14:03:51+01:00</updated>
<published>2012-01-16T14:03:51+01:00</published>
<id>http://forum.robosavvy.com/viewtopic.php?t=7716&amp;p=33457#p33457</id>
<link href="http://forum.robosavvy.com/viewtopic.php?t=7716&amp;p=33457#p33457"/>
<title type="html"><![CDATA[How can I do this?]]></title>

<content type="html" xml:base="http://forum.robosavvy.com/viewtopic.php?t=7716&amp;p=33457#p33457"><![CDATA[
Hello!!! I have a question, I'm doing a project about robonova, i want to know how I can calculate the distance or degree if I have to turn right the robot to the object and then punch it. Here goes my template:<br /><br />'Search by hand<br /><br />DIM A AS BYTE<br />DIMSensorData AS INTEGER<br />DIMSensorData2 AS INTEGER<br />DIM ObjDistance AS INTEGER<br />DIM ArmNo AS INTEGER<br />PTP SETON <br />PTP ALLON<br /><br />'== motor diretion setting ======================<br />DIR G6A,1,0,0,1,0,0<br />DIR G6B,1,1,1,1,1,1<br />DIR G6C,0,0,0,0,0,0<br />DIR G6D,0,1,1,0,1,0<br /><br />'== motor start position read ===================<br />GETMOTORSET G6A,1,1,1,1,1,0<br />GETMOTORSET G6B,1,1,1,0,0,0<br />GETMOTORSET G6C,1,1,1,0,0,0<br />GETMOTORSET G6D,1,1,1,1,1,0<br /><br />SPEED 5<br /><br />'== motor power on  =============================<br />MOTOR G24<br /><br />GOSUB standard_pose<br /><br />'================================================<br />MAIN:    <br /><br />'A = REMOCON(1)<br />'IF A &lt;2&gt;=5 AND SensorData&lt;30&gt;=5 AND SensorData&lt;30 THEN <br />FOR i=5 TO SensorData<br />GOSUB forward_walk<br />NEXT i<br />GOSUB Punch_It<br />ENDIF<br />ENDIF<br />GOSUB standard_pose<br />WAIT<br /><br />'Program For the Sensor<br /><br />GOTO MAIN<br /><br /><br />Punch_It:<br />'Right arm<br />HIGHSPEED SETON<br /><br />MOVE G8B,100, 100, 100, 100, 101,  20,  92, 100<br />MOVE G8B,100, 100, 100, 100, 101,  35,  92, 100<br />MOVE G8B,100, 100, 100, 100, 101,  53,  92, 100<br />MOVE G8B,100, 100, 100, 100, 101,  74,  92, 100<br />MOVE G8B,100, 100, 100, 100, 101,  98,  92, 100<br /><br />HIGHSPEED SETOFF<br />RETURN<br /><br />Detect_Object3: 'for the left arm infront<br /><br />SensorData=0<br />SensorData=AD(1)<br />IF SensorData&lt;4 THEN SensorData=4<br />SensorData=3000/SensorData<br />RETURN<br />ReadyForSearchInfrontByHand:<br />MOVE G8B, 80, 100, 100, 100, 122,  21,  93, 100<br />MOVE G8B, 80, 100, 100, 100, 159,  17,  93, 100<br />MOVE G8B, 80, 100, 100, 100, 162,  17,  67, 100<br />MOVE G8B, 80, 100, 100, 100, 180,  17,  43, 100<br />MOVE G8B, 80, 100, 100, 100, 184,  17,  12, 100<br />WAIT<br />RETURN<br /><br />SearchDone:<br />MOVE G8B, 80, 100, 100, 100, 100,  100,  100, 100<br />MOVE G8B, 80, 100, 100, 100, 182, 107,  77, 100<br />MOVE G8B, 80, 100, 100, 100, 184,  22,  77, 100<br />WAIT<br />RETURN<br /><br />SearchDone2: 'for the side'because the robot throw away the object with his hand.<br />MOVE G8B, 78, 100, 100, 100, 103,  42,  69, 100<br /><br /><br />Detect_Object4: 'for the left arm left Side<br /><br />SensorData=0<br />SensorData=AD(1)<br />IF SensorData&lt;4 THEN SensorData=4<br />SensorData=3000/SensorData<br />RETURN<br /><br /><br /><br />SearchBySide:<br />MOVE G8B, 80, 100, 100, 100, 101,  76,  34, 100<br />WAIT<br />RETURN<br />'================================================<br />forward_walk:<br /><br />SPEED 5<br />MOVE24  85,  71, 152,  91, 112,  60, 100,  40,  80,    ,    ,    , 100,  40,  80,    ,    ,    , 112,  76, 145,  93,  92,  60,<br /><br />SPEED 14 <br />'left up<br />MOVE24  90, 107, 105, 105, 114,  60,  90,  40,  80,    ,    ,    , 100,  40,  80,    ,    ,    , 114,  76, 145,  93,  90,  60,<br />'---------------------------------------<br />'left down<br />MOVE24  90,  56, 143, 122, 114,  60,  80,  40,  80,    ,    ,    , 105,  40,  80,    ,    ,    , 113,  80, 145,  90,  90,  60,<br />MOVE24  90,  46, 163, 112, 114,  60,  80,  40,  80,    ,    ,    , 105,  40,  80,    ,    ,    , 112,  80, 145,  90,  90,  60,<br /><br />SPEED 10<br />'left center<br />MOVE24 100,  66, 141, 113, 100, 100,  90,  40,  80,    ,    ,    , 100,  40,  80,    ,    ,    , 100,  83, 156,  80, 100, 100,<br />MOVE24 113,  78, 142, 105,  90,  60, 100,  40,  80,    ,    ,    , 100,  40,  80,    ,    ,    ,  90, 102, 136,  85, 114,  60,<br /><br />SPEED 14<br />'right up<br />MOVE24 113,  76, 145,  93,  90,  60, 100,  40,  80,    ,    ,    ,  90,  40,  80,    ,    ,    ,  90, 107, 105, 105, 114,  60,<br /><br />'right down<br />MOVE24 113,  80, 145,  90,  90,  60, 105,  40,  80,    ,    ,    ,  80,  40,  80,    ,    ,    ,  90,  56, 143, 122, 114,  60,<br />MOVE24 112,  80, 145,  90,  90,  60, 105,  40,  80,    ,    ,    ,  80,  40,  80,    ,    ,    ,  90,  46, 163, 112, 114,  60,<br /><br />SPEED 10<br />'right center<br />MOVE24 100,  83, 156,  80, 100, 100, 100,  40,  80,    ,    ,    ,  90,  40,  80,    ,    ,    , 100,  66, 141, 113, 100, 100,<br />MOVE24  90, 102, 136,  85, 114,  60, 100,  40,  80,    ,    ,    , 100,  40,  80,    ,    ,    , 113,  78, 142, 105,  90,  60,<br /><br />SPEED 14<br />'left up<br />MOVE24  90, 107, 105, 105, 114,  60,  90,  40,  80,    ,    ,    , 100,  40,  80,    ,    ,    , 113,  76, 145,  93,  90,  60,<br />'---------------------------------------<br /><br />SPEED 5<br />MOVE24  85,  71, 152,  91, 112,  60, 100,  40,  80,    ,    ,    , 100,  40,  80,    ,    ,    , 112,  76, 145,  93,  92,  60,<br /><br />RETURN<br />'================================================<br />right_turn:<br />SPEED 6<br /><br />MOVE G6A,  85,  71, 152,  91, 112,  60  <br />MOVE G6D, 112,  76, 145,  93,  92,  60 <br />MOVE G6B, 100,  40,  80,    ,    ,    ,<br />MOVE G6C, 100,  40,  80,    ,    ,    ,<br />WAIT<br /><br />SPEED 9<br /><br />MOVE G6D, 113,  75, 145,  97,  93,  60<br />MOVE G6A,  90,  50, 157, 115, 112,  60 <br />MOVE G6C, 105,  40,  70,    ,    ,    , <br />MOVE G6B,  90,  40,  70,    ,    ,    , <br />WAIT   <br /><br />MOVE G6D, 108,  78, 145,  110,  93,  60<br />MOVE G6A,  95,  43, 169, 110, 110,  60 <br />MOVE G6C, 105,  40,  70,    ,    ,    ,<br />MOVE G6B,  80,  40,  70,    ,    ,    , <br />WAIT<br /><br />RETURN<br />'================================================<br />MAIN_RIGHT:<br /><br />GOSUB right_turn<br />GOSUB standard_pose<br />DELAY 1000<br />GOSUB right_turn<br />GOSUB standard_pose<br />DELAY 1000<br />GOSUB right_turn<br />GOSUB standard_pose<br />DELAY 1000<br />GOSUB right_turn<br />GOSUB standard_pose<br />DELAY 1000<br />GOSUB right_turn<br />GOSUB standard_pose<br />DELAY 1000<br /><br /><br />'================================================<br /><br /><br />standard_pose:<br /><br />MOVE G6A,100,  76, 145,  93, 100, 100 <br />MOVE G6D,100,  76, 145,  93, 100, 100  <br />MOVE G6B,100,  30,  80, 100, 100, 100<br />MOVE G6C,100,  30,  80, 100, 100, 100<br />WAIT<br /><br />RETURN<br />'================================================<br /><br /><br />Please correct me in anything that is wrong, thank you so much!!!!!!!!!!!<p>Statistics: Posted by <a href="http://forum.robosavvy.com/memberlist.php?mode=viewprofile&amp;u=3124">miaja1</a> — Mon Jan 16, 2012 2:03 pm</p><hr />
]]></content>
</entry>
</feed>