OSDN Git Service

67252a26ab1f9144acdcaa20b3e7f10eab5d8500
[nxt-jsp/lejos_nxj.git] / nxtOSEK / lejos_nxj / docs / apidocs / lejos / navigation / CompassNavigator.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 Sun Sep 02 23:07:09 BST 2007 -->
6 <TITLE>
7 CompassNavigator (leJOS NXT API documentation)
8 </TITLE>
9
10 <META NAME="keywords" CONTENT="lejos.navigation.CompassNavigator 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="CompassNavigator (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;PREV CLASS&nbsp;
55 &nbsp;<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>  &nbsp;
58 &nbsp;<A HREF="CompassNavigator.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="#fields_inherited_from_class_lejos.navigation.TachoNavigator">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;FIELD&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 CompassNavigator</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 "><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>
94 </PRE>
95 <DL>
96 <DT><B>All Implemented Interfaces:</B> <DD><A HREF="../../lejos/navigation/Navigator.html" title="interface in lejos.navigation">Navigator</A></DD>
97 </DL>
98 <HR>
99 <DL>
100 <DT><PRE>public class <B>CompassNavigator</B><DT>extends <A HREF="../../lejos/navigation/TachoNavigator.html" title="class in lejos.navigation">TachoNavigator</A></DL>
101 </PRE>
102
103 <P>
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.
110 <P>
111
112 <P>
113 <HR>
114
115 <P>
116 <!-- =========== FIELD SUMMARY =========== -->
117
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>
123 </TR>
124 </TABLE>
125 &nbsp;<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>
129 </TR>
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>
132 </TR>
133 </TABLE>
134 &nbsp;
135 <!-- ======== CONSTRUCTOR SUMMARY ======== -->
136
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>
142 </TR>
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>&nbsp;compassPilot)</CODE>
145
146 <BR>
147 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;To use this constructor, you must first create a compass pilot.</TD>
148 </TR>
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>&nbsp;compass,
151                  float&nbsp;wheelDiameter,
152                  float&nbsp;trackWidth,
153                  <A HREF="../../lejos/nxt/Motor.html" title="class in lejos.nxt">Motor</A>&nbsp;leftMotor,
154                  <A HREF="../../lejos/nxt/Motor.html" title="class in lejos.nxt">Motor</A>&nbsp;rightMotor,
155                  boolean&nbsp;reverse)</CODE>
156
157 <BR>
158 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
159 </TR>
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>&nbsp;compassPort,
162                  float&nbsp;wheelDiameter,
163                  float&nbsp;trackWidth,
164                  <A HREF="../../lejos/nxt/Motor.html" title="class in lejos.nxt">Motor</A>&nbsp;leftMotor,
165                  <A HREF="../../lejos/nxt/Motor.html" title="class in lejos.nxt">Motor</A>&nbsp;rightMotor)</CODE>
166
167 <BR>
168 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Allocates a CompassNavigator objects and its  CompassPilot object and initializes it with the proper motors and dimensions.</TD>
169 </TR>
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>&nbsp;compassPort,
172                  float&nbsp;wheelDiameter,
173                  float&nbsp;trackWidth,
174                  <A HREF="../../lejos/nxt/Motor.html" title="class in lejos.nxt">Motor</A>&nbsp;leftMotor,
175                  <A HREF="../../lejos/nxt/Motor.html" title="class in lejos.nxt">Motor</A>&nbsp;rightMotor,
176                  boolean&nbsp;reverse)</CODE>
177
178 <BR>
179 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
180 </TR>
181 </TABLE>
182 &nbsp;
183 <!-- ========== METHOD SUMMARY =========== -->
184
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>
190 </TR>
191 <TR BGCOLOR="white" CLASS="TableRowColor">
192 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
193 <CODE>&nbsp;void</CODE></FONT></TD>
194 <TD><CODE><B><A HREF="../../lejos/navigation/CompassNavigator.html#calibrateCompass()">calibrateCompass</A></B>()</CODE>
195
196 <BR>
197 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Robot rotates 360 degrees while calibrating the compass sensor</TD>
198 </TR>
199 <TR BGCOLOR="white" CLASS="TableRowColor">
200 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
201 <CODE>&nbsp;void</CODE></FONT></TD>
202 <TD><CODE><B><A HREF="../../lejos/navigation/CompassNavigator.html#rotate(float, boolean)">rotate</A></B>(float&nbsp;angle,
203        boolean&nbsp;immediateReturn)</CODE>
204
205 <BR>
206 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Rotates the NXT robot by a specified angle.</TD>
207 </TR>
208 <TR BGCOLOR="white" CLASS="TableRowColor">
209 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
210 <CODE>&nbsp;void</CODE></FONT></TD>
211 <TD><CODE><B><A HREF="../../lejos/navigation/CompassNavigator.html#rotateTo(float, boolean)">rotateTo</A></B>(float&nbsp;angle,
212          boolean&nbsp;immediateReturn)</CODE>
213
214 <BR>
215 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Rotates the NXT robot to point in a specific direction.</TD>
216 </TR>
217 <TR BGCOLOR="white" CLASS="TableRowColor">
218 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
219 <CODE>&nbsp;void</CODE></FONT></TD>
220 <TD><CODE><B><A HREF="../../lejos/navigation/CompassNavigator.html#stop()">stop</A></B>()</CODE>
221
222 <BR>
223 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Halts the NXT robot and calculates new x, y coordinates.</TD>
224 </TR>
225 <TR BGCOLOR="white" CLASS="TableRowColor">
226 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
227 <CODE>&nbsp;void</CODE></FONT></TD>
228 <TD><CODE><B><A HREF="../../lejos/navigation/CompassNavigator.html#travel(float, boolean)">travel</A></B>(float&nbsp;distance,
229        boolean&nbsp;immediateReturn)</CODE>
230
231 <BR>
232 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Moves the NXT robot a specific distance.</TD>
233 </TR>
234 <TR BGCOLOR="white" CLASS="TableRowColor">
235 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
236 <CODE>&nbsp;void</CODE></FONT></TD>
237 <TD><CODE><B><A HREF="../../lejos/navigation/CompassNavigator.html#updateHeading()">updateHeading</A></B>()</CODE>
238
239 <BR>
240 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Direction of robot facing is set equal to the current compass reading</TD>
241 </TR>
242 <TR BGCOLOR="white" CLASS="TableRowColor">
243 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
244 <CODE>&nbsp;void</CODE></FONT></TD>
245 <TD><CODE><B><A HREF="../../lejos/navigation/CompassNavigator.html#updateXY()">updateXY</A></B>()</CODE>
246
247 <BR>
248 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Updates x,y coordinates; assumes last compass angle was constant during travel</TD>
249 </TR>
250 </TABLE>
251 &nbsp;<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>
255 </TR>
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>
258 </TR>
259 </TABLE>
260 &nbsp;<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>
264 </TR>
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>
267 </TR>
268 </TABLE>
269 &nbsp;
270 <P>
271
272 <!-- ========= CONSTRUCTOR DETAIL ======== -->
273
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>
279 </TR>
280 </TABLE>
281
282 <A NAME="CompassNavigator(lejos.nxt.SensorPort, float, float, lejos.nxt.Motor, lejos.nxt.Motor)"><!-- --></A><H3>
283 CompassNavigator</H3>
284 <PRE>
285 public <B>CompassNavigator</B>(<A HREF="../../lejos/nxt/SensorPort.html" title="class in lejos.nxt">SensorPort</A>&nbsp;compassPort,
286                         float&nbsp;wheelDiameter,
287                         float&nbsp;trackWidth,
288                         <A HREF="../../lejos/nxt/Motor.html" title="class in lejos.nxt">Motor</A>&nbsp;leftMotor,
289                         <A HREF="../../lejos/nxt/Motor.html" title="class in lejos.nxt">Motor</A>&nbsp;rightMotor)</PRE>
290 <DL>
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
294  the x axis. <BR>
295 <P>
296 <DL>
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>
300 </DL>
301 <HR>
302
303 <A NAME="CompassNavigator(lejos.nxt.SensorPort, float, float, lejos.nxt.Motor, lejos.nxt.Motor, boolean)"><!-- --></A><H3>
304 CompassNavigator</H3>
305 <PRE>
306 public <B>CompassNavigator</B>(<A HREF="../../lejos/nxt/SensorPort.html" title="class in lejos.nxt">SensorPort</A>&nbsp;compassPort,
307                         float&nbsp;wheelDiameter,
308                         float&nbsp;trackWidth,
309                         <A HREF="../../lejos/nxt/Motor.html" title="class in lejos.nxt">Motor</A>&nbsp;leftMotor,
310                         <A HREF="../../lejos/nxt/Motor.html" title="class in lejos.nxt">Motor</A>&nbsp;rightMotor,
311                         boolean&nbsp;reverse)</PRE>
312 <DL>
313 </DL>
314 <HR>
315
316 <A NAME="CompassNavigator(lejos.nxt.CompassSensor, float, float, lejos.nxt.Motor, lejos.nxt.Motor, boolean)"><!-- --></A><H3>
317 CompassNavigator</H3>
318 <PRE>
319 public <B>CompassNavigator</B>(<A HREF="../../lejos/nxt/CompassSensor.html" title="class in lejos.nxt">CompassSensor</A>&nbsp;compass,
320                         float&nbsp;wheelDiameter,
321                         float&nbsp;trackWidth,
322                         <A HREF="../../lejos/nxt/Motor.html" title="class in lejos.nxt">Motor</A>&nbsp;leftMotor,
323                         <A HREF="../../lejos/nxt/Motor.html" title="class in lejos.nxt">Motor</A>&nbsp;rightMotor,
324                         boolean&nbsp;reverse)</PRE>
325 <DL>
326 </DL>
327 <HR>
328
329 <A NAME="CompassNavigator(lejos.navigation.CompassPilot)"><!-- --></A><H3>
330 CompassNavigator</H3>
331 <PRE>
332 public <B>CompassNavigator</B>(<A HREF="../../lejos/navigation/CompassPilot.html" title="class in lejos.navigation">CompassPilot</A>&nbsp;compassPilot)</PRE>
333 <DL>
334 <DD>To use this constructor, you must first create a compass pilot.
335 <P>
336 <DL>
337 <DT><B>Parameters:</B><DD><CODE>compassPilot</CODE> - </DL>
338 </DL>
339
340 <!-- ============ METHOD DETAIL ========== -->
341
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>
347 </TR>
348 </TABLE>
349
350 <A NAME="calibrateCompass()"><!-- --></A><H3>
351 calibrateCompass</H3>
352 <PRE>
353 public void <B>calibrateCompass</B>()</PRE>
354 <DL>
355 <DD>Robot rotates 360 degrees while calibrating the compass sensor
356 <P>
357 <DD><DL>
358 </DL>
359 </DD>
360 </DL>
361 <HR>
362
363 <A NAME="rotateTo(float, boolean)"><!-- --></A><H3>
364 rotateTo</H3>
365 <PRE>
366 public void <B>rotateTo</B>(float&nbsp;angle,
367                      boolean&nbsp;immediateReturn)</PRE>
368 <DL>
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.
373 <P>
374 <DD><DL>
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>
376 </DD>
377 <DD><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>
380 </DD>
381 </DL>
382 <HR>
383
384 <A NAME="rotate(float, boolean)"><!-- --></A><H3>
385 rotate</H3>
386 <PRE>
387 public void <B>rotate</B>(float&nbsp;angle,
388                    boolean&nbsp;immediateReturn)</PRE>
389 <DL>
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.
393 <P>
394 <DD><DL>
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>
396 </DD>
397 <DD><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>
400 </DD>
401 </DL>
402 <HR>
403
404 <A NAME="travel(float, boolean)"><!-- --></A><H3>
405 travel</H3>
406 <PRE>
407 public void <B>travel</B>(float&nbsp;distance,
408                    boolean&nbsp;immediateReturn)</PRE>
409 <DL>
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.
414 <P>
415 <DD><DL>
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>
417 </DD>
418 <DD><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>
421 </DD>
422 </DL>
423 <HR>
424
425 <A NAME="stop()"><!-- --></A><H3>
426 stop</H3>
427 <PRE>
428 public void <B>stop</B>()</PRE>
429 <DL>
430 <DD>Halts the NXT robot and calculates new x, y coordinates.
431 <P>
432 <DD><DL>
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>
434 </DD>
435 <DD><DL>
436 <DT><B>See Also:</B><DD><A HREF="../../lejos/navigation/Navigator.html#forward()"><CODE>Navigator.forward().</CODE></A></DL>
437 </DD>
438 </DL>
439 <HR>
440
441 <A NAME="updateHeading()"><!-- --></A><H3>
442 updateHeading</H3>
443 <PRE>
444 public void <B>updateHeading</B>()</PRE>
445 <DL>
446 <DD>Direction of robot facing is set equal to the current compass reading
447 <P>
448 <DD><DL>
449 </DL>
450 </DD>
451 </DL>
452 <HR>
453
454 <A NAME="updateXY()"><!-- --></A><H3>
455 updateXY</H3>
456 <PRE>
457 public void <B>updateXY</B>()</PRE>
458 <DL>
459 <DD>Updates x,y coordinates; assumes last compass angle was constant during travel
460 <P>
461 <DD><DL>
462 </DL>
463 </DD>
464 </DL>
465 <!-- ========= END OF CLASS DATA ========= -->
466 <HR>
467
468
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="">
473 <TR>
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>&nbsp;</TD>
479   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
480   <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
481   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
482   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
483   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
484   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
485   </TR>
486 </TABLE>
487 </TD>
488 <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
489 </EM>
490 </TD>
491 </TR>
492
493 <TR>
494 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
495 &nbsp;PREV CLASS&nbsp;
496 &nbsp;<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>  &nbsp;
499 &nbsp;<A HREF="CompassNavigator.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
500 &nbsp;<SCRIPT type="text/javascript">
501   <!--
502   if(window==top) {
503     document.writeln('<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>');
504   }
505   //-->
506 </SCRIPT>
507 <NOSCRIPT>
508   <A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>
509 </NOSCRIPT>
510
511
512 </FONT></TD>
513 </TR>
514 <TR>
515 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
516   SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;<A HREF="#fields_inherited_from_class_lejos.navigation.TachoNavigator">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
517 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
518 DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
519 </TR>
520 </TABLE>
521 <A NAME="skip-navbar_bottom"></A>
522 <!-- ======== END OF BOTTOM NAVBAR ======= -->
523
524 <HR>
525
526 </BODY>
527 </HTML>