A simple API for various odometry-related operations. More...
#include <Robots/LoBot/slam/LoOdometry.H>
Public Member Functions | |
Odometry () | |
Initialization. | |
void | add (int distance, int angle) |
void | set_thresholds (int distance, int angle) |
void | set_thresholds (const std::pair< int, int > &T) |
bool | thresholds_crossed () const |
void | reset () |
int | displacement () const |
int | rotation () const |
A simple API for various odometry-related operations.
This class stores the distance and angle returned by lobot's low-level motor system. It also provides an API for accumulating these odometric parameters and for maintaining and testing against certain thresholds.
Definition at line 66 of file LoOdometry.H.
lobot::Odometry::Odometry | ( | ) |
Initialization.
Definition at line 54 of file LoOdometry.C.
void lobot::Odometry::add | ( | int | distance, | |
int | angle | |||
) |
This method updates the current odometric values using the supplied ones.
Definition at line 61 of file LoOdometry.C.
References abs().
int lobot::Odometry::displacement | ( | ) | const [inline] |
This method returns the net displacement recorded by this odometry packet.
Definition at line 120 of file LoOdometry.H.
void lobot::Odometry::reset | ( | ) | [inline] |
Often, after the robot has traveled a certain distance and/or turned by some predefined amount, the higher layers of the robot's controller will want to perform some action (e.g., SLAM update, scan matching) and then reset the odometry so that the tracking can begin anew.
This method resets the odometry as described above.
Definition at line 114 of file LoOdometry.H.
int lobot::Odometry::rotation | ( | ) | const [inline] |
This method returns the net rotation recorded by this odometry packet.
Definition at line 124 of file LoOdometry.H.
void lobot::Odometry::set_thresholds | ( | const std::pair< int, int > & | T | ) | [inline] |
Convenience function for setting thresholds specified in an STL pair.
Definition at line 99 of file LoOdometry.H.
References set_thresholds().
void lobot::Odometry::set_thresholds | ( | int | distance, | |
int | angle | |||
) | [inline] |
This method allows clients to set some threshold values. Later, clients can check if these thresholds have been crossed or not.
Definition at line 92 of file LoOdometry.H.
Referenced by set_thresholds().
bool lobot::Odometry::thresholds_crossed | ( | ) | const |
This method checks if the total distance or angle have crossed the thresholds set by the client.
Definition at line 72 of file LoOdometry.C.