lejos.robotics.navigation
Class CompassPilot

java.lang.Object
  extended by lejos.robotics.navigation.DifferentialPilot
      extended by lejos.robotics.navigation.CompassPilot
All Implemented Interfaces:
ArcMoveController, ArcRotateMoveController, MoveController, MoveProvider, RotateMoveController, RegulatedMotorListener

Deprecated. This class will disappear in NXJ version 1.0. Compass should be added to a PoseProvider.

@Deprecated
public class CompassPilot
extends DifferentialPilot

A Pilot that keeps track of direction using a DirectionFinder.

See Also:
PoseProvider.getPose()

Field Summary
protected  byte _direction
          Deprecated.  
protected  float _distance
          Deprecated.  
protected  float _estimatedHeading
          Deprecated.  
protected  float _heading
          Deprecated.  
protected  float _heading0
          Deprecated.  
protected  boolean _traveling
          Deprecated.  
protected  DirectionFinder compass
          Deprecated.  
protected  lejos.robotics.navigation.CompassPilot.Regulator regulator
          Deprecated.  
 
Fields inherited from class lejos.robotics.navigation.DifferentialPilot
_left, _leftDegPerDistance, _outside, _right, _rightDegPerDistance, _type
 
Fields inherited from interface lejos.robotics.navigation.MoveController
WHEEL_SIZE_NXT1, WHEEL_SIZE_NXT2, WHEEL_SIZE_RCX
 
Fields inherited from interface lejos.robotics.navigation.MoveController
WHEEL_SIZE_NXT1, WHEEL_SIZE_NXT2, WHEEL_SIZE_RCX
 
Constructor Summary
CompassPilot(DirectionFinder compass, float wheelDiameter, float trackWidth, RegulatedMotor leftMotor, RegulatedMotor rightMotor)
          Deprecated. Allocates a CompasPilot object, and sets the physical parameters of the NXT robot.
CompassPilot(DirectionFinder compass, float wheelDiameter, float trackWidth, RegulatedMotor leftMotor, RegulatedMotor rightMotor, boolean reverse)
          Deprecated. Allocates a CompasPilot object, and sets the physical parameters of the NXT robot.
 
Method Summary
 void calibrate()
          Deprecated. Rotates the robot 360 degrees while calibrating the compass resets compass zero to heading at end of calibration
 float getAngleIncrement()
          Deprecated. Returns the change in robot heading since the last call of reset() normalized to be within -180 and _180 degrees
 DirectionFinder getCompass()
          Deprecated. Return the compass
 float getCompassHeading()
          Deprecated. Method returns the current compass heading
 float getHeading()
          Deprecated. Returns direction of desired robot facing
 float getHeadingError()
          Deprecated. Determines the difference between actual compass direction and desired heading in degrees
 boolean isTraveling()
          Deprecated. returns returns true if the robot is travelling for a specific distance;
protected  float normalize(float angle)
          Deprecated.  
 void reset()
          Deprecated. Resets tacho count for both motors.
 void resetCartesianZero()
          Deprecated.  
 void rotate(float angle)
          Deprecated. Rotates the NXT robot through a specific angle; Rotates left if angle is positive, right if negative, Returns when angle is reached.
 void rotate(float angle, boolean immediateReturn)
          Deprecated. robot rotates to the specified compass heading;
 void setHeading(float angle)
          Deprecated. sets direction of desired robot facing in degrees
 void stop()
          Deprecated. Stops the robot soon after the method is executed.
protected  void stopNow()
          Deprecated.  
 void travel(float distance)
          Deprecated. Moves the NXT robot a specific distance;
A positive distance causes forward motion; negative distance moves backward.
 void travel(float distance, boolean immediateReturn)
          Deprecated. Moves the NXT robot a specific distance.
 
Methods inherited from class lejos.robotics.navigation.DifferentialPilot
addMoveListener, arc, arc, arcBackward, arcForward, backward, forward, getMaxRotateSpeed, getMaxTravelSpeed, getMinRadius, getMovement, getMovementIncrement, getRotateMaxSpeed, getRotateSpeed, getTravelSpeed, isMoving, isStalled, movementStart, quickStop, rotate, rotate, rotateLeft, rotateRight, rotationStarted, rotationStopped, setAcceleration, setMinRadius, setRotateSpeed, setTravelSpeed, steer, steer, steer, steerBackward, travel, travel, travelArc, travelArc
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

compass

protected DirectionFinder compass
Deprecated. 

regulator

protected lejos.robotics.navigation.CompassPilot.Regulator regulator
Deprecated. 

_heading

protected float _heading
Deprecated. 

_estimatedHeading

protected float _estimatedHeading
Deprecated. 

_traveling

protected boolean _traveling
Deprecated. 

_distance

protected float _distance
Deprecated. 

_direction

protected byte _direction
Deprecated. 

_heading0

protected float _heading0
Deprecated. 
Constructor Detail

CompassPilot

public CompassPilot(DirectionFinder compass,
                    float wheelDiameter,
                    float trackWidth,
                    RegulatedMotor leftMotor,
                    RegulatedMotor rightMotor)
Deprecated. 
Allocates a CompasPilot object, and sets the physical parameters of the NXT robot.
Assumes Motor.forward() causes the robot to move forward); Parameters

Parameters:
compass - : a compass sensor;
wheelDiameter - Diameter of the tire, in any convenient units. (The diameter in mm is usually printed on the tire).
trackWidth - Distance between center of right tire and center of left tire, in same units as wheelDiameter
leftMotor -
rightMotor -

CompassPilot

public CompassPilot(DirectionFinder compass,
                    float wheelDiameter,
                    float trackWidth,
                    RegulatedMotor leftMotor,
                    RegulatedMotor rightMotor,
                    boolean reverse)
Deprecated. 
Allocates a CompasPilot object, and sets the physical parameters of the NXT robot.
Assumes Motor.forward() causes the robot to move forward); Parameters

Parameters:
compass - : a compass sensor;
wheelDiameter - Diameter of the tire, in any convenient units. (The diameter in mm is usually printed on the tire).
trackWidth - Distance between center of right tire and center of left tire, in same units as wheelDiameter
leftMotor -
rightMotor -
reverse - if true of motor.forward() drives the robot backwards
Method Detail

isTraveling

public boolean isTraveling()
Deprecated. 
returns returns true if the robot is travelling for a specific distance;


getCompass

public DirectionFinder getCompass()
Deprecated. 
Return the compass

Returns:
the compass

getAngleIncrement

public float getAngleIncrement()
Deprecated. 
Returns the change in robot heading since the last call of reset() normalized to be within -180 and _180 degrees

Overrides:
getAngleIncrement in class DifferentialPilot
Returns:
The angle rotated since rotation began.

getHeading

public float getHeading()
Deprecated. 
Returns direction of desired robot facing


getCompassHeading

public float getCompassHeading()
Deprecated. 
Method returns the current compass heading

Returns:
Compass heading in degrees.

setHeading

public void setHeading(float angle)
Deprecated. 
sets direction of desired robot facing in degrees


calibrate

public void calibrate()
Deprecated. 
Rotates the robot 360 degrees while calibrating the compass resets compass zero to heading at end of calibration


resetCartesianZero

public void resetCartesianZero()
Deprecated. 

getHeadingError

public float getHeadingError()
Deprecated. 
Determines the difference between actual compass direction and desired heading in degrees

Returns:
error (in degrees)

travel

public void travel(float distance,
                   boolean immediateReturn)
Deprecated. 
Moves the NXT robot a specific distance. A positive value moves it forwards and a negative value moves it backwards. The robot steers to maintain its compass heading.

Parameters:
distance - The positive or negative distance to move the robot, same units as _wheelDiameter
immediateReturn - iff true, the method returns immediately.

travel

public void travel(float distance)
Deprecated. 
Moves the NXT robot a specific distance;
A positive distance causes forward motion; negative distance moves backward. Robot steers to maintain its compass heading;

Parameters:
distance - of robot movement. Unit of measure for distance must be same as wheelDiameter and trackWidth

rotate

public void rotate(float angle,
                   boolean immediateReturn)
Deprecated. 
robot rotates to the specified compass heading;

Parameters:
immediateReturn - - if true, method returns immediately. Robot stops when specified angle is reached or when stop() is called

rotate

public void rotate(float angle)
Deprecated. 
Rotates the NXT robot through a specific angle; Rotates left if angle is positive, right if negative, Returns when angle is reached. Wheels turn in opposite directions producing a zero radius turn.

Parameters:
angle - degrees. Positive angle rotates to the left (clockwise); negative to the right.
Requires correct values for wheel diameter and track width.

reset

public void reset()
Deprecated. 
Description copied from class: DifferentialPilot
Resets tacho count for both motors.

Overrides:
reset in class DifferentialPilot

stopNow

protected void stopNow()
Deprecated. 

stop

public void stop()
Deprecated. 
Stops the robot soon after the method is executed. (It takes time for the motors to slow to a halt)

Specified by:
stop in interface MoveController
Overrides:
stop in class DifferentialPilot

normalize

protected float normalize(float angle)
Deprecated.