Public Member Functions | Protected Attributes | List of all members
dynamicgraph::sot::SotLoader Class Reference

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)
 Run a python script 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 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, ControlValuescontrol_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, SensorValuessensors_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...
 
AbstractSotExternalInterfacesot_external_interface_
 The interface between the device and the robot driver. More...
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ SotLoader()

dynamicgraph::sot::SotLoader::SotLoader ( )

Default constructor.

Definition at line 33 of file sot-loader.cpp.

◆ ~SotLoader()

dynamicgraph::sot::SotLoader::~SotLoader ( )

Default destructor.

Definition at line 41 of file sot-loader.cpp.

Member Function Documentation

◆ cleanUp()

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.

◆ initialization()

bool dynamicgraph::sot::SotLoader::initialization ( )

Prepare the SoT framework.

Definition at line 70 of file sot-loader.cpp.

◆ isDynamicGraphStopped()

bool dynamicgraph::sot::SotLoader::isDynamicGraphStopped ( )
inline

Get Status of dg.

Definition at line 91 of file sot-loader.hh.

◆ loadDeviceInPython()

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.

◆ oneIteration()

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.

Parameters
periodtime since last call

Definition at line 171 of file sot-loader.cpp.

◆ parseOptions()

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.

◆ runPythonCommand()

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.

◆ runPythonFile() [1/2]

void dynamicgraph::sot::SotLoader::runPythonFile ( std::string  ifilename)
inline

Run a python script inside the embeded python interpreter.

Definition at line 114 of file sot-loader.hh.

◆ runPythonFile() [2/2]

void dynamicgraph::sot::SotLoader::runPythonFile ( std::string  ifilename,
std::string &  err 
)
inline

Run a python script inside the embeded python interpreter.

Definition at line 109 of file sot-loader.hh.

◆ setDynamicLibraryName()

void dynamicgraph::sot::SotLoader::setDynamicLibraryName ( std::string &  afilename)
inline

Specify the name of the dynamic library.

Definition at line 100 of file sot-loader.hh.

◆ startDG()

void dynamicgraph::sot::SotLoader::startDG ( )
inline

Get Status of dg.

Definition at line 94 of file sot-loader.hh.

◆ stopDG()

void dynamicgraph::sot::SotLoader::stopDG ( )
inline

Get Status of dg.

Definition at line 97 of file sot-loader.hh.

Member Data Documentation

◆ control_values_

std::map<std::string, ControlValues> dynamicgraph::sot::SotLoader::control_values_
protected

Map of control values.

Definition at line 69 of file sot-loader.hh.

◆ device_name_

std::string dynamicgraph::sot::SotLoader::device_name_
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.

◆ dynamic_graph_stopped_

bool dynamicgraph::sot::SotLoader::dynamic_graph_stopped_
protected

Check if the dynamic graph is running or not.

Definition at line 50 of file sot-loader.hh.

◆ embeded_python_interpreter_

python::Interpreter dynamicgraph::sot::SotLoader::embeded_python_interpreter_
protected

Embeded python interpreter.

Definition at line 63 of file sot-loader.hh.

◆ sensors_in_

std::map<std::string, SensorValues> dynamicgraph::sot::SotLoader::sensors_in_
protected

Map of sensor readings.

Definition at line 66 of file sot-loader.hh.

◆ sot_dynamic_library_

void* dynamicgraph::sot::SotLoader::sot_dynamic_library_
protected

Handle on the SoT library.

Definition at line 60 of file sot-loader.hh.

◆ sot_dynamic_library_filename_

std::string dynamicgraph::sot::SotLoader::sot_dynamic_library_filename_
protected

Name of the dynamic library containing the dgs::AbstractSotExternalInterface object.

Definition at line 57 of file sot-loader.hh.

◆ sot_external_interface_

AbstractSotExternalInterface* dynamicgraph::sot::SotLoader::sot_external_interface_
protected

The interface between the device and the robot driver.

Definition at line 53 of file sot-loader.hh.


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


sot-core
Author(s): Olivier Stasse, ostasse@laas.fr
autogenerated on Tue Oct 24 2023 02:26:32