RobotCore
Robot Core Documentation
Classes | Public Member Functions | Static Public Member Functions | List of all members
robotCore.Navigator Class Reference

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...

Classes

class  NavigatorPos
 

Public Member Functions

NavigatorPos getPos ()
 
void setTicksPerFoot (double ticks)
 
void reset (double yaw, double xPos, double yPos)
 
void setUpdateRate (double rate, double timeout)
 
void invert (int yaw, int leftEncoder, int rightEncoder)
 

Static Public Member Functions

static Navigator getInstance ()
 

Detailed Description

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

Member Function Documentation

◆ getInstance()

static Navigator robotCore.Navigator.getInstance ( )
static

Gets the current instance of the Navigator class. Note that only one instance is allowed.

Returns
Returns the current instance of the Navigator class.

◆ getPos()

NavigatorPos robotCore.Navigator.getPos ( )

Gets the current position data for the robot.

Returns
Returns the current position data.

◆ invert()

void robotCore.Navigator.invert ( int  yaw,
int  leftEncoder,
int  rightEncoder 
)

Specifies that the sense of the yaw, left and right encoders be inverted.

Parameters
yaw- If 1, inverts the direction of the yaw. If 0, does not invert the direction. If -1, leaves this value unchanged.
leftEncoder- If 1, inverts the direction of the left encoder. If 0, does not invert the direction. If -1, leaves this value unchanged.
rightEncoder- If 1, inverts the direction of the right encoder. If 0, does not invert the direction. If -1, leaves this value unchanged.

◆ 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.

◆ setUpdateRate()

void robotCore.Navigator.setUpdateRate ( double  rate,
double  timeout 
)

Specifies the rate at which the position data is updated.

Note that for the current configuration using the Arduino over the serial port, it is pointless to set the update delay to be less than 50ms.

Parameters
rate- Specifies time between updates in milliseconds. Currently this value should be greater than or equal to 50ms.
timeout- Specifies time, in milliseconds, after which the updates should cease. If this value is zero, then updates should continue indefinitely.

The documentation for this class was generated from the following file: