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> </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> </DIV>
<DIV><FONT face=3DArial=20
size=3D2>****************************************************************=
**************************</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>+to iterate:<BR> =
#flag variable=20
is initially set to zero <BR> if flag=3D=3D0:=20
{<BR> time =3D (controller =
get-time). #Store=20
the controller time in variable =
time<BR> =20
flag=3D1. #to lock the time variable<BR> =
}<BR> =20
<BR> if (controller get-time) < time +32:=20
{<BR> self=20
moveRight. #move right =
for=20
sometime<BR> }</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2> if (controller =
get-time)=20
> time + 32 && (controller get-time) < time+40:=20
{ =
=20
<BR> self Stop. =
#Stop=20
after making the =
turn =20
<BR> =20
}<BR> &n=
bsp; </FONT></DIV>
<DIV><FONT face=3DArial=20
size=3D2>****************************************************************=
****************************</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>This code makes the vehicle =
turn 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 forward or move =
back=20
backward.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>But instead of 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 functions which would be out of the iterate =
method,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>how can I implement the delay =
required to make=20
the vehicle turn left for some time and then stop?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </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 </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 </FONT></DIV>
<DIV><FONT face=3DArial size=3D2>the iterate function, right? I =
would like to=20
run the for each method in the init function =
of 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> </DIV>
<DIV><FONT face=3DArial size=3D2>How would I go about doing =
this??</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Anand.</FONT></DIV>
<DIV><FONT face=3DArial=20
size=3D2> <BR> <BR> &n=
bsp; =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==--