orocos/rtt_ros_integration — pull request #25 by meyerj (2014-02-21 18:44:35+00:00)
Title: rtt_dynamic_reconfigure

This pull request adds the rtt_dynamic_reconfigure package.

It provides a RTT service that implements a [dynamic_reconfigure](http://wiki.ros.org/dynamic_reconfigure) server to configure the owning TaskContext. There are two possible usages:
* Write a component-specific [dynamic_reconfigure config file](http://wiki.ros.org/dynamic_reconfigure/Tutorials/HowToWriteYourFirstCfgFile) with the same parameter names than the properties that should be configured. Descriptions, minimum and maximum values are taken from the config file. A special service plugin can simply be created with the `RTT_DYNAMIC_RECONFIGURE_SERVICE_PLUGIN` macro:

```cpp
#include
#include // generated by dynamic_reconfigure

using namespace my_package;

template<>
struct rtt_dynamic_reconfigure::Updater {
static bool propertiesFromConfig(MyConfig &config, uint32_t level, RTT::PropertyBag &target)
{
// ...
}

static bool configFromProperties(MyConfig &config, const RTT::PropertyBag &source)
{
// ...
}
};

RTT_DYNAMIC_RECONFIGURE_SERVICE_PLUGIN(MyConfig, "reconfigure")
```
Properties that exist in the config file but not in the component can be created automatically depending on the implementation of `propertiesFromConfig()`.

See [rtt_dynamic_reconfigure_tests](https://github.com/meyerj/rtt_ros_integration/blob/rtt_dynamic_reconfigure/tests/rtt_dynamic_reconfigure_tests) for a simple example.

* Use the special `AutoConfig` type. `rtt_dynamic_reconfigure` already provides a `reconfigure` service itself, that tries to convert the existing properties in a dynamic_reconfigure config description. Minimum, maximum and default values can be set in the `reconfigure.min`, `reconfigure.max` and `reconfigure.default` property bags.

The supported property types are limited.

Open issues:
- [ ] Add documentation
- [ ] Make parameter/property updates real-time safe
- [ ] Fully support description updates after having added properties or updated the meta information