|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object lejos.robotics.navigation.SimpleNavigator
public class SimpleNavigator
The SimpleNavigator class uses dead reckoning to keep track of its robot pose (the location in the plane
and its heading - the direction in which it moves). While dead reckoning is relatively
easy to implement and very quick to caolculate, its disadvantage
is that errors in the estimated pose accumulate.
SimpleNavigator can perform three elementary movements in a plane: trvel in a straignt line,
move in the arc of a circle, and a rotate in place. The movement commands
have an immediate return option which is useful, for example, for a client
class that uses s SimpleNavigataor to detect obstacles or monitor incoming messages while moving.
This class uses a private Pilot object to execute these moves. The Pilot directly
controls the hardware, which must be able to turn in place,
for example using 2 wheel differential steering. The Pilot is passed to the Navitator
a the parameter of its constructor. After the Navigator is constructed,
the client has no further need for the Pilot, but issues commands to the Navigator.
If the client bypasses the navigator and issues commsnds directly to the Pilot, this will destroy
the accuracy of the Navigataor's pose.
A note about coordinates: All angles are in degrees, distances in the units used to specify robot dimensions.
Angles related to positions in the plane are relative to the X axis ; direction of the Y axis is 90 degrees.
The x and y coordinate values and the direction angle are all initialized to 0, so if the first move is forward() the robot will run along
the x axis.
Constructor Summary | |
---|---|
SimpleNavigator(float wheelDiameter,
float |