rec::robotino::api2 C++ interface
Public Member Functions | Friends | List of all members
rec::robotino::api2::EncoderInput Class Reference

Represents the external motor encoder input. More...

#include <EncoderInput.h>

Inheritance diagram for rec::robotino::api2::EncoderInput:
rec::robotino::api2::ComObject

Public Member Functions

void setComId (const ComId &id)
 
void resetPosition (int position)
 
int position () const
 
void setPosition (int position, int velocity)
 
int velocity () const
 
void setVelocity (int velocity)
 
virtual void readingsChangedEvent (int velocity, int position, float current)
 
- Public Member Functions inherited from rec::robotino::api2::ComObject
 ComObject ()
 
virtual ~ComObject ()
 
ComId comId () const
 

Friends

class EncoderInputImpl
 

Additional Inherited Members

- Protected Attributes inherited from rec::robotino::api2::ComObject
ComId _comID
 

Detailed Description

Represents the external motor encoder input.

Member Function Documentation

int rec::robotino::api2::EncoderInput::position ( ) const
Returns
Actual position in ticks since power on or resetPosition
Exceptions
RobotinoExceptionif given id is invalid.
Remarks
This function is thread save
virtual void rec::robotino::api2::EncoderInput::readingsChangedEvent ( int  velocity,
int  position,
float  current 
)
virtual

Called when new readings are available.

Remarks
This function is called from the thread in which Com::processEvents() is called.
See also
Com::processEvents
void rec::robotino::api2::EncoderInput::resetPosition ( int  position)

Set the current position to zero.

Parameters
positionNew position after reset.
Exceptions
RobotinoExceptionif given id is invalid.
Remarks
This function is thread save
void rec::robotino::api2::EncoderInput::setComId ( const ComId id)

Sets the associated communication object.

Parameters
idThe id of the associated communication object.
Exceptions
RobotinoExceptionif given id is invalid.
Remarks
This function is thread save
void rec::robotino::api2::EncoderInput::setPosition ( int  position,
int  velocity 
)

Drive the motor until position() equals the given position set-point.

Parameters
positionPosition set-point in encoder ticks.
velocityDrive to the given position set-point with the given velocity in encoder ticks/s.
Exceptions
RobotinoExceptionif given id is invalid.
Remarks
This function is thread save
void rec::robotino::api2::EncoderInput::setVelocity ( int  velocity)

Set the motor's velocity in ticks/s.

Parameters
velocityVelocity set-point in ticks/s.
Exceptions
RobotinoExceptionif given id is invalid.
Remarks
This function is thread save
int rec::robotino::api2::EncoderInput::velocity ( ) const
Returns
The actual velocity in ticks/s
Exceptions
RobotinoExceptionif given id is invalid.
Remarks
This function is thread save

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