sot-core
4.11.8
Hierarchical task solver plug-in for dynamic-graph.
|
This class is loading the control part of the Stack-Of-Tasks. More...
#include <sot/core/sot-loader.hh>
Public Member Functions | |
SotLoader () | |
Default constructor. More... | |
~SotLoader () | |
Default destructor. More... | |
int | parseOptions (int argc, char *argv[]) |
Read user input to extract the path of the SoT dynamic library. More... | |
bool | initialization () |
Prepare the SoT framework. More... | |
void | cleanUp () |
Unload the library which handles the robot device. More... | |
bool | isDynamicGraphStopped () |
Get Status of dg. More... | |
void | startDG () |
Get Status of dg. More... | |
void | stopDG () |
Get Status of dg. More... | |
void | setDynamicLibraryName (std::string &afilename) |
Specify the name of the 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 | oneIteration (std::map< std::string, SensorValues > &sensors_in, std::map< std::string, ControlValues > &control_values) |
Compute one iteration of control. Basically executes fillSensors, the SoT and the readControl. More... | |
void | loadDeviceInPython (const std::string &device_name) |
Load the Device entity in the python global scope. More... | |
Protected Attributes | |
bool | dynamic_graph_stopped_ |
Check if the dynamic graph is running or not. More... | |
AbstractSotExternalInterface * | sot_external_interface_ |
The interface between the device and the robot driver. More... | |
std::string | sot_dynamic_library_filename_ |
Name of the dynamic library containing the dgs::AbstractSotExternalInterface object. More... | |
void * | sot_dynamic_library_ |
Handle on the SoT library. More... | |
python::Interpreter | embeded_python_interpreter_ |
Embeded python interpreter. More... | |
std::map< std::string, SensorValues > | sensors_in_ |
Map of sensor readings. More... | |
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... | |
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.
dynamicgraph::sot::SotLoader::SotLoader | ( | ) |
Default constructor.
dynamicgraph::sot::SotLoader::~SotLoader | ( | ) |
Default destructor.
void dynamicgraph::sot::SotLoader::cleanUp | ( | ) |
Unload the library which handles the robot device.
bool dynamicgraph::sot::SotLoader::initialization | ( | ) |
Prepare the SoT framework.
|
inline |
Get Status of dg.
void dynamicgraph::sot::SotLoader::loadDeviceInPython | ( | const std::string & | device_name | ) |
Load the Device entity in the python global scope.
void dynamicgraph::sot::SotLoader::oneIteration | ( | std::map< std::string, SensorValues > & | sensors_in, |
std::map< std::string, ControlValues > & | control_values | ||
) |
Compute one iteration of control. Basically executes fillSensors, the SoT and the readControl.
int dynamicgraph::sot::SotLoader::parseOptions | ( | int | argc, |
char * | argv[] | ||
) |
Read user input to extract the path of the SoT dynamic library.
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.
|
inline |
Run a python script inside the embeded python interpreter.
|
inline |
Run a python script inside the embeded python interpreter.
|
inline |
Specify the name of the dynamic library.
|
inline |
Get Status of dg.
|
inline |
Get Status of dg.
|
protected |
Map of control values.
|
protected |
Device entity created and loaded, so we deregister it as the Pool is not responsible for it's life time.
|
protected |
Check if the dynamic graph is running or not.
|
protected |
Embeded python interpreter.
|
protected |
Map of sensor readings.
|
protected |
Handle on the SoT library.
|
protected |
Name of the dynamic library containing the dgs::AbstractSotExternalInterface object.
|
protected |
The interface between the device and the robot driver.