Re: vehicle navigation

jon klein <[email protected]> Mon, 5 Sep 2005 11:19:48 -0400
Newsgroups gmane.comp.breve
Message-ID <[email protected]>
--===============30431947096904288==
Content-Type: multipart/alternative; boundary=Apple-Mail-1--549983607


--Apple-Mail-1--549983607
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
	charset=US-ASCII;
	delsp=yes;
	format=flowed


On Sep 5, 2005, at 6:46 AM, Anand Veeraswamy wrote:

> But instead of using code inside the iterate method I would like to  
> shift this code into a function
> 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
> form of a list of patches. Now I cannot use the for each method to  
> run through the patches in
> 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) .

Sounds like you'll want to make use of the "schedule" method in the  
Object class.
Since your strategy is to plan out a route ahead of time, you could,  
in the init
method, schedule several methods to be called according to the route:

self schedule method-call "turn-left" at-time 10.
self schedule method-call "turn-right" at-time 20.
self schedule method-call "turn-right" at-time 30.

etc.

- jon klein
--Apple-Mail-1--549983607
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html;
	charset=ISO-8859-1

<HTML><BODY style=3D"word-wrap: break-word; -khtml-nbsp-mode: space; =
-khtml-line-break: after-white-space; "><BR><DIV><DIV>On Sep 5, 2005, at =
6:46 AM, Anand Veeraswamy wrote:</DIV><BR =
class=3D"Apple-interchange-newline"><BLOCKQUOTE type=3D"cite"> =
<DIV><FONT face=3D"Arial" size=3D"2">But=A0instead of=A0using code =
inside the iterate method I would like to shift this code into a =
function </FONT></DIV> <DIV><FONT face=3D"Arial" size=3D"2">that I can =
call from the init method. But in the=A0functions which would be out of =
the iterate method,</FONT></DIV> <DIV><FONT face=3D"Arial" size=3D"2">how =
can I implement the delay required=A0to make the vehicle turn left for =
some time and then stop?</FONT></DIV> <DIV><FONT face=3D"Arial" =
size=3D"2"></FONT>=A0</DIV> <DIV><FONT face=3D"Arial" size=3D"2">Actually =
I have been able to implement a path finding algorithm and the path to =
be taken is in the=A0</FONT></DIV> <DIV><FONT face=3D"Arial" =
size=3D"2">form of a list of patches. Now I cannot use the for each =
method to run through the patches in=A0</FONT></DIV> <DIV><FONT =
face=3D"Arial" size=3D"2">the iterate function, right?=A0I would like to =
run the for each method in the init function of=A0mybraitenbergcontrol =
class.</FONT></DIV> <DIV><FONT face=3D"Arial" size=3D"2">And for this I =
need a way to implement delay so that the vehicle can move left for some =
time and then move</FONT></DIV> <DIV><FONT face=3D"Arial" size=3D"2">right=
 etc.... and this should be done without the (controller get-time) =
.</FONT></DIV></BLOCKQUOTE><BR></DIV><DIV>Sounds like you'll want to =
make use of the "schedule" method in the Object class.</DIV><DIV>Since =
your strategy is to plan out a route ahead of time, you could, in the =
init</DIV><DIV>method, schedule several methods to be called according =
to the route:</DIV><DIV><BR =
class=3D"khtml-block-placeholder"></DIV><DIV>self schedule method-call =
"turn-left" at-time 10.</DIV><DIV>self schedule method-call "turn-right" =
at-time 20.</DIV><DIV>self schedule method-call "turn-right" at-time =
30.</DIV><DIV><BR =
class=3D"khtml-block-placeholder"></DIV><DIV>etc.</DIV><DIV><BR =
class=3D"khtml-block-placeholder"></DIV><DIV>- jon =
klein</DIV></BODY></HTML>=

--Apple-Mail-1--549983607--

--===============30431947096904288==
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

--===============30431947096904288==--