rec::robotino::api2 C++ interface
|
Represents the external motor encoder input. More...
#include <EncoderInput.h>
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) |
![]() | |
ComObject () | |
virtual | ~ComObject () |
ComId | comId () const |
Friends | |
class | EncoderInputImpl |
Additional Inherited Members | |
![]() | |
ComId | _comID |
Represents the external motor encoder input.
int rec::robotino::api2::EncoderInput::position | ( | ) | const |
RobotinoException | if given id is invalid. |
|
virtual |
Called when new readings are available.
void rec::robotino::api2::EncoderInput::resetPosition | ( | int | position | ) |
Set the current position to zero.
position | New position after reset. |
RobotinoException | if given id is invalid. |
void rec::robotino::api2::EncoderInput::setComId | ( | const ComId & | id | ) |
Sets the associated communication object.
id | The id of the associated communication object. |
RobotinoException | if given id is invalid. |
void rec::robotino::api2::EncoderInput::setPosition | ( | int | position, |
int | velocity | ||
) |
Drive the motor until position() equals the given position set-point.
position | Position set-point in encoder ticks. |
velocity | Drive to the given position set-point with the given velocity in encoder ticks/s. |
RobotinoException | if given id is invalid. |
void rec::robotino::api2::EncoderInput::setVelocity | ( | int | velocity | ) |
Set the motor's velocity in ticks/s.
velocity | Velocity set-point in ticks/s. |
RobotinoException | if given id is invalid. |
int rec::robotino::api2::EncoderInput::velocity | ( | ) | const |
RobotinoException | if given id is invalid. |