OSDN Git Service

lejos_NXJ_win32_0_5_0beta.zip
[nxt-jsp/lejos_nxj.git] / nxtOSEK / lejos_nxj / docs / apidocs / lejos / navigation / TachoNavigator.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2 <!--NewPage-->
3 <HTML>
4 <HEAD>
5 <!-- Generated by javadoc (build 1.5.0_09) on Tue Jan 08 20:46:01 GMT 2008 -->
6 <TITLE>
7 TachoNavigator (leJOS NXT API documentation)
8 </TITLE>
9
10 <META NAME="keywords" CONTENT="lejos.navigation.TachoNavigator class">
11
12 <LINK REL ="stylesheet" TYPE="text/css" HREF="../../stylesheet.css" TITLE="Style">
13
14 <SCRIPT type="text/javascript">
15 function windowTitle()
16 {
17     parent.document.title="TachoNavigator (leJOS NXT API documentation)";
18 }
19 </SCRIPT>
20 <NOSCRIPT>
21 </NOSCRIPT>
22
23 </HEAD>
24
25 <BODY BGCOLOR="white" onload="windowTitle();">
26
27
28 <!-- ========= START OF TOP NAVBAR ======= -->
29 <A NAME="navbar_top"><!-- --></A>
30 <A HREF="#skip-navbar_top" title="Skip navigation links"></A>
31 <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
32 <TR>
33 <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
34 <A NAME="navbar_top_firstrow"><!-- --></A>
35 <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
36   <TR ALIGN="center" VALIGN="top">
37   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
38   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
39   <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
40   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
41   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
42   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
43   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
44   </TR>
45 </TABLE>
46 </TD>
47 <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
48 </EM>
49 </TD>
50 </TR>
51
52 <TR>
53 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
54 &nbsp;<A HREF="../../lejos/navigation/Pilot.html" title="class in lejos.navigation"><B>PREV CLASS</B></A>&nbsp;
55 &nbsp;NEXT CLASS</FONT></TD>
56 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
57   <A HREF="../../index.html?lejos/navigation/TachoNavigator.html" target="_top"><B>FRAMES</B></A>  &nbsp;
58 &nbsp;<A HREF="TachoNavigator.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
59 &nbsp;<SCRIPT type="text/javascript">
60   <!--
61   if(window==top) {
62     document.writeln('<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>');
63   }
64   //-->
65 </SCRIPT>
66 <NOSCRIPT>
67   <A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>
68 </NOSCRIPT>
69
70
71 </FONT></TD>
72 </TR>
73 <TR>
74 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
75   SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;<A HREF="#field_summary">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
76 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
77 DETAIL:&nbsp;<A HREF="#field_detail">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
78 </TR>
79 </TABLE>
80 <A NAME="skip-navbar_top"></A>
81 <!-- ========= END OF TOP NAVBAR ========= -->
82
83 <HR>
84 <!-- ======== START OF CLASS DATA ======== -->
85 <H2>
86 <FONT SIZE="-1">
87 lejos.navigation</FONT>
88 <BR>
89 Class TachoNavigator</H2>
90 <PRE>
91 <A HREF="../../java/lang/Object.html" title="class in java.lang">java.lang.Object</A>
92   <IMG SRC="../../resources/inherit.gif" ALT="extended by "><B>lejos.navigation.TachoNavigator</B>
93 </PRE>
94 <DL>
95 <DT><B>All Implemented Interfaces:</B> <DD><A HREF="../../lejos/navigation/Navigator.html" title="interface in lejos.navigation">Navigator</A></DD>
96 </DL>
97 <DL>
98 <DT><B>Direct Known Subclasses:</B> <DD><A HREF="../../lejos/navigation/CompassNavigator.html" title="class in lejos.navigation">CompassNavigator</A></DD>
99 </DL>
100 <HR>
101 <DL>
102 <DT><PRE>public class <B>TachoNavigator</B><DT>extends <A HREF="../../java/lang/Object.html" title="class in java.lang">Object</A><DT>implements <A HREF="../../lejos/navigation/Navigator.html" title="interface in lejos.navigation">Navigator</A></DL>
103 </PRE>
104
105 <P>
106 The TachoNavigator class can keep track of the robot position and the direction angle it faces; It uses a _pilot object to control NXT robot movements.<br>
107  The position and direction angle values are updated automatically when the movement command returns after the movement is complete and and after stop() command is issued.
108  However, some commands optionally return immediately, to permit sensor monitoring in the main thread.  It is then the programmers responsibility to 
109  call updatePosition() when the robot motion is completed.  All angles are in degrees, distances in the units used to specify robot dimensions.
110  As with pilot, the robot must be have two independently controlled drive wheels. 
111  The assumed initial position of the robot is at (0,0) and initial angle 0 i.e. pointing in the +X direction.
112 <P>
113
114 <P>
115 <HR>
116
117 <P>
118 <!-- =========== FIELD SUMMARY =========== -->
119
120 <A NAME="field_summary"><!-- --></A>
121 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
122 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
123 <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
124 <B>Field Summary</B></FONT></TH>
125 </TR>
126 <TR BGCOLOR="white" CLASS="TableRowColor">
127 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
128 <CODE>protected &nbsp;float</CODE></FONT></TD>
129 <TD><CODE><B><A HREF="../../lejos/navigation/TachoNavigator.html#_heading">_heading</A></B></CODE>
130
131 <BR>
132 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
133 </TR>
134 <TR BGCOLOR="white" CLASS="TableRowColor">
135 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
136 <CODE>protected &nbsp;int</CODE></FONT></TD>
137 <TD><CODE><B><A HREF="../../lejos/navigation/TachoNavigator.html#_left0">_left0</A></B></CODE>
138
139 <BR>
140 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
141 </TR>
142 <TR BGCOLOR="white" CLASS="TableRowColor">
143 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
144 <CODE>protected &nbsp;<A HREF="../../lejos/navigation/Pilot.html" title="class in lejos.navigation">Pilot</A></CODE></FONT></TD>
145 <TD><CODE><B><A HREF="../../lejos/navigation/TachoNavigator.html#_pilot">_pilot</A></B></CODE>
146
147 <BR>
148 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
149 </TR>
150 <TR BGCOLOR="white" CLASS="TableRowColor">
151 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
152 <CODE>protected &nbsp;int</CODE></FONT></TD>
153 <TD><CODE><B><A HREF="../../lejos/navigation/TachoNavigator.html#_right0">_right0</A></B></CODE>
154
155 <BR>
156 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
157 </TR>
158 </TABLE>
159 &nbsp;
160 <!-- ======== CONSTRUCTOR SUMMARY ======== -->
161
162 <A NAME="constructor_summary"><!-- --></A>
163 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
164 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
165 <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
166 <B>Constructor Summary</B></FONT></TH>
167 </TR>
168 <TR BGCOLOR="white" CLASS="TableRowColor">
169 <TD><CODE><B><A HREF="../../lejos/navigation/TachoNavigator.html#TachoNavigator(float, float)">TachoNavigator</A></B>(float&nbsp;wheelDiameter,
170                float&nbsp;driveLength)</CODE>
171
172 <BR>
173 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Overloaded TachoNavigator constructor that assumes the following:<BR>
174  Left motor = Motor.A   Right motor = Motor.C <BR></TD>
175 </TR>
176 <TR BGCOLOR="white" CLASS="TableRowColor">
177 <TD><CODE><B><A HREF="../../lejos/navigation/TachoNavigator.html#TachoNavigator(float, float, lejos.nxt.Motor, lejos.nxt.Motor)">TachoNavigator</A></B>(float&nbsp;wheelDiameter,
178                float&nbsp;trackWidth,
179                <A HREF="../../lejos/nxt/Motor.html" title="class in lejos.nxt">Motor</A>&nbsp;leftMotor,
180                <A HREF="../../lejos/nxt/Motor.html" title="class in lejos.nxt">Motor</A>&nbsp;rightMotor)</CODE>
181
182 <BR>
183 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
184 </TR>
185 <TR BGCOLOR="white" CLASS="TableRowColor">
186 <TD><CODE><B><A HREF="../../lejos/navigation/TachoNavigator.html#TachoNavigator(float, float, lejos.nxt.Motor, lejos.nxt.Motor, boolean)">TachoNavigator</A></B>(float&nbsp;wheelDiameter,
187                float&nbsp;trackWidth,
188                <A HREF="../../lejos/nxt/Motor.html" title="class in lejos.nxt">Motor</A>&nbsp;leftMotor,
189                <A HREF="../../lejos/nxt/Motor.html" title="class in lejos.nxt">Motor</A>&nbsp;rightMotor,
190                boolean&nbsp;reverse)</CODE>
191
192 <BR>
193 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Allocates a Navigator object and initializes it with the proper motors.</TD>
194 </TR>
195 <TR BGCOLOR="white" CLASS="TableRowColor">
196 <TD><CODE><B><A HREF="../../lejos/navigation/TachoNavigator.html#TachoNavigator(lejos.navigation.Pilot)">TachoNavigator</A></B>(<A HREF="../../lejos/navigation/Pilot.html" title="class in lejos.navigation">Pilot</A>&nbsp;pilot)</CODE>
197
198 <BR>
199 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
200 </TR>
201 </TABLE>
202 &nbsp;
203 <!-- ========== METHOD SUMMARY =========== -->
204
205 <A NAME="method_summary"><!-- --></A>
206 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
207 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
208 <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
209 <B>Method Summary</B></FONT></TH>
210 </TR>
211 <TR BGCOLOR="white" CLASS="TableRowColor">
212 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
213 <CODE>&nbsp;float</CODE></FONT></TD>
214 <TD><CODE><B><A HREF="../../lejos/navigation/TachoNavigator.html#angleTo(float, float)">angleTo</A></B>(float&nbsp;x,
215         float&nbsp;y)</CODE>
216
217 <BR>
218 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;returns the direction angle (degrees) to point with coordinates (x,y)</TD>
219 </TR>
220 <TR BGCOLOR="white" CLASS="TableRowColor">
221 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
222 <CODE>&nbsp;void</CODE></FONT></TD>
223 <TD><CODE><B><A HREF="../../lejos/navigation/TachoNavigator.html#backward()">backward</A></B>()</CODE>
224
225 <BR>
226 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Moves the NXT robot backward until stop() is called.</TD>
227 </TR>
228 <TR BGCOLOR="white" CLASS="TableRowColor">
229 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
230 <CODE>&nbsp;float</CODE></FONT></TD>
231 <TD><CODE><B><A HREF="../../lejos/navigation/TachoNavigator.html#distanceTo(float, float)">distanceTo</A></B>(float&nbsp;x,
232            float&nbsp;y)</CODE>
233
234 <BR>
235 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;distance from robot to the point with coordinates (x,y) .</TD>
236 </TR>
237 <TR BGCOLOR="white" CLASS="TableRowColor">
238 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
239 <CODE>&nbsp;void</CODE></FONT></TD>
240 <TD><CODE><B><A HREF="../../lejos/navigation/TachoNavigator.html#forward()">forward</A></B>()</CODE>
241
242 <BR>
243 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Moves the NXT robot forward until stop() is called.</TD>
244 </TR>
245 <TR BGCOLOR="white" CLASS="TableRowColor">
246 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
247 <CODE>&nbsp;float</CODE></FONT></TD>
248 <TD><CODE><B><A HREF="../../lejos/navigation/TachoNavigator.html#getAngle()">getAngle</A></B>()</CODE>
249
250 <BR>
251 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the current angle the NXT robot is facing, relative to the +X axis direction; the +Y direction is 90 degrees.</TD>
252 </TR>
253 <TR BGCOLOR="white" CLASS="TableRowColor">
254 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
255 <CODE>&nbsp;<A HREF="../../lejos/navigation/Pilot.html" title="class in lejos.navigation">Pilot</A></CODE></FONT></TD>
256 <TD><CODE><B><A HREF="../../lejos/navigation/TachoNavigator.html#getPilot()">getPilot</A></B>()</CODE>
257
258 <BR>
259 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
260 </TR>
261 <TR BGCOLOR="white" CLASS="TableRowColor">
262 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
263 <CODE>&nbsp;float</CODE></FONT></TD>
264 <TD><CODE><B><A HREF="../../lejos/navigation/TachoNavigator.html#getX()">getX</A></B>()</CODE>
265
266 <BR>
267 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the current x coordinate of the NXT.</TD>
268 </TR>
269 <TR BGCOLOR="white" CLASS="TableRowColor">
270 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
271 <CODE>&nbsp;float</CODE></FONT></TD>
272 <TD><CODE><B><A HREF="../../lejos/navigation/TachoNavigator.html#getY()">getY</A></B>()</CODE>
273
274 <BR>
275 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the current y coordinate of the NXT.</TD>
276 </TR>
277 <TR BGCOLOR="white" CLASS="TableRowColor">
278 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
279 <CODE>&nbsp;void</CODE></FONT></TD>
280 <TD><CODE><B><A HREF="../../lejos/navigation/TachoNavigator.html#goTo(float, float)">goTo</A></B>(float&nbsp;x,
281      float&nbsp;y)</CODE>
282
283 <BR>
284 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Rotates the NXT robot towards the target point (x,y)  and moves the required distance.</TD>
285 </TR>
286 <TR BGCOLOR="white" CLASS="TableRowColor">
287 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
288 <CODE>&nbsp;void</CODE></FONT></TD>
289 <TD><CODE><B><A HREF="../../lejos/navigation/TachoNavigator.html#goTo(float, float, boolean)">goTo</A></B>(float&nbsp;x,
290      float&nbsp;y,
291      boolean&nbsp;immediateReturn)</CODE>
292
293 <BR>
294 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Rotates the NXT robot towards the target point (x,y)  and moves the required distance.</TD>
295 </TR>
296 <TR BGCOLOR="white" CLASS="TableRowColor">
297 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
298 <CODE>&nbsp;boolean</CODE></FONT></TD>
299 <TD><CODE><B><A HREF="../../lejos/navigation/TachoNavigator.html#isMoving()">isMoving</A></B>()</CODE>
300
301 <BR>
302 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;returns true iff the robot is moving under power</TD>
303 </TR>
304 <TR BGCOLOR="white" CLASS="TableRowColor">
305 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
306 <CODE>&nbsp;void</CODE></FONT></TD>
307 <TD><CODE><B><A HREF="../../lejos/navigation/TachoNavigator.html#rotate(float)">rotate</A></B>(float&nbsp;angle)</CODE>
308
309 <BR>
310 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Rotates the NXT robot a specific number of degrees in a direction (+ or -).</TD>
311 </TR>
312 <TR BGCOLOR="white" CLASS="TableRowColor">
313 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
314 <CODE>&nbsp;void</CODE></FONT></TD>
315 <TD><CODE><B><A HREF="../../lejos/navigation/TachoNavigator.html#rotate(float, boolean)">rotate</A></B>(float&nbsp;angle,
316        boolean&nbsp;immediateReturn)</CODE>
317
318 <BR>
319 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Rotates the NXT robot a specific number of degrees in a direction (+ or -).</TD>
320 </TR>
321 <TR BGCOLOR="white" CLASS="TableRowColor">
322 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
323 <CODE>&nbsp;void</CODE></FONT></TD>
324 <TD><CODE><B><A HREF="../../lejos/navigation/TachoNavigator.html#rotateLeft()">rotateLeft</A></B>()</CODE>
325
326 <BR>
327 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Rotates the NXT to the left (increasing angle) until stop() is called;</TD>
328 </TR>
329 <TR BGCOLOR="white" CLASS="TableRowColor">
330 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
331 <CODE>&nbsp;void</CODE></FONT></TD>
332 <TD><CODE><B><A HREF="../../lejos/navigation/TachoNavigator.html#rotateRight()">rotateRight</A></B>()</CODE>
333
334 <BR>
335 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Rotates the NXT to the right (decreasing angle) until stop() is called;</TD>
336 </TR>
337 <TR BGCOLOR="white" CLASS="TableRowColor">
338 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
339 <CODE>&nbsp;void</CODE></FONT></TD>
340 <TD><CODE><B><A HREF="../../lejos/navigation/TachoNavigator.html#rotateTo(float)">rotateTo</A></B>(float&nbsp;angle)</CODE>
341
342 <BR>
343 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Rotates the NXT robot to point in a specific direction.</TD>
344 </TR>
345 <TR BGCOLOR="white" CLASS="TableRowColor">
346 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
347 <CODE>&nbsp;void</CODE></FONT></TD>
348 <TD><CODE><B><A HREF="../../lejos/navigation/TachoNavigator.html#rotateTo(float, boolean)">rotateTo</A></B>(float&nbsp;angle,
349          boolean&nbsp;immediateReturn)</CODE>
350
351 <BR>
352 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Rotates the NXT robot to point in a specific direction.</TD>
353 </TR>
354 <TR BGCOLOR="white" CLASS="TableRowColor">
355 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
356 <CODE>&nbsp;void</CODE></FONT></TD>
357 <TD><CODE><B><A HREF="../../lejos/navigation/TachoNavigator.html#setPosition(float, float, float)">setPosition</A></B>(float&nbsp;x,
358             float&nbsp;y,
359             float&nbsp;directionAngle)</CODE>
360
361 <BR>
362 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sets robot location (x,y) and direction angle</TD>
363 </TR>
364 <TR BGCOLOR="white" CLASS="TableRowColor">
365 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
366 <CODE>&nbsp;void</CODE></FONT></TD>
367 <TD><CODE><B><A HREF="../../lejos/navigation/TachoNavigator.html#setSpeed(int)">setSpeed</A></B>(int&nbsp;speed)</CODE>
368
369 <BR>
370 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sets the motor speed of the robot, in degrees/second.</TD>
371 </TR>
372 <TR BGCOLOR="white" CLASS="TableRowColor">
373 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
374 <CODE>&nbsp;void</CODE></FONT></TD>
375 <TD><CODE><B><A HREF="../../lejos/navigation/TachoNavigator.html#stop()">stop</A></B>()</CODE>
376
377 <BR>
378 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Halts the NXT robot and calculates new x, y coordinates.</TD>
379 </TR>
380 <TR BGCOLOR="white" CLASS="TableRowColor">
381 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
382 <CODE>&nbsp;void</CODE></FONT></TD>
383 <TD><CODE><B><A HREF="../../lejos/navigation/TachoNavigator.html#travel(float)">travel</A></B>(float&nbsp;distance)</CODE>
384
385 <BR>
386 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Moves the NXT robot a specific distance.</TD>
387 </TR>
388 <TR BGCOLOR="white" CLASS="TableRowColor">
389 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
390 <CODE>&nbsp;void</CODE></FONT></TD>
391 <TD><CODE><B><A HREF="../../lejos/navigation/TachoNavigator.html#travel(float, boolean)">travel</A></B>(float&nbsp;distance,
392        boolean&nbsp;immediateReturn)</CODE>
393
394 <BR>
395 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Moves the NXT robot a specific distance.</TD>
396 </TR>
397 <TR BGCOLOR="white" CLASS="TableRowColor">
398 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
399 <CODE>&nbsp;void</CODE></FONT></TD>
400 <TD><CODE><B><A HREF="../../lejos/navigation/TachoNavigator.html#turn(float)">turn</A></B>(float&nbsp;radius)</CODE>
401
402 <BR>
403 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Moves the NXT robot in a circular path with a specified radius.</TD>
404 </TR>
405 <TR BGCOLOR="white" CLASS="TableRowColor">
406 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
407 <CODE>&nbsp;void</CODE></FONT></TD>
408 <TD><CODE><B><A HREF="../../lejos/navigation/TachoNavigator.html#turn(float, int)">turn</A></B>(float&nbsp;radius,
409      int&nbsp;angle)</CODE>
410
411 <BR>
412 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Moves the NXT robot in a circular path through a specific angle; If waitForCompletion is true, returns when angle is reached.</TD>
413 </TR>
414 <TR BGCOLOR="white" CLASS="TableRowColor">
415 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
416 <CODE>&nbsp;void</CODE></FONT></TD>
417 <TD><CODE><B><A HREF="../../lejos/navigation/TachoNavigator.html#turn(float, int, boolean)">turn</A></B>(float&nbsp;radius,
418      int&nbsp;angle,
419      boolean&nbsp;immediateReturn)</CODE>
420
421 <BR>
422 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Moves the NXT robot in a circular path through a specific angle; If waitForCompletion is true, returns when angle is reached.</TD>
423 </TR>
424 <TR BGCOLOR="white" CLASS="TableRowColor">
425 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
426 <CODE>&nbsp;void</CODE></FONT></TD>
427 <TD><CODE><B><A HREF="../../lejos/navigation/TachoNavigator.html#updatePosition()">updatePosition</A></B>()</CODE>
428
429 <BR>
430 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Updates robot location (x,y) and direction angle.</TD>
431 </TR>
432 </TABLE>
433 &nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
434 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
435 <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
436 <TH ALIGN="left"><B>Methods inherited from class java.lang.<A HREF="../../java/lang/Object.html" title="class in java.lang">Object</A></B></TH>
437 </TR>
438 <TR BGCOLOR="white" CLASS="TableRowColor">
439 <TD><CODE><A HREF="../../java/lang/Object.html#equals(java.lang.Object)">equals</A>, <A HREF="../../java/lang/Object.html#getClass()">getClass</A>, <A HREF="../../java/lang/Object.html#hashCode()">hashCode</A>, <A HREF="../../java/lang/Object.html#notify()">notify</A>, <A HREF="../../java/lang/Object.html#notifyAll()">notifyAll</A>, <A HREF="../../java/lang/Object.html#toString()">toString</A>, <A HREF="../../java/lang/Object.html#wait()">wait</A>, <A HREF="../../java/lang/Object.html#wait(long)">wait</A></CODE></TD>
440 </TR>
441 </TABLE>
442 &nbsp;
443 <P>
444
445 <!-- ============ FIELD DETAIL =========== -->
446
447 <A NAME="field_detail"><!-- --></A>
448 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
449 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
450 <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
451 <B>Field Detail</B></FONT></TH>
452 </TR>
453 </TABLE>
454
455 <A NAME="_heading"><!-- --></A><H3>
456 _heading</H3>
457 <PRE>
458 protected float <B>_heading</B></PRE>
459 <DL>
460 <DL>
461 </DL>
462 </DL>
463 <HR>
464
465 <A NAME="_left0"><!-- --></A><H3>
466 _left0</H3>
467 <PRE>
468 protected int <B>_left0</B></PRE>
469 <DL>
470 <DL>
471 </DL>
472 </DL>
473 <HR>
474
475 <A NAME="_right0"><!-- --></A><H3>
476 _right0</H3>
477 <PRE>
478 protected int <B>_right0</B></PRE>
479 <DL>
480 <DL>
481 </DL>
482 </DL>
483 <HR>
484
485 <A NAME="_pilot"><!-- --></A><H3>
486 _pilot</H3>
487 <PRE>
488 protected <A HREF="../../lejos/navigation/Pilot.html" title="class in lejos.navigation">Pilot</A> <B>_pilot</B></PRE>
489 <DL>
490 <DL>
491 </DL>
492 </DL>
493
494 <!-- ========= CONSTRUCTOR DETAIL ======== -->
495
496 <A NAME="constructor_detail"><!-- --></A>
497 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
498 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
499 <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
500 <B>Constructor Detail</B></FONT></TH>
501 </TR>
502 </TABLE>
503
504 <A NAME="TachoNavigator(float, float, lejos.nxt.Motor, lejos.nxt.Motor, boolean)"><!-- --></A><H3>
505 TachoNavigator</H3>
506 <PRE>
507 public <B>TachoNavigator</B>(float&nbsp;wheelDiameter,
508                       float&nbsp;trackWidth,
509                       <A HREF="../../lejos/nxt/Motor.html" title="class in lejos.nxt">Motor</A>&nbsp;leftMotor,
510                       <A HREF="../../lejos/nxt/Motor.html" title="class in lejos.nxt">Motor</A>&nbsp;rightMotor,
511                       boolean&nbsp;reverse)</PRE>
512 <DL>
513 <DD>Allocates a Navigator object and initializes it with the proper motors.
514  The x and y values and the direction angle are all initialized to 0, so if the first move is forward() the robot will run along
515  the x axis. <BR>
516 <P>
517 <DL>
518 <DT><B>Parameters:</B><DD><CODE>wheelDiameter</CODE> - The diameter of the wheel, usually printed right on the
519  wheel, in centimeters (e.g. 49.6 mm = 4.96 cm = 1.95 in)<DD><CODE>trackWidth</CODE> - The distance from the center of the left tire to the center
520  of the right tire, in units of your choice<DD><CODE>rightMotor</CODE> - The motor used to drive the right wheel e.g. Motor.C.<DD><CODE>leftMotor</CODE> - The motor used to drive the left wheel e.g. Motor.A.<DD><CODE>reverse</CODE> - If motor.forward() dives the robot backwars, set this parameter true.</DL>
521 </DL>
522 <HR>
523
524 <A NAME="TachoNavigator(float, float, lejos.nxt.Motor, lejos.nxt.Motor)"><!-- --></A><H3>
525 TachoNavigator</H3>
526 <PRE>
527 public <B>TachoNavigator</B>(float&nbsp;wheelDiameter,
528                       float&nbsp;trackWidth,
529                       <A HREF="../../lejos/nxt/Motor.html" title="class in lejos.nxt">Motor</A>&nbsp;leftMotor,
530                       <A HREF="../../lejos/nxt/Motor.html" title="class in lejos.nxt">Motor</A>&nbsp;rightMotor)</PRE>
531 <DL>
532 </DL>
533 <HR>
534
535 <A NAME="TachoNavigator(lejos.navigation.Pilot)"><!-- --></A><H3>
536 TachoNavigator</H3>
537 <PRE>
538 public <B>TachoNavigator</B>(<A HREF="../../lejos/navigation/Pilot.html" title="class in lejos.navigation">Pilot</A>&nbsp;pilot)</PRE>
539 <DL>
540 </DL>
541 <HR>
542
543 <A NAME="TachoNavigator(float, float)"><!-- --></A><H3>
544 TachoNavigator</H3>
545 <PRE>
546 public <B>TachoNavigator</B>(float&nbsp;wheelDiameter,
547                       float&nbsp;driveLength)</PRE>
548 <DL>
549 <DD>Overloaded TachoNavigator constructor that assumes the following:<BR>
550  Left motor = Motor.A   Right motor = Motor.C <BR>
551 <P>
552 <DL>
553 <DT><B>Parameters:</B><DD><CODE>wheelDiameter</CODE> - The diameter of the wheel, usually printed right on the
554  wheel, in centimeters (e.g. 49.6 mm = 4.96 cm)<DD><CODE>driveLength</CODE> - The distance from the center of the left tire to the center
555  of the right tire,</DL>
556 </DL>
557
558 <!-- ============ METHOD DETAIL ========== -->
559
560 <A NAME="method_detail"><!-- --></A>
561 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
562 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
563 <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
564 <B>Method Detail</B></FONT></TH>
565 </TR>
566 </TABLE>
567
568 <A NAME="getPilot()"><!-- --></A><H3>
569 getPilot</H3>
570 <PRE>
571 public <A HREF="../../lejos/navigation/Pilot.html" title="class in lejos.navigation">Pilot</A> <B>getPilot</B>()</PRE>
572 <DL>
573 <DD><DL>
574 </DL>
575 </DD>
576 <DD><DL>
577 </DL>
578 </DD>
579 </DL>
580 <HR>
581
582 <A NAME="getX()"><!-- --></A><H3>
583 getX</H3>
584 <PRE>
585 public float <B>getX</B>()</PRE>
586 <DL>
587 <DD>Returns the current x coordinate of the NXT.
588 <P>
589 <DD><DL>
590 <DT><B>Specified by:</B><DD><CODE><A HREF="../../lejos/navigation/Navigator.html#getX()">getX</A></CODE> in interface <CODE><A HREF="../../lejos/navigation/Navigator.html" title="interface in lejos.navigation">Navigator</A></CODE></DL>
591 </DD>
592 <DD><DL>
593
594 <DT><B>Returns:</B><DD>float Present x coordinate.</DL>
595 </DD>
596 </DL>
597 <HR>
598
599 <A NAME="getY()"><!-- --></A><H3>
600 getY</H3>
601 <PRE>
602 public float <B>getY</B>()</PRE>
603 <DL>
604 <DD>Returns the current y coordinate of the NXT.
605  Note: At present it will only give an updated reading when the NXT is stopped.
606 <P>
607 <DD><DL>
608 <DT><B>Specified by:</B><DD><CODE><A HREF="../../lejos/navigation/Navigator.html#getY()">getY</A></CODE> in interface <CODE><A HREF="../../lejos/navigation/Navigator.html" title="interface in lejos.navigation">Navigator</A></CODE></DL>
609 </DD>
610 <DD><DL>
611
612 <DT><B>Returns:</B><DD>float Present y coordinate.</DL>
613 </DD>
614 </DL>
615 <HR>
616
617 <A NAME="getAngle()"><!-- --></A><H3>
618 getAngle</H3>
619 <PRE>
620 public float <B>getAngle</B>()</PRE>
621 <DL>
622 <DD>Returns the current angle the NXT robot is facing, relative to the +X axis direction; the +Y direction is 90 degrees.
623  Note: At present it will only give an updated reading when the NXT is stopped.
624 <P>
625 <DD><DL>
626 <DT><B>Specified by:</B><DD><CODE><A HREF="../../lejos/navigation/Navigator.html#getAngle()">getAngle</A></CODE> in interface <CODE><A HREF="../../lejos/navigation/Navigator.html" title="interface in lejos.navigation">Navigator</A></CODE></DL>
627 </DD>
628 <DD><DL>
629
630 <DT><B>Returns:</B><DD>float Angle in degrees.</DL>
631 </DD>
632 </DL>
633 <HR>
634
635 <A NAME="setPosition(float, float, float)"><!-- --></A><H3>
636 setPosition</H3>
637 <PRE>
638 public void <B>setPosition</B>(float&nbsp;x,
639                         float&nbsp;y,
640                         float&nbsp;directionAngle)</PRE>
641 <DL>
642 <DD>sets robot location (x,y) and direction angle
643 <P>
644 <DD><DL>
645 <DT><B>Specified by:</B><DD><CODE><A HREF="../../lejos/navigation/Navigator.html#setPosition(float, float, float)">setPosition</A></CODE> in interface <CODE><A HREF="../../lejos/navigation/Navigator.html" title="interface in lejos.navigation">Navigator</A></CODE></DL>
646 </DD>
647 <DD><DL>
648 <DT><B>Parameters:</B><DD><CODE>x</CODE> - the x coordinate of the robot<DD><CODE>y</CODE> - the y coordinate of the robot<DD><CODE>directionAngle</CODE> - the angle the robot is heading, measured from the x axis.  90 degrees is the +Y direction</DL>
649 </DD>
650 </DL>
651 <HR>
652
653 <A NAME="setSpeed(int)"><!-- --></A><H3>
654 setSpeed</H3>
655 <PRE>
656 public void <B>setSpeed</B>(int&nbsp;speed)</PRE>
657 <DL>
658 <DD>sets the motor speed of the robot, in degrees/second.
659 <P>
660 <DD><DL>
661 <DT><B>Specified by:</B><DD><CODE><A HREF="../../lejos/navigation/Navigator.html#setSpeed(int)">setSpeed</A></CODE> in interface <CODE><A HREF="../../lejos/navigation/Navigator.html" title="interface in lejos.navigation">Navigator</A></CODE></DL>
662 </DD>
663 <DD><DL>
664 </DL>
665 </DD>
666 </DL>
667 <HR>
668
669 <A NAME="forward()"><!-- --></A><H3>
670 forward</H3>
671 <PRE>
672 public void <B>forward</B>()</PRE>
673 <DL>
674 <DD>Moves the NXT robot forward until stop() is called.
675 <P>
676 <DD><DL>
677 <DT><B>Specified by:</B><DD><CODE><A HREF="../../lejos/navigation/Navigator.html#forward()">forward</A></CODE> in interface <CODE><A HREF="../../lejos/navigation/Navigator.html" title="interface in lejos.navigation">Navigator</A></CODE></DL>
678 </DD>
679 <DD><DL>
680 <DT><B>See Also:</B><DD><A HREF="../../lejos/navigation/Navigator.html#stop()"><CODE>Navigator.stop().</CODE></A></DL>
681 </DD>
682 </DL>
683 <HR>
684
685 <A NAME="backward()"><!-- --></A><H3>
686 backward</H3>
687 <PRE>
688 public void <B>backward</B>()</PRE>
689 <DL>
690 <DD>Moves the NXT robot backward until stop() is called.
691 <P>
692 <DD><DL>
693 <DT><B>Specified by:</B><DD><CODE><A HREF="../../lejos/navigation/Navigator.html#backward()">backward</A></CODE> in interface <CODE><A HREF="../../lejos/navigation/Navigator.html" title="interface in lejos.navigation">Navigator</A></CODE></DL>
694 </DD>
695 <DD><DL>
696 <DT><B>See Also:</B><DD><A HREF="../../lejos/navigation/Navigator.html#stop()"><CODE>Navigator.stop().</CODE></A></DL>
697 </DD>
698 </DL>
699 <HR>
700
701 <A NAME="stop()"><!-- --></A><H3>
702 stop</H3>
703 <PRE>
704 public void <B>stop</B>()</PRE>
705 <DL>
706 <DD>Halts the NXT robot and calculates new x, y coordinates.
707 <P>
708 <DD><DL>
709 <DT><B>Specified by:</B><DD><CODE><A HREF="../../lejos/navigation/Navigator.html#stop()">stop</A></CODE> in interface <CODE><A HREF="../../lejos/navigation/Navigator.html" title="interface in lejos.navigation">Navigator</A></CODE></DL>
710 </DD>
711 <DD><DL>
712 <DT><B>See Also:</B><DD><A HREF="../../lejos/navigation/Navigator.html#forward()"><CODE>Navigator.forward().</CODE></A></DL>
713 </DD>
714 </DL>
715 <HR>
716
717 <A NAME="isMoving()"><!-- --></A><H3>
718 isMoving</H3>
719 <PRE>
720 public boolean <B>isMoving</B>()</PRE>
721 <DL>
722 <DD>returns true iff the robot is moving under power
723 <P>
724 <DD><DL>
725 <DT><B>Specified by:</B><DD><CODE><A HREF="../../lejos/navigation/Navigator.html#isMoving()">isMoving</A></CODE> in interface <CODE><A HREF="../../lejos/navigation/Navigator.html" title="interface in lejos.navigation">Navigator</A></CODE></DL>
726 </DD>
727 <DD><DL>
728 </DL>
729 </DD>
730 </DL>
731 <HR>
732
733 <A NAME="travel(float)"><!-- --></A><H3>
734 travel</H3>
735 <PRE>
736 public void <B>travel</B>(float&nbsp;distance)</PRE>
737 <DL>
738 <DD>Moves the NXT robot a specific distance. A positive value moves it forwards and
739  a negative value moves it backwards. 
740  The robot position is updated atomatically when the method returns.
741 <P>
742 <DD><DL>
743 <DT><B>Specified by:</B><DD><CODE><A HREF="../../lejos/navigation/Navigator.html#travel(float)">travel</A></CODE> in interface <CODE><A HREF="../../lejos/navigation/Navigator.html" title="interface in lejos.navigation">Navigator</A></CODE></DL>
744 </DD>
745 <DD><DL>
746 <DT><B>Parameters:</B><DD><CODE>distance</CODE> - The positive or negative distance to move the robot, same units as _wheelDiameter</DL>
747 </DD>
748 </DL>
749 <HR>
750
751 <A NAME="travel(float, boolean)"><!-- --></A><H3>
752 travel</H3>
753 <PRE>
754 public void <B>travel</B>(float&nbsp;distance,
755                    boolean&nbsp;immediateReturn)</PRE>
756 <DL>
757 <DD>Moves the NXT robot a specific distance. A positive value moves it forwards and
758  a negative value moves it backwards. 
759   If immediateReturnis true, method returns immidiately and your code MUST call updatePostion()
760  when the robot has stopped.  Otherwise, the robot position is lost.
761 <P>
762 <DD><DL>
763 <DT><B>Specified by:</B><DD><CODE><A HREF="../../lejos/navigation/Navigator.html#travel(float, boolean)">travel</A></CODE> in interface <CODE><A HREF="../../lejos/navigation/Navigator.html" title="interface in lejos.navigation">Navigator</A></CODE></DL>
764 </DD>
765 <DD><DL>
766 <DT><B>Parameters:</B><DD><CODE>distance</CODE> - The positive or negative distance to move the robot, same units as _wheelDiameter<DD><CODE>immediateReturn</CODE> - iff true, the method returns immediately, in which case the programmer <br>
767   is responsible for calling updatePosition() before the robot moves again.</DL>
768 </DD>
769 </DL>
770 <HR>
771
772 <A NAME="rotateLeft()"><!-- --></A><H3>
773 rotateLeft</H3>
774 <PRE>
775 public void <B>rotateLeft</B>()</PRE>
776 <DL>
777 <DD>Rotates the NXT to the left (increasing angle) until stop() is called;
778 <P>
779 <DD><DL>
780 <DT><B>Specified by:</B><DD><CODE><A HREF="../../lejos/navigation/Navigator.html#rotateLeft()">rotateLeft</A></CODE> in interface <CODE><A HREF="../../lejos/navigation/Navigator.html" title="interface in lejos.navigation">Navigator</A></CODE></DL>
781 </DD>
782 <DD><DL>
783 </DL>
784 </DD>
785 </DL>
786 <HR>
787
788 <A NAME="rotateRight()"><!-- --></A><H3>
789 rotateRight</H3>
790 <PRE>
791 public void <B>rotateRight</B>()</PRE>
792 <DL>
793 <DD>Rotates the NXT to the right (decreasing angle) until stop() is called;
794 <P>
795 <DD><DL>
796 <DT><B>Specified by:</B><DD><CODE><A HREF="../../lejos/navigation/Navigator.html#rotateRight()">rotateRight</A></CODE> in interface <CODE><A HREF="../../lejos/navigation/Navigator.html" title="interface in lejos.navigation">Navigator</A></CODE></DL>
797 </DD>
798 <DD><DL>
799 </DL>
800 </DD>
801 </DL>
802 <HR>
803
804 <A NAME="rotate(float)"><!-- --></A><H3>
805 rotate</H3>
806 <PRE>
807 public void <B>rotate</B>(float&nbsp;angle)</PRE>
808 <DL>
809 <DD>Rotates the NXT robot a specific number of degrees in a direction (+ or -).
810 <P>
811 <DD><DL>
812 <DT><B>Specified by:</B><DD><CODE><A HREF="../../lejos/navigation/Navigator.html#rotate(float)">rotate</A></CODE> in interface <CODE><A HREF="../../lejos/navigation/Navigator.html" title="interface in lejos.navigation">Navigator</A></CODE></DL>
813 </DD>
814 <DD><DL>
815 <DT><B>Parameters:</B><DD><CODE>angle</CODE> - Angle to rotate in degrees. A positive value rotates left, a negative value right.</DL>
816 </DD>
817 </DL>
818 <HR>
819
820 <A NAME="rotate(float, boolean)"><!-- --></A><H3>
821 rotate</H3>
822 <PRE>
823 public void <B>rotate</B>(float&nbsp;angle,
824                    boolean&nbsp;immediateReturn)</PRE>
825 <DL>
826 <DD>Rotates the NXT robot a specific number of degrees in a direction (+ or -).
827   If immediateReturn is true, method returns immidiately and your code MUST call updatePostion()
828  when the robot has stopped.  Otherwise, the robot position is lost.
829 <P>
830 <DD><DL>
831 <DT><B>Specified by:</B><DD><CODE><A HREF="../../lejos/navigation/Navigator.html#rotate(float, boolean)">rotate</A></CODE> in interface <CODE><A HREF="../../lejos/navigation/Navigator.html" title="interface in lejos.navigation">Navigator</A></CODE></DL>
832 </DD>
833 <DD><DL>
834 <DT><B>Parameters:</B><DD><CODE>angle</CODE> - Angle to rotate in degrees. A positive value rotates left, a negative value right.<DD><CODE>immediateReturn</CODE> - iff true, the method returns immediately, in which case the programmer <br>
835   is responsible for calling updatePosition() before the robot moves again.</DL>
836 </DD>
837 </DL>
838 <HR>
839
840 <A NAME="rotateTo(float)"><!-- --></A><H3>
841 rotateTo</H3>
842 <PRE>
843 public void <B>rotateTo</B>(float&nbsp;angle)</PRE>
844 <DL>
845 <DD>Rotates the NXT robot to point in a specific direction. It will take the shortest
846  path necessary to point to the desired angle.
847 <P>
848 <DD><DL>
849 <DT><B>Specified by:</B><DD><CODE><A HREF="../../lejos/navigation/Navigator.html#rotateTo(float)">rotateTo</A></CODE> in interface <CODE><A HREF="../../lejos/navigation/Navigator.html" title="interface in lejos.navigation">Navigator</A></CODE></DL>
850 </DD>
851 <DD><DL>
852 <DT><B>Parameters:</B><DD><CODE>angle</CODE> - The angle to rotate to, in degrees.</DL>
853 </DD>
854 </DL>
855 <HR>
856
857 <A NAME="rotateTo(float, boolean)"><!-- --></A><H3>
858 rotateTo</H3>
859 <PRE>
860 public void <B>rotateTo</B>(float&nbsp;angle,
861                      boolean&nbsp;immediateReturn)</PRE>
862 <DL>
863 <DD>Rotates the NXT robot to point in a specific direction. It will take the shortest
864  path necessary to point to the desired angle. 
865  If immediateReturnis true, method returns immidiately and your code MUST call updatePostion()
866  when the robot has stopped.  Otherwise, the robot position is lost.
867 <P>
868 <DD><DL>
869 <DT><B>Specified by:</B><DD><CODE><A HREF="../../lejos/navigation/Navigator.html#rotateTo(float, boolean)">rotateTo</A></CODE> in interface <CODE><A HREF="../../lejos/navigation/Navigator.html" title="interface in lejos.navigation">Navigator</A></CODE></DL>
870 </DD>
871 <DD><DL>
872 <DT><B>Parameters:</B><DD><CODE>angle</CODE> - The angle to rotate to, in degrees.<DD><CODE>immediateReturn</CODE> - iff true,  method returns immediately and the programmer is responsible for calling 
873  updatePosition() before the robot moves again.</DL>
874 </DD>
875 </DL>
876 <HR>
877
878 <A NAME="goTo(float, float)"><!-- --></A><H3>
879 goTo</H3>
880 <PRE>
881 public void <B>goTo</B>(float&nbsp;x,
882                  float&nbsp;y)</PRE>
883 <DL>
884 <DD>Rotates the NXT robot towards the target point (x,y)  and moves the required distance.
885  Method returns when target point is reached, and the robot position is updated;
886 <P>
887 <DD><DL>
888 <DT><B>Specified by:</B><DD><CODE><A HREF="../../lejos/navigation/Navigator.html#goTo(float, float)">goTo</A></CODE> in interface <CODE><A HREF="../../lejos/navigation/Navigator.html" title="interface in lejos.navigation">Navigator</A></CODE></DL>
889 </DD>
890 <DD><DL>
891 <DT><B>Parameters:</B><DD><CODE>x</CODE> - The x coordinate to move to.<DD><CODE>y</CODE> - The y coordinate to move to.</DL>
892 </DD>
893 </DL>
894 <HR>
895
896 <A NAME="goTo(float, float, boolean)"><!-- --></A><H3>
897 goTo</H3>
898 <PRE>
899 public void <B>goTo</B>(float&nbsp;x,
900                  float&nbsp;y,
901                  boolean&nbsp;immediateReturn)</PRE>
902 <DL>
903 <DD>Rotates the NXT robot towards the target point (x,y)  and moves the required distance.
904  Method returns when target point is reached, and the robot position is updated;
905 <P>
906 <DD><DL>
907 <DT><B>Specified by:</B><DD><CODE><A HREF="../../lejos/navigation/Navigator.html#goTo(float, float, boolean)">goTo</A></CODE> in interface <CODE><A HREF="../../lejos/navigation/Navigator.html" title="interface in lejos.navigation">Navigator</A></CODE></DL>
908 </DD>
909 <DD><DL>
910 <DT><B>Parameters:</B><DD><CODE>x</CODE> - The x coordinate to move to.<DD><CODE>y</CODE> - The y coordinate to move to.<DD><CODE>immediateReturn</CODE> - iff true,  method returns immediately</DL>
911 </DD>
912 </DL>
913 <HR>
914
915 <A NAME="distanceTo(float, float)"><!-- --></A><H3>
916 distanceTo</H3>
917 <PRE>
918 public float <B>distanceTo</B>(float&nbsp;x,
919                         float&nbsp;y)</PRE>
920 <DL>
921 <DD>distance from robot to the point with coordinates (x,y) .
922 <P>
923 <DD><DL>
924 <DT><B>Specified by:</B><DD><CODE><A HREF="../../lejos/navigation/Navigator.html#distanceTo(float, float)">distanceTo</A></CODE> in interface <CODE><A HREF="../../lejos/navigation/Navigator.html" title="interface in lejos.navigation">Navigator</A></CODE></DL>
925 </DD>
926 <DD><DL>
927 <DT><B>Parameters:</B><DD><CODE>x</CODE> - coordinate of the point<DD><CODE>y</CODE> - coordinate of the point
928 <DT><B>Returns:</B><DD>the distance from the robot current location to the point</DL>
929 </DD>
930 </DL>
931 <HR>
932
933 <A NAME="angleTo(float, float)"><!-- --></A><H3>
934 angleTo</H3>
935 <PRE>
936 public float <B>angleTo</B>(float&nbsp;x,
937                      float&nbsp;y)</PRE>
938 <DL>
939 <DD>returns the direction angle (degrees) to point with coordinates (x,y)
940 <P>
941 <DD><DL>
942 <DT><B>Specified by:</B><DD><CODE><A HREF="../../lejos/navigation/Navigator.html#angleTo(float, float)">angleTo</A></CODE> in interface <CODE><A HREF="../../lejos/navigation/Navigator.html" title="interface in lejos.navigation">Navigator</A></CODE></DL>
943 </DD>
944 <DD><DL>
945 <DT><B>Parameters:</B><DD><CODE>x</CODE> - coordinate of the point<DD><CODE>y</CODE> - coordinate of the point
946 <DT><B>Returns:</B><DD>the direction angle to the point (x,y) from the NXT.  Rotate to this angle to head toward it.</DL>
947 </DD>
948 </DL>
949 <HR>
950
951 <A NAME="updatePosition()"><!-- --></A><H3>
952 updatePosition</H3>
953 <PRE>
954 public void <B>updatePosition</B>()</PRE>
955 <DL>
956 <DD>Updates robot location (x,y) and direction angle. Called by stop, and movement commands that terminate when complete.
957  If you use a movement command that returns immediately, you MUST call this method when the movement is complete. 
958  It may also be called while movement is on progress.
959 <P>
960 <DD><DL>
961 <DT><B>Specified by:</B><DD><CODE><A HREF="../../lejos/navigation/Navigator.html#updatePosition()">updatePosition</A></CODE> in interface <CODE><A HREF="../../lejos/navigation/Navigator.html" title="interface in lejos.navigation">Navigator</A></CODE></DL>
962 </DD>
963 <DD><DL>
964 </DL>
965 </DD>
966 </DL>
967 <HR>
968
969 <A NAME="turn(float)"><!-- --></A><H3>
970 turn</H3>
971 <PRE>
972 public void <B>turn</B>(float&nbsp;radius)</PRE>
973 <DL>
974 <DD>Moves the NXT robot in a circular path with a specified radius. <br>
975  The center of the turning circle is on the right side of the robot iff parameter radius is negative;  <br>
976  Postcondition:  motor speed is NOT restored to previous value;
977 <P>
978 <DD><DL>
979 </DL>
980 </DD>
981 <DD><DL>
982 <DT><B>Parameters:</B><DD><CODE>radius</CODE> - is the radius of the circular path. If positive, the left wheel is on the inside of the turn.  If negative, the left wheel is on the outside.</DL>
983 </DD>
984 </DL>
985 <HR>
986
987 <A NAME="turn(float, int)"><!-- --></A><H3>
988 turn</H3>
989 <PRE>
990 public void <B>turn</B>(float&nbsp;radius,
991                  int&nbsp;angle)</PRE>
992 <DL>
993 <DD>Moves the NXT robot in a circular path through a specific angle; If waitForCompletion is true, returns when angle is reached. <br>
994  The center of the turning circle is on the right side of the robot iff parameter radius is negative.
995   Robot will stop when total rotation equals angle. If angle is negative, robot will move travel backwards.
996 <P>
997 <DD><DL>
998 </DL>
999 </DD>
1000 <DD><DL>
1001 <DT><B>Parameters:</B><DD><CODE>radius</CODE> - radius of the turning circle<DD><CODE>angle</CODE> - the angle by which the robot heading changes, + or -</DL>
1002 </DD>
1003 </DL>
1004 <HR>
1005
1006 <A NAME="turn(float, int, boolean)"><!-- --></A><H3>
1007 turn</H3>
1008 <PRE>
1009 public void <B>turn</B>(float&nbsp;radius,
1010                  int&nbsp;angle,
1011                  boolean&nbsp;immediateReturn)</PRE>
1012 <DL>
1013 <DD>Moves the NXT robot in a circular path through a specific angle; If waitForCompletion is true, returns when angle is reached. <br>
1014  The center of the turning circle is on the right side of the robot iff parameter radius is negative.
1015  Robot will stop when total rotation equals angle. If angle is negative, robot will travel backwards.
1016 <P>
1017 <DD><DL>
1018 </DL>
1019 </DD>
1020 <DD><DL>
1021 <DT><B>Parameters:</B><DD><CODE>radius</CODE> - see turn(turnRage, angle)<DD><CODE>immediateReturn</CODE> - iff true, the method returns immediately, in which case the programmer <br>
1022  is responsible for calling updatePosition() before the robot moves again.</DL>
1023 </DD>
1024 </DL>
1025 <!-- ========= END OF CLASS DATA ========= -->
1026 <HR>
1027
1028
1029 <!-- ======= START OF BOTTOM NAVBAR ====== -->
1030 <A NAME="navbar_bottom"><!-- --></A>
1031 <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
1032 <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
1033 <TR>
1034 <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
1035 <A NAME="navbar_bottom_firstrow"><!-- --></A>
1036 <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
1037   <TR ALIGN="center" VALIGN="top">
1038   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
1039   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
1040   <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
1041   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
1042   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
1043   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
1044   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
1045   </TR>
1046 </TABLE>
1047 </TD>
1048 <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
1049 </EM>
1050 </TD>
1051 </TR>
1052
1053 <TR>
1054 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
1055 &nbsp;<A HREF="../../lejos/navigation/Pilot.html" title="class in lejos.navigation"><B>PREV CLASS</B></A>&nbsp;
1056 &nbsp;NEXT CLASS</FONT></TD>
1057 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
1058   <A HREF="../../index.html?lejos/navigation/TachoNavigator.html" target="_top"><B>FRAMES</B></A>  &nbsp;
1059 &nbsp;<A HREF="TachoNavigator.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
1060 &nbsp;<SCRIPT type="text/javascript">
1061   <!--
1062   if(window==top) {
1063     document.writeln('<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>');
1064   }
1065   //-->
1066 </SCRIPT>
1067 <NOSCRIPT>
1068   <A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>
1069 </NOSCRIPT>
1070
1071
1072 </FONT></TD>
1073 </TR>
1074 <TR>
1075 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
1076   SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;<A HREF="#field_summary">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
1077 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
1078 DETAIL:&nbsp;<A HREF="#field_detail">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
1079 </TR>
1080 </TABLE>
1081 <A NAME="skip-navbar_bottom"></A>
1082 <!-- ======== END OF BOTTOM NAVBAR ======= -->
1083
1084 <HR>
1085
1086 </BODY>
1087 </HTML>