ocra-wbi-plugins
Doxygen documentation for the ocra-wbi-plugins repository
Module Class Reference

The controller module which launches the controller thread. More...

#include <Module.h>

Collaboration diagram for Module:
[legend]

List of all members.

Public Member Functions

 Module ()
 ~Module ()
bool configure (yarp::os::ResourceFinder &rf)
bool interruptModule ()
bool close ()
bool updateModule ()
void printHelp ()

Private Attributes

std::shared_ptr< ThreadctrlThread
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

Detailed Description

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.


Constructor & Destructor Documentation

Constructor which essentially does nothing.

Destructor which essentially does nothing.


Member Function Documentation

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.

Parameters:
rfA resource finder instance which is initialized from the command line args.
Returns:
True or false if the configuration was successful.

Interrupts the module execution and stops the control and wbi threads.

Prints all the command line args one could use.

Updates the Module. Basically just clocks the thread run() method.

Returns:
Whether or not the clocking functions worked.

Member Data Documentation

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.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines