dynamic_graph_manager
|
If possible, controllers and helper functions should be implemented in "dg_tools". Please refer to the project's readme about the desired code structure.
In dynamic graph, an entity is an object that consumes input signals and provides output signals. For instance, a P-controller might consume the current position of a motor as input signal and provide as output a torque command to move the motor position towards a desired position.
To control a robot / simulator using dynamic graph manager, the following is necessary:
Once you have defined the controller in C++, you need to expose it to python. This is done by adding a few lines into the CMakeList.txt file.
For an example, please refer to https://git-amd.tuebingen.mpg.de/amd-clmc/dg_tools/blob/master/src/CMakeLists.txt.
An example on how a simple control graph using the MotorController with the robot.device is shown in single_motor_main.py. Note that robot.device
is provided by the Dynamic Graph Manager automatically and initialized to talk to the real/simulated hardware. The robot.device is created from the yaml file's device specification. Especially, all the input and output signals are created on the robot.device
as described in the sensor
and control
part of the yaml file.