tools
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
roboticslab::ControlBoardStateToIPosition Class Reference

Reads joint positions from an input control board, sends to an output control board.

#include <ControlBoardStateToIPosition.hpp>

Inheritance diagram for roboticslab::ControlBoardStateToIPosition:

Public Member Functions

bool configure (yarp::os::ResourceFinder &rf) override
 
bool close () override
 
bool updateModule () override
 
void run () override
 

Private Attributes

std::vector< double > encPoss
 
yarp::dev::PolyDriver inRobotDevice
 
yarp::dev::PolyDriver outRobotDevice
 
yarp::dev::IEncoders * iEncodersIn
 
yarp::dev::IControlMode * iControlModeOut
 
yarp::dev::IPositionDirect * iPositionDirectOut
 

Member Function Documentation

◆ close()

bool ControlBoardStateToIPosition::close ( )
override

Close function.

This is called automatically when the module closes, after the last call to updateModule. Override this to cleanup memory allocated in the configure() function or perform other activities that ensure graceful shutdown.

Returns
true/false on success failure.

◆ configure()

bool ControlBoardStateToIPosition::configure ( yarp::os::ResourceFinder &  rf)
override

Configure the module, pass a ResourceFinder object to the module.

Parameters
rfa previously initialized ResourceFinder
Returns
true/false upon success/failure
Note
attachTerminal() is no longer called automatically. You can call it in the configure function.

◆ run()

void ControlBoardStateToIPosition::run ( )
override

Loop function. This is the thread itself. The thread calls the run() function every <period> ms. At the end of each run, the thread will sleep the amounth of time required, taking into account the time spent inside the loop function. Example: requested period is 10ms, the run() function take 3ms to be executed, the thread will sleep for 7ms.

Note: after each run is completed, the thread will call a yield() in order to facilitate other threads to run.

◆ updateModule()

bool ControlBoardStateToIPosition::updateModule ( )
override

Override this to do whatever your module needs to do.

When your module wants to stop, return false. The module's actual work could be done during this call, or it could just check the state of a thread running in the background.

Returns
true iff module should continue

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