This class is loading the control part of the Stack-Of-Tasks. More...
#include <sot-loader.hh>
Public Member Functions | |
void | cleanUp () |
Unload the library which handles the robot device. More... | |
bool | initialization () |
Prepare the SoT framework. More... | |
bool | isDynamicGraphStopped () |
Get Status of dg. More... | |
void | loadDeviceInPython (const std::string &device_name) |
Load the Device entity in the python global scope. More... | |
void | oneIteration (std::map< std::string, SensorValues > &sensors_in, std::map< std::string, ControlValues > &control_values, const double &period) |
Compute one iteration of control. Basically executes fillSensors, the SoT and the readControl. More... | |
int | parseOptions (int argc, char *argv[]) |
Read user input to extract the path of the SoT dynamic library. More... | |
void | runPythonCommand (const std::string &command, std::string &result, std::string &out, std::string &err) |
Run a python command inside the embeded python interpreter. More... | |
void | runPythonFile (std::string ifilename, std::string &err) |
Run a python script inside the embeded python interpreter. More... | |
void | runPythonFile (std::string ifilename) |
Run a python script inside the embeded python interpreter. More... | |
void | setDynamicLibraryName (std::string &afilename) |
Specify the name of the dynamic library. More... | |
SotLoader () | |
Default constructor. More... | |
void | startDG () |
Get Status of dg. More... | |
void | stopDG () |
Get Status of dg. More... | |
~SotLoader () | |
Default destructor. More... | |
Protected Attributes | |
std::map< std::string, ControlValues > | control_values_ |
Map of control values. More... | |
std::string | device_name_ |
Device entity created and loaded, so we deregister it as the Pool is not responsible for it's life time. More... | |
bool | dynamic_graph_stopped_ |
Check if the dynamic graph is running or not. More... | |
python::Interpreter | embeded_python_interpreter_ |
Embeded python interpreter. More... | |
std::map< std::string, SensorValues > | sensors_in_ |
Map of sensor readings. More... | |
void * | sot_dynamic_library_ |
Handle on the SoT library. More... | |
std::string | sot_dynamic_library_filename_ |
Name of the dynamic library containing the dgs::AbstractSotExternalInterface object. More... | |
AbstractSotExternalInterface * | sot_external_interface_ |
The interface between the device and the robot driver. More... | |
This class is loading the control part of the Stack-Of-Tasks.
In order to Use this class you need to provide a dynamic library containing an implementation of the AbstractSotExternalInterface class.
Then you can either inherite from this class an initialize and use the sensors_in_ and control_values_ objects. Or you can create you own outside of this class. And then use the oneIteration to execute the graph.
Definition at line 47 of file sot-loader.hh.
dynamicgraph::sot::SotLoader::SotLoader | ( | ) |
Default constructor.
Definition at line 33 of file sot-loader.cpp.
dynamicgraph::sot::SotLoader::~SotLoader | ( | ) |
Default destructor.
Definition at line 41 of file sot-loader.cpp.
void dynamicgraph::sot::SotLoader::cleanUp | ( | ) |
Unload the library which handles the robot device.
Uncount the number of access to this library.
Definition at line 131 of file sot-loader.cpp.
bool dynamicgraph::sot::SotLoader::initialization | ( | ) |
Prepare the SoT framework.
Definition at line 70 of file sot-loader.cpp.
|
inline |
Get Status of dg.
Definition at line 91 of file sot-loader.hh.
void dynamicgraph::sot::SotLoader::loadDeviceInPython | ( | const std::string & | device_name | ) |
Load the Device entity in the python global scope.
Definition at line 187 of file sot-loader.cpp.
void dynamicgraph::sot::SotLoader::oneIteration | ( | std::map< std::string, SensorValues > & | sensors_in, |
std::map< std::string, ControlValues > & | control_values, | ||
const double & | period | ||
) |
Compute one iteration of control. Basically executes fillSensors, the SoT and the readControl.
period | time since last call |
Definition at line 171 of file sot-loader.cpp.
int dynamicgraph::sot::SotLoader::parseOptions | ( | int | argc, |
char * | argv[] | ||
) |
Read user input to extract the path of the SoT dynamic library.
Definition at line 43 of file sot-loader.cpp.
void dynamicgraph::sot::SotLoader::runPythonCommand | ( | const std::string & | command, |
std::string & | result, | ||
std::string & | out, | ||
std::string & | err | ||
) |
Run a python command inside the embeded python interpreter.
Definition at line 165 of file sot-loader.cpp.
|
inline |
Run a python script inside the embeded python interpreter.
Definition at line 109 of file sot-loader.hh.
|
inline |
Run a python script inside the embeded python interpreter.
Definition at line 114 of file sot-loader.hh.
|
inline |
Specify the name of the dynamic library.
Definition at line 100 of file sot-loader.hh.
|
inline |
Get Status of dg.
Definition at line 94 of file sot-loader.hh.
|
inline |
Get Status of dg.
Definition at line 97 of file sot-loader.hh.
|
protected |
Map of control values.
Definition at line 69 of file sot-loader.hh.
|
protected |
Device entity created and loaded, so we deregister it as the Pool is not responsible for it's life time.
Definition at line 73 of file sot-loader.hh.
|
protected |
Check if the dynamic graph is running or not.
Definition at line 50 of file sot-loader.hh.
|
protected |
Embeded python interpreter.
Definition at line 63 of file sot-loader.hh.
|
protected |
Map of sensor readings.
Definition at line 66 of file sot-loader.hh.
|
protected |
Handle on the SoT library.
Definition at line 60 of file sot-loader.hh.
|
protected |
Name of the dynamic library containing the dgs::AbstractSotExternalInterface object.
Definition at line 57 of file sot-loader.hh.
|
protected |
The interface between the device and the robot driver.
Definition at line 53 of file sot-loader.hh.