@Deprecated public class CompassPilot extends DifferentialPilot
PoseProvider.getPose()
Modifier and Type | Field and Description |
---|---|
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.
|
_left, _leftDegPerDistance, _outside, _right, _rightDegPerDistance, _type
WHEEL_SIZE_EV3, WHEEL_SIZE_NXT1, WHEEL_SIZE_NXT2, WHEEL_SIZE_RCX
Constructor and Description |
---|
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.
|
Modifier and Type | Method and Description |
---|---|
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.
|
addMoveListener, arc, arc, arcBackward, arcForward, backward, forward, getAngularAcceleration, getAngularSpeed, getLinearAcceleration, getLinearSpeed, getMaxAngularSpeed, getMaxLinearSpeed, getMaxRotateSpeed, getMinRadius, getMovement, getMovementIncrement, getTurnRate, isMoving, isStalled, movementActive, movementStart, quickStop, rotate, rotate, rotateLeft, rotateRight, setAngularAcceleration, setAngularSpeed, setLinearAcceleration, setLinearSpeed, setMinRadius, steer, steer, steer, steerBackward, travel, travel, travelArc, travelArc
protected DirectionFinder compass
protected lejos.robotics.navigation.CompassPilot.Regulator regulator
protected float _heading
protected float _estimatedHeading
protected boolean _traveling
protected float _distance
protected byte _direction
protected float _heading0
public CompassPilot(DirectionFinder compass, float wheelDiameter, float trackWidth, RegulatedMotor leftMotor, RegulatedMotor rightMotor)
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 wheelDiameterleftMotor
- rightMotor
- public CompassPilot(DirectionFinder compass, float wheelDiameter, float trackWidth, RegulatedMotor leftMotor, RegulatedMotor rightMotor, boolean reverse)
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 wheelDiameterleftMotor
- rightMotor
- reverse
- if true of motor.forward() drives the robot backwardspublic boolean isTraveling()
public DirectionFinder getCompass()
public float getAngleIncrement()
getAngleIncrement
in class DifferentialPilot
public float getHeading()
public float getCompassHeading()
public void setHeading(float angle)
public void calibrate()
public void resetCartesianZero()
public float getHeadingError()
public void travel(float distance, boolean immediateReturn)
distance
- The positive or negative distance to move the robot, same units as _wheelDiameterimmediateReturn
- iff true, the method returns immediately.public void travel(float distance)
distance
- of robot movement. Unit of measure for distance must be same as wheelDiameter and trackWidthpublic void rotate(float angle, boolean immediateReturn)
immediateReturn
- - if true, method returns immediately.
Robot stops when specified angle is reached or when stop() is calledpublic void rotate(float angle)
angle
- degrees. Positive angle rotates to the left (clockwise); negative to the right. public void reset()
DifferentialPilot
reset
in class DifferentialPilot
protected void stopNow()
public void stop()
stop
in interface MoveController
stop
in class DifferentialPilot
protected float normalize(float angle)