vehicle navigation

"Anand Veeraswamy" <[email protected]> Mon, 5 Sep 2005 11:46:06 +0100
Newsgroups gmane.comp.breve
Message-ID <[email protected]>
This is a multi-part message in MIME format.

--===============28371620595008973==
Content-Type: multipart/alternative;
	boundary="----=_NextPart_000_0024_01C5B20F.66DB7880"

This is a multi-part message in MIME format.

------=_NextPart_000_0024_01C5B20F.66DB7880
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hi,

I have implemented the following code to make the braitenberg vehicle =
move right.

*************************************************************************=
*****************
+to iterate:
    #flag variable is initially set to zero=20
    if flag=3D=3D0: {
       time =3D (controller get-time). #Store the controller time in =
variable time
       flag=3D1. #to lock the time variable
     }
  =20
     if (controller get-time) < time +32: {
         self moveRight.         #move right for sometime
     }

     if (controller get-time) > time + 32 && (controller get-time) < =
time+40: {            =20
          self Stop. #Stop after making the turn         =20
     }
               =20
*************************************************************************=
*******************
This code makes the vehicle turn right and stop. By adding further code =
I can make the vehicle=20
turn left or move forward or move back backward.

But instead of using code inside the iterate method I would like to =
shift this code into a function=20
that I can call from the init method. But in the functions which would =
be out of the iterate method,
how can I implement the delay required to make the vehicle turn left for =
some time and then stop?

Actually I have been able to implement a path finding algorithm and the =
path to be taken is in the=20
form of a list of patches. Now I cannot use the for each method to run =
through the patches in=20
the iterate function, right? I would like to run the for each method in =
the init function of mybraitenbergcontrol class.
And for this I need a way to implement delay so that the vehicle can =
move left for some time and then move
right etc.... and this should be done without the (controller get-time) =


How would I go about doing this??

Anand.
     =20
=20
             
------=_NextPart_000_0024_01C5B20F.66DB7880
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2900.2722" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Hi,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>I have implemented the following code =
to make the=20
braitenberg vehicle move right.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial=20
size=3D2>****************************************************************=
**************************</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>+to iterate:<BR>&nbsp;&nbsp;&nbsp; =
#flag variable=20
is initially set to zero&nbsp;<BR>&nbsp;&nbsp;&nbsp; if flag=3D=3D0:=20
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; time =3D (controller =
get-time). #Store=20
the controller time in variable =
time<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
flag=3D1. #to lock the time variable<BR>&nbsp;&nbsp;&nbsp;&nbsp; =
}<BR>&nbsp;&nbsp;=20
<BR>&nbsp;&nbsp;&nbsp;&nbsp; if (controller get-time) &lt; time +32:=20
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self=20
moveRight.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #move right =
for=20
sometime<BR>&nbsp;&nbsp;&nbsp;&nbsp; }</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp;&nbsp; if (controller =
get-time)=20
&gt; time + 32 &amp;&amp; (controller get-time) &lt; time+40:=20
{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
=20
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self Stop. =
#Stop=20
after making the =
turn&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
<BR>&nbsp;&nbsp;&nbsp;&nbsp;=20
}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;</FONT></DIV>
<DIV><FONT face=3DArial=20
size=3D2>****************************************************************=
****************************</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>This code makes the vehicle =
turn&nbsp;right and=20
stop. By adding further code I can make the vehicle </FONT></DIV>
<DIV><FONT face=3DArial size=3D2>turn left or move&nbsp;forward or move =
back=20
backward.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>But&nbsp;instead of&nbsp;using code =
inside the=20
iterate method I would like to shift this code into a function =
</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>that I can call from the init method. =
But in=20
the&nbsp;functions which would be out of the iterate =
method,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>how can I implement the delay =
required&nbsp;to make=20
the vehicle turn left for some time and then stop?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Actually I have been able to implement =
a path=20
finding algorithm and the path to be taken is in the&nbsp;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>form of a list of patches. Now I cannot =
use the for=20
each method to run through the patches in&nbsp;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>the iterate function, right?&nbsp;I =
would like to=20
run the for each method in the init function =
of&nbsp;mybraitenbergcontrol=20
class.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>And for this I need a way to implement =
delay so=20
that the vehicle can move left for some time and then move</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>right etc.... and this should be done =
without the=20
(controller get-time) .</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>How would I go about doing =
this??</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Anand.</FONT></DIV>
<DIV><FONT face=3DArial=20
size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;<BR>&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
</FONT></DIV></BODY></HTML>

------=_NextPart_000_0024_01C5B20F.66DB7880--

--===============28371620595008973==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
breve mailing list
[email protected]
http://lists.spiderland.org/mailman/listinfo/breve

--===============28371620595008973==--