![]() |
roneos
Operating System for the r-one robot
|
Deals with who the encoder ticks and its translation to distance. More...
Go to the source code of this file.
Functions | |
void | encoderInit (void) |
Initializes the encoder. More... | |
int32 | encoderGetTicks (uint32 enc) |
Initializes the encoder. More... | |
int32 | encoderGetDirection (uint32 enc) |
Gets the current rotating direction of the encoder. More... | |
int32 | encoderGetVelocity (uint32 enc) |
Gets the current velocity of the specified encoder. More... | |
int32 | encoderDeltaTicks (uint32 new, uint32 old) |
Gets the difference between the two input ticks. More... | |
void | encoderPoseUpdate (void) |
Updates the encoder's position. More... | |
void | encoderPoseClear (void) |
Clears the x, y, theta and odometer values of the encoder. More... | |
void | encoderGetPose (Pose *posePtr) |
Gets the pose of the encoder and stores it in variables (x, y, theta) of where posePtr points to. More... | |
void | encoderSetPose (Pose *posePtr) |
Sets the pose of the encoder as variables of where posePtr points to. More... | |
uint32 | encoderGetOdometer (void) |
Finds and returns the odometer reading in mm. More... | |
Deals with who the encoder ticks and its translation to distance.
There is an assumption that encoder_pose_update() will be called on a regular basis to ensure accuracy. Keep updating in micrometers. The encoders have a resolution of 0.0625mm. That is, each tick represents a change of 0.0625 mm. Our pose is stored in micrometers and microradians. Each tick corresponds to 62.5 micrometers. Rounding to 63.
x,y coordinates are stored in micrometers theta is represented in microradians
int32 encoderDeltaTicks | ( | uint32 | new, |
uint32 | old | ||
) |
Gets the difference between the two input ticks.
new | is the new encoder position |
old | is the old encoder position |
int32 encoderGetDirection | ( | uint32 | enc) |
Gets the current rotating direction of the encoder.
enc | specifies which encoder (right or left) to look up |
uint32 encoderGetOdometer | ( | void | ) |
Finds and returns the odometer reading in mm.
void encoderGetPose | ( | Pose * | posePtr) |
Gets the pose of the encoder and stores it in variables (x, y, theta) of where posePtr points to.
posePtr | points to a Pose structure |
int32 encoderGetTicks | ( | uint32 | enc) |
Initializes the encoder.
Enables the peripherals. Sets the state of the odometer to 0,0,0.
int32 encoderGetVelocity | ( | uint32 | enc) |
Gets the current velocity of the specified encoder.
enc | specifies which encoder (right or left) to look up |
void encoderInit | ( | void | ) |
Initializes the encoder.
Enables the peripherals. Sets the state of the odometer to 0,0,0.
void encoderPoseClear | ( | void | ) |
Clears the x, y, theta and odometer values of the encoder.
void encoderPoseUpdate | ( | void | ) |
Updates the encoder's position.