1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
5 <!-- Generated by javadoc (build 1.5.0_09) on Sun Sep 02 23:07:09 BST 2007 -->
7 CompassNavigator (leJOS NXT API documentation)
10 <META NAME="keywords" CONTENT="lejos.navigation.CompassNavigator class">
12 <LINK REL ="stylesheet" TYPE="text/css" HREF="../../stylesheet.css" TITLE="Style">
14 <SCRIPT type="text/javascript">
15 function windowTitle()
17 parent.document.title="CompassNavigator (leJOS NXT API documentation)";
25 <BODY BGCOLOR="white" onload="windowTitle();">
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="">
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> </TD>
38 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
39 <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
40 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
41 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
42 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
43 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
47 <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
53 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
54 PREV CLASS
55 <A HREF="../../lejos/navigation/CompassPilot.html" title="class in lejos.navigation"><B>NEXT CLASS</B></A></FONT></TD>
56 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
57 <A HREF="../../index.html?lejos/navigation/CompassNavigator.html" target="_top"><B>FRAMES</B></A>
58 <A HREF="CompassNavigator.html" target="_top"><B>NO FRAMES</B></A>
59 <SCRIPT type="text/javascript">
62 document.writeln('<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>');
67 <A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>
74 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
75 SUMMARY: NESTED | <A HREF="#fields_inherited_from_class_lejos.navigation.TachoNavigator">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
76 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
77 DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
80 <A NAME="skip-navbar_top"></A>
81 <!-- ========= END OF TOP NAVBAR ========= -->
84 <!-- ======== START OF CLASS DATA ======== -->
87 lejos.navigation</FONT>
89 Class CompassNavigator</H2>
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 "><A HREF="../../lejos/navigation/TachoNavigator.html" title="class in lejos.navigation">lejos.navigation.TachoNavigator</A>
93 <IMG SRC="../../resources/inherit.gif" ALT="extended by "><B>lejos.navigation.CompassNavigator</B>
96 <DT><B>All Implemented Interfaces:</B> <DD><A HREF="../../lejos/navigation/Navigator.html" title="interface in lejos.navigation">Navigator</A></DD>
100 <DT><PRE>public class <B>CompassNavigator</B><DT>extends <A HREF="../../lejos/navigation/TachoNavigator.html" title="class in lejos.navigation">TachoNavigator</A></DL>
104 The CompassPilot class, like its superclass, can keep track of the robot position and the direction angle it faces; It uses a compassPpilot bject to control NXT robot movements.<br>
105 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.
106 However, some commands optionally return immediately, to permit sensor monitoring in the main thread. It is then the programmers responsibility to
107 call updateXY() when the robot motion is completed. All angles are in degrees, distances in the units used to specify robot dimensions.
108 As with pilot, the robot must be have two independently controlled drive wheels.
109 Uses the Compass Sensor to determine the robot heading.
116 <!-- =========== FIELD SUMMARY =========== -->
118 <A NAME="field_summary"><!-- --></A>
119 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
120 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
121 <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
122 <B>Field Summary</B></FONT></TH>
125 <A NAME="fields_inherited_from_class_lejos.navigation.TachoNavigator"><!-- --></A>
126 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
127 <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
128 <TH ALIGN="left"><B>Fields inherited from class lejos.navigation.<A HREF="../../lejos/navigation/TachoNavigator.html" title="class in lejos.navigation">TachoNavigator</A></B></TH>
130 <TR BGCOLOR="white" CLASS="TableRowColor">
131 <TD><CODE><A HREF="../../lejos/navigation/TachoNavigator.html#_heading">_heading</A>, <A HREF="../../lejos/navigation/TachoNavigator.html#_pilot">_pilot</A></CODE></TD>
135 <!-- ======== CONSTRUCTOR SUMMARY ======== -->
137 <A NAME="constructor_summary"><!-- --></A>
138 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
139 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
140 <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
141 <B>Constructor Summary</B></FONT></TH>
143 <TR BGCOLOR="white" CLASS="TableRowColor">
144 <TD><CODE><B><A HREF="../../lejos/navigation/CompassNavigator.html#CompassNavigator(lejos.navigation.CompassPilot)">CompassNavigator</A></B>(<A HREF="../../lejos/navigation/CompassPilot.html" title="class in lejos.navigation">CompassPilot</A> compassPilot)</CODE>
147 To use this constructor, you must first create a compass pilot.</TD>
149 <TR BGCOLOR="white" CLASS="TableRowColor">
150 <TD><CODE><B><A HREF="../../lejos/navigation/CompassNavigator.html#CompassNavigator(lejos.nxt.CompassSensor, float, float, lejos.nxt.Motor, lejos.nxt.Motor, boolean)">CompassNavigator</A></B>(<A HREF="../../lejos/nxt/CompassSensor.html" title="class in lejos.nxt">CompassSensor</A> compass,
151 float wheelDiameter,
152 float trackWidth,
153 <A HREF="../../lejos/nxt/Motor.html" title="class in lejos.nxt">Motor</A> leftMotor,
154 <A HREF="../../lejos/nxt/Motor.html" title="class in lejos.nxt">Motor</A> rightMotor,
155 boolean reverse)</CODE>
158 </TD>
160 <TR BGCOLOR="white" CLASS="TableRowColor">
161 <TD><CODE><B><A HREF="../../lejos/navigation/CompassNavigator.html#CompassNavigator(lejos.nxt.SensorPort, float, float, lejos.nxt.Motor, lejos.nxt.Motor)">CompassNavigator</A></B>(<A HREF="../../lejos/nxt/SensorPort.html" title="class in lejos.nxt">SensorPort</A> compassPort,
162 float wheelDiameter,
163 float trackWidth,
164 <A HREF="../../lejos/nxt/Motor.html" title="class in lejos.nxt">Motor</A> leftMotor,
165 <A HREF="../../lejos/nxt/Motor.html" title="class in lejos.nxt">Motor</A> rightMotor)</CODE>
168 Allocates a CompassNavigator objects and its CompassPilot object and initializes it with the proper motors and dimensions.</TD>
170 <TR BGCOLOR="white" CLASS="TableRowColor">
171 <TD><CODE><B><A HREF="../../lejos/navigation/CompassNavigator.html#CompassNavigator(lejos.nxt.SensorPort, float, float, lejos.nxt.Motor, lejos.nxt.Motor, boolean)">CompassNavigator</A></B>(<A HREF="../../lejos/nxt/SensorPort.html" title="class in lejos.nxt">SensorPort</A> compassPort,
172 float wheelDiameter,
173 float trackWidth,
174 <A HREF="../../lejos/nxt/Motor.html" title="class in lejos.nxt">Motor</A> leftMotor,
175 <A HREF="../../lejos/nxt/Motor.html" title="class in lejos.nxt">Motor</A> rightMotor,
176 boolean reverse)</CODE>
179 </TD>
183 <!-- ========== METHOD SUMMARY =========== -->
185 <A NAME="method_summary"><!-- --></A>
186 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
187 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
188 <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
189 <B>Method Summary</B></FONT></TH>
191 <TR BGCOLOR="white" CLASS="TableRowColor">
192 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
193 <CODE> void</CODE></FONT></TD>
194 <TD><CODE><B><A HREF="../../lejos/navigation/CompassNavigator.html#calibrateCompass()">calibrateCompass</A></B>()</CODE>
197 Robot rotates 360 degrees while calibrating the compass sensor</TD>
199 <TR BGCOLOR="white" CLASS="TableRowColor">
200 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
201 <CODE> void</CODE></FONT></TD>
202 <TD><CODE><B><A HREF="../../lejos/navigation/CompassNavigator.html#rotate(float, boolean)">rotate</A></B>(float angle,
203 boolean immediateReturn)</CODE>
206 Rotates the NXT robot by a specified angle.</TD>
208 <TR BGCOLOR="white" CLASS="TableRowColor">
209 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
210 <CODE> void</CODE></FONT></TD>
211 <TD><CODE><B><A HREF="../../lejos/navigation/CompassNavigator.html#rotateTo(float, boolean)">rotateTo</A></B>(float angle,
212 boolean immediateReturn)</CODE>
215 Rotates the NXT robot to point in a specific direction.</TD>
217 <TR BGCOLOR="white" CLASS="TableRowColor">
218 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
219 <CODE> void</CODE></FONT></TD>
220 <TD><CODE><B><A HREF="../../lejos/navigation/CompassNavigator.html#stop()">stop</A></B>()</CODE>
223 Halts the NXT robot and calculates new x, y coordinates.</TD>
225 <TR BGCOLOR="white" CLASS="TableRowColor">
226 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
227 <CODE> void</CODE></FONT></TD>
228 <TD><CODE><B><A HREF="../../lejos/navigation/CompassNavigator.html#travel(float, boolean)">travel</A></B>(float distance,
229 boolean immediateReturn)</CODE>
232 Moves the NXT robot a specific distance.</TD>
234 <TR BGCOLOR="white" CLASS="TableRowColor">
235 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
236 <CODE> void</CODE></FONT></TD>
237 <TD><CODE><B><A HREF="../../lejos/navigation/CompassNavigator.html#updateHeading()">updateHeading</A></B>()</CODE>
240 Direction of robot facing is set equal to the current compass reading</TD>
242 <TR BGCOLOR="white" CLASS="TableRowColor">
243 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
244 <CODE> void</CODE></FONT></TD>
245 <TD><CODE><B><A HREF="../../lejos/navigation/CompassNavigator.html#updateXY()">updateXY</A></B>()</CODE>
248 Updates x,y coordinates; assumes last compass angle was constant during travel</TD>
251 <A NAME="methods_inherited_from_class_lejos.navigation.TachoNavigator"><!-- --></A>
252 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
253 <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
254 <TH ALIGN="left"><B>Methods inherited from class lejos.navigation.<A HREF="../../lejos/navigation/TachoNavigator.html" title="class in lejos.navigation">TachoNavigator</A></B></TH>
256 <TR BGCOLOR="white" CLASS="TableRowColor">
257 <TD><CODE><A HREF="../../lejos/navigation/TachoNavigator.html#angleTo(float, float)">angleTo</A>, <A HREF="../../lejos/navigation/TachoNavigator.html#backward()">backward</A>, <A HREF="../../lejos/navigation/TachoNavigator.html#distanceTo(float, float)">distanceTo</A>, <A HREF="../../lejos/navigation/TachoNavigator.html#forward()">forward</A>, <A HREF="../../lejos/navigation/TachoNavigator.html#getAngle()">getAngle</A>, <A HREF="../../lejos/navigation/TachoNavigator.html#getPilot()">getPilot</A>, <A HREF="../../lejos/navigation/TachoNavigator.html#getX()">getX</A>, <A HREF="../../lejos/navigation/TachoNavigator.html#getY()">getY</A>, <A HREF="../../lejos/navigation/TachoNavigator.html#goTo(float, float)">goTo</A>, <A HREF="../../lejos/navigation/TachoNavigator.html#goTo(float, float, boolean)">goTo</A>, <A HREF="../../lejos/navigation/TachoNavigator.html#isMoving()">isMoving</A>, <A HREF="../../lejos/navigation/TachoNavigator.html#rotate(float)">rotate</A>, <A HREF="../../lejos/navigation/TachoNavigator.html#rotateLeft()">rotateLeft</A>, <A HREF="../../lejos/navigation/TachoNavigator.html#rotateRight()">rotateRight</A>, <A HREF="../../lejos/navigation/TachoNavigator.html#rotateTo(float)">rotateTo</A>, <A HREF="../../lejos/navigation/TachoNavigator.html#setPosition(float, float, float)">setPosition</A>, <A HREF="../../lejos/navigation/TachoNavigator.html#setSpeed(int)">setSpeed</A>, <A HREF="../../lejos/navigation/TachoNavigator.html#travel(float)">travel</A>, <A HREF="../../lejos/navigation/TachoNavigator.html#turn(float)">turn</A>, <A HREF="../../lejos/navigation/TachoNavigator.html#turn(float, int)">turn</A>, <A HREF="../../lejos/navigation/TachoNavigator.html#turn(float, int, boolean)">turn</A>, <A HREF="../../lejos/navigation/TachoNavigator.html#updatePosition()">updatePosition</A></CODE></TD>
260 <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
261 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
262 <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
263 <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>
265 <TR BGCOLOR="white" CLASS="TableRowColor">
266 <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>
272 <!-- ========= CONSTRUCTOR DETAIL ======== -->
274 <A NAME="constructor_detail"><!-- --></A>
275 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
276 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
277 <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
278 <B>Constructor Detail</B></FONT></TH>
282 <A NAME="CompassNavigator(lejos.nxt.SensorPort, float, float, lejos.nxt.Motor, lejos.nxt.Motor)"><!-- --></A><H3>
283 CompassNavigator</H3>
285 public <B>CompassNavigator</B>(<A HREF="../../lejos/nxt/SensorPort.html" title="class in lejos.nxt">SensorPort</A> compassPort,
286 float wheelDiameter,
287 float trackWidth,
288 <A HREF="../../lejos/nxt/Motor.html" title="class in lejos.nxt">Motor</A> leftMotor,
289 <A HREF="../../lejos/nxt/Motor.html" title="class in lejos.nxt">Motor</A> rightMotor)</PRE>
291 <DD>Allocates a CompassNavigator objects and its CompassPilot object and initializes it with the proper motors and dimensions.
292 This is a subclass of TachoNavigator (see that API for other methods).
293 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
297 <DT><B>Parameters:</B><DD><CODE>compassPort</CODE> - the sensor port connected to the compass sensor e.g SensorPort.S1<DD><CODE>wheelDiameter</CODE> - The diameter of the wheel, usually printed right on the
298 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
299 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.</DL>
303 <A NAME="CompassNavigator(lejos.nxt.SensorPort, float, float, lejos.nxt.Motor, lejos.nxt.Motor, boolean)"><!-- --></A><H3>
304 CompassNavigator</H3>
306 public <B>CompassNavigator</B>(<A HREF="../../lejos/nxt/SensorPort.html" title="class in lejos.nxt">SensorPort</A> compassPort,
307 float wheelDiameter,
308 float trackWidth,
309 <A HREF="../../lejos/nxt/Motor.html" title="class in lejos.nxt">Motor</A> leftMotor,
310 <A HREF="../../lejos/nxt/Motor.html" title="class in lejos.nxt">Motor</A> rightMotor,
311 boolean reverse)</PRE>
316 <A NAME="CompassNavigator(lejos.nxt.CompassSensor, float, float, lejos.nxt.Motor, lejos.nxt.Motor, boolean)"><!-- --></A><H3>
317 CompassNavigator</H3>
319 public <B>CompassNavigator</B>(<A HREF="../../lejos/nxt/CompassSensor.html" title="class in lejos.nxt">CompassSensor</A> compass,
320 float wheelDiameter,
321 float trackWidth,
322 <A HREF="../../lejos/nxt/Motor.html" title="class in lejos.nxt">Motor</A> leftMotor,
323 <A HREF="../../lejos/nxt/Motor.html" title="class in lejos.nxt">Motor</A> rightMotor,
324 boolean reverse)</PRE>
329 <A NAME="CompassNavigator(lejos.navigation.CompassPilot)"><!-- --></A><H3>
330 CompassNavigator</H3>
332 public <B>CompassNavigator</B>(<A HREF="../../lejos/navigation/CompassPilot.html" title="class in lejos.navigation">CompassPilot</A> compassPilot)</PRE>
334 <DD>To use this constructor, you must first create a compass pilot.
337 <DT><B>Parameters:</B><DD><CODE>compassPilot</CODE> - </DL>
340 <!-- ============ METHOD DETAIL ========== -->
342 <A NAME="method_detail"><!-- --></A>
343 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
344 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
345 <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
346 <B>Method Detail</B></FONT></TH>
350 <A NAME="calibrateCompass()"><!-- --></A><H3>
351 calibrateCompass</H3>
353 public void <B>calibrateCompass</B>()</PRE>
355 <DD>Robot rotates 360 degrees while calibrating the compass sensor
363 <A NAME="rotateTo(float, boolean)"><!-- --></A><H3>
366 public void <B>rotateTo</B>(float angle,
367 boolean immediateReturn)</PRE>
369 <DD>Rotates the NXT robot to point in a specific direction. It will take the shortest
370 path necessary to point to the desired angle.
371 If immediateReturnis true, method returns immidiately and your code MUST call updatePostion()
372 when the robot has stopped. Otherwise, the robot position is lost.
375 <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><DT><B>Overrides:</B><DD><CODE><A HREF="../../lejos/navigation/TachoNavigator.html#rotateTo(float, boolean)">rotateTo</A></CODE> in class <CODE><A HREF="../../lejos/navigation/TachoNavigator.html" title="class in lejos.navigation">TachoNavigator</A></CODE></DL>
378 <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
379 updatePosition() before the robot moves again.</DL>
384 <A NAME="rotate(float, boolean)"><!-- --></A><H3>
387 public void <B>rotate</B>(float angle,
388 boolean immediateReturn)</PRE>
390 <DD>Rotates the NXT robot by a specified angle.
391 If immediateReturnis true, method returns immidiately and your code MUST call updatePostion()
392 when the robot has stopped. Otherwise, the robot position is lost.
395 <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><DT><B>Overrides:</B><DD><CODE><A HREF="../../lejos/navigation/TachoNavigator.html#rotate(float, boolean)">rotate</A></CODE> in class <CODE><A HREF="../../lejos/navigation/TachoNavigator.html" title="class in lejos.navigation">TachoNavigator</A></CODE></DL>
398 <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
399 updatePosition() before the robot moves again.</DL>
404 <A NAME="travel(float, boolean)"><!-- --></A><H3>
407 public void <B>travel</B>(float distance,
408 boolean immediateReturn)</PRE>
410 <DD>Moves the NXT robot a specific distance. A positive value moves it forwards and
411 a negative value moves it backwards.
412 If immediateReturnis true, method returns immidiately and your code MUST call updatePostion()
413 when the robot has stopped. Otherwise, the robot position is lost.
416 <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><DT><B>Overrides:</B><DD><CODE><A HREF="../../lejos/navigation/TachoNavigator.html#travel(float, boolean)">travel</A></CODE> in class <CODE><A HREF="../../lejos/navigation/TachoNavigator.html" title="class in lejos.navigation">TachoNavigator</A></CODE></DL>
419 <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>
420 is responsible for calling updatePosition() before the robot moves again.</DL>
425 <A NAME="stop()"><!-- --></A><H3>
428 public void <B>stop</B>()</PRE>
430 <DD>Halts the NXT robot and calculates new x, y coordinates.
433 <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><DT><B>Overrides:</B><DD><CODE><A HREF="../../lejos/navigation/TachoNavigator.html#stop()">stop</A></CODE> in class <CODE><A HREF="../../lejos/navigation/TachoNavigator.html" title="class in lejos.navigation">TachoNavigator</A></CODE></DL>
436 <DT><B>See Also:</B><DD><A HREF="../../lejos/navigation/Navigator.html#forward()"><CODE>Navigator.forward().</CODE></A></DL>
441 <A NAME="updateHeading()"><!-- --></A><H3>
444 public void <B>updateHeading</B>()</PRE>
446 <DD>Direction of robot facing is set equal to the current compass reading
454 <A NAME="updateXY()"><!-- --></A><H3>
457 public void <B>updateXY</B>()</PRE>
459 <DD>Updates x,y coordinates; assumes last compass angle was constant during travel
465 <!-- ========= END OF CLASS DATA ========= -->
469 <!-- ======= START OF BOTTOM NAVBAR ====== -->
470 <A NAME="navbar_bottom"><!-- --></A>
471 <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
472 <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
474 <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
475 <A NAME="navbar_bottom_firstrow"><!-- --></A>
476 <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
477 <TR ALIGN="center" VALIGN="top">
478 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
479 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
480 <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
481 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
482 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
483 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
484 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
488 <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
494 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
495 PREV CLASS
496 <A HREF="../../lejos/navigation/CompassPilot.html" title="class in lejos.navigation"><B>NEXT CLASS</B></A></FONT></TD>
497 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
498 <A HREF="../../index.html?lejos/navigation/CompassNavigator.html" target="_top"><B>FRAMES</B></A>
499 <A HREF="CompassNavigator.html" target="_top"><B>NO FRAMES</B></A>
500 <SCRIPT type="text/javascript">
503 document.writeln('<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>');
508 <A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>
515 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
516 SUMMARY: NESTED | <A HREF="#fields_inherited_from_class_lejos.navigation.TachoNavigator">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
517 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
518 DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
521 <A NAME="skip-navbar_bottom"></A>
522 <!-- ======== END OF BOTTOM NAVBAR ======= -->