The Navigator class uses the drive wheel encoders and a gyro to keep track of the robots absolute position on the field in real time.
More...
The Navigator class uses the drive wheel encoders and a gyro to keep track of the robots absolute position on the field in real time.
- Author
- John Gaby
◆ Navigator()
robotCore.Navigator.Navigator |
( |
Encoder |
leftEncoder, |
|
|
Encoder |
rightEncoder |
|
) |
| |
- Parameters
-
leftEncoder | - Specifies the encoder for the left motor |
rightEncoder | - Specifies the encoder for the right motor |
◆ getPos()
Gets the current position data for the robot.
- Returns
- Returns the current position data.
◆ getYaw()
double robotCore.Navigator.getYaw |
( |
| ) |
|
Gets only the yaw.
- Returns
- Returns the yaw.
◆ invert()
void robotCore.Navigator.invert |
( |
boolean |
invert | ) |
|
Specifies that the sense of the yaw be inverted. I.E. controls whether the yaw value increases or decreases when the robot turns clockwise. In general, the Pure Pursuit path following assumes that the yaw will decrease when the robot turns clockwise.
- Parameters
-
invert | - If true, inverts the direction of the yaw |
◆ reset()
void robotCore.Navigator.reset |
( |
double |
yaw, |
|
|
double |
xPos, |
|
|
double |
yPos |
|
) |
| |
Resets the yaw and position of the robot.
- Parameters
-
yaw | - Specifies the new yaw value for the robot in degrees. This value will be adjusted so that it in the range -180 to 180. |
xPos | - Specifies the new x position of the robot. This value is in encoder ticks unless the ticksPerFoot value is set in which case it is in feet. |
yPos | - Specifies the new y position of the robot. This value is in encoder ticks unless the ticksPerFoot value is set in which case it is in feet. |
◆ setTicksPerFoot()
void robotCore.Navigator.setTicksPerFoot |
( |
double |
ticks | ) |
|
Sets the number of ticks per foot
- Parameters
-
ticks | - Specifies the number of ticks per foot. |
The documentation for this class was generated from the following file:
- D:/SDASVN/2022/RaspberryPi/Source/robotCore/Navigator.java