Main Page | Modules | Class Hierarchy | Compound List | File List | Compound Members | File Members | Related Pages

EncoderReader Class Reference
[Miscellaneous Library Utilities]

#include <EncoderReader.hh>

Inherits Module.

List of all members.


Detailed Description

Module to read encoder counts and compute axis position and speed.

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)


Member Function Documentation

float EncoderReader::getPosition void   )  [inline]
 

This method returns the current absolute position of the axis. The returned value is always in the range [-PI,PI]. Angle units are radians.

float EncoderReader::getRelPosition void   )  [inline]
 

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.

float EncoderReader::getSpeed void   )  [inline]
 

This method returns the current axis rotational speed. Returned value has unit rad/s.

double EncoderReader::getTimestamp void   )  [inline]
 

This method returns the timestamp for the latest encoder reading. Time units are seconds.

void EncoderReader::reset double  pos  ) 
 

This method resets the absolute position state to the supplied value. Angle units are radians.

void EncoderReader::resetRelPosition void   )  [inline]
 

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.


RHexLib Reference Documentation