The controller module which launches the controller thread. More...
#include <Module.h>
Public Member Functions | |
Module () | |
~Module () | |
bool | configure (yarp::os::ResourceFinder &rf) |
bool | interruptModule () |
bool | close () |
bool | updateModule () |
void | printHelp () |
Private Attributes | |
std::shared_ptr< Thread > | ctrlThread |
std::shared_ptr < wbi::wholeBodyInterface > | robotInterface |
yarp::os::Log | yLog |
OcraControllerOptions | controller_options |
double | avgTime |
double | stdDev |
double | avgTimeUsed |
double | stdDevUsed |
double | dangerPeriodLoopTime |
Static Private Attributes | |
static const int | DEFAULT_THREAD_PERIOD = 10 |
The controller module which launches the controller thread.
Basically all this does is parse the command line arguments and look for the various config and task set files. It then instantiates a WBI instance (yarpWBI specifically) and a Thread instance. It launches these threads and then basically just waits till it gets a kill (ctrl+c) command to close them down. Does a little keeping track of time as well.
Module::Module | ( | ) |
Constructor which essentially does nothing.
Module::~Module | ( | ) |
Destructor which essentially does nothing.
bool Module::close | ( | ) |
Closes the module. First shuts down the threads.
bool Module::configure | ( | yarp::os::ResourceFinder & | rf | ) |
Configures the module by parsing the RF contents.
rf | A resource finder instance which is initialized from the command line args. |
bool Module::interruptModule | ( | ) |
Interrupts the module execution and stops the control and wbi threads.
void Module::printHelp | ( | ) |
Prints all the command line args one could use.
bool Module::updateModule | ( | ) |
Updates the Module. Basically just clocks the thread run() method.
double Module::avgTime [private] |
Average time between successive calls of the `run()` method.
double Module::avgTimeUsed [private] |
Average time for the `run()` method to execute. Should be close to avgTime.
Options used for the controller.
std::shared_ptr<Thread> Module::ctrlThread [private] |
The controller thread. This is where the magic happens.
double Module::dangerPeriodLoopTime [private] |
A value which the thread period loop time should not exceed.
const int Module::DEFAULT_THREAD_PERIOD = 10 [static, private] |
If the user doesn't provide a thread period make it 10ms.
std::shared_ptr<wbi::wholeBodyInterface> Module::robotInterface [private] |
The yarpWBI interface used to get estimates from the robot.
double Module::stdDev [private] |
Standard deviation of the average time between successive calls of the `run()` method.
double Module::stdDevUsed [private] |
Standard deviation of the average time for the `run()` method to execute.
yarp::os::Log Module::yLog [private] |
A yarp logging tool.