#include <EncoderReader.hh>
Inherits Module.
The EncoderReader module periodcially reads encoder counts from the EncoderHW interface of the hardware layer and maintains position and velocity states for a single axis.
Public Member Functions | |
EncoderReader (int index) | |
void | init (void) |
void | uninit (void) |
void | activate (void) |
void | deactivate (void) |
void | update (void) |
void | reset (double pos) |
void | resetRelPosition (void) |
float | getPosition (void) |
float | getRelPosition (void) |
float | getSpeed (void) |
double | getTimestamp (void) |
|
This method returns the current absolute position of the axis. The returned value is always in the range [-PI,PI]. Angle units are radians. |
|
This method returns the current relative position of the axis. This relative position is cumulative, so it is not restricted to lie within [-PI,PI]. Angle units are radians. |
|
This method returns the current axis rotational speed. Returned value has unit rad/s. |
|
This method returns the timestamp for the latest encoder reading. Time units are seconds. |
|
This method resets the absolute position state to the supplied value. Angle units are radians. |
|
This method resets the "relative" position state to 0. Relative position state can be used to track axis motion with respect to an arbitrary reference point determined by the last call to this method. |