EnricoMingo/gazebo_yarp_plugins — pull request #8 by traversaro (2013-10-26 07:24:32+00:00)
Title: Loading parameters from Yarp Configuration files

This pull request implements the loading of the parameters (joint actuated, pids, port names, ...) from yarp .ini files.

The general design is that the element in the sdf contains a child named that is the URI of the .ini yarp configuration file ( http://wiki.icub.org/yarpdoc/yarp_config_files.html ).

This file contains the parameters necessary to load the device (such as "device", "subdevice" and "name") and also parameters useful for the device itself (such as the pid values). You can access this information from the device trough the "yarp::os::Property plugin_parameters" attribute of the coman class.

For an example check: https://github.com/traversaro/gazebo_yarp_plugins/blob/2f3fe2ddeb7f350373f9c6dee70f9d2ee27d780c/world/yarp_gazebo.world
In this example the .ini file URI is a path in model directory, so for executing it correctly it is necessary to add a coman_gazebo.ini (such as this one: https://gist.github.com/traversaro/7165103 ) to the /conf/ subdirectory of model directory of coman_urdf (I guess that the script that generate the sdf model in iit-coman-ros-pkg
can be used to put it in the right place).

I did not updated the coman.tar.gz archive in this repo because I guess having multiple heavy binary files in the history of the repository could cause problems in the future (by doing git clone you download all the history of the repo and so every version of a binary file).

If you try to run the plugin without providing a .ini file or providing a not compliant one, the plugin fallbacks to the old default option, so you can continue to work with as nothing was changed.

Unfortunately there are still some issue that prevent to have multiple plugins running simultaneously (that is necessary to simulate multiple control board such as in the iCub) for example gazebo_pointer_wrapper that is a static object. I will investigate on this next week.

Using the .ini that I provide should also solve an incongruence between the pid values serialization and the joint serialization that I was obtaining in gazebo, between the two serialization I choose the serialization torso left_left right_leg left_arm right_arm as Enrico has done here: https://github.com/EnricoMingo/gazebo_yarp_plugins/blob/master/config/pid.ini .

One last thing: there is a reason for which we have all the implementation of the yarp::dev::coman functions in the header file instead of the cpp file?