Package Description

Additional Links

Maintainers

Authors

ddynamic_reconfigure

The ddynamic_reconfigure package is a C++ extension of dynamic_reconfigure that allows modifying parameters of a ROS node using the dynamic_reconfigure framework without having to write cfg files.

Usage

Modifying in place a variable:

#include <ros/ros.h>
#include <ddynamic_reconfigure/ddynamic_reconfigure.h>
intmain(intargc,char**argv){// ROS init stageros::init(argc,argv,"ddynamic_tutorials");ros::NodeHandlenh;ddynamic_reconfigure::DDynamicReconfigureddr;intint_param=0;ddr.registerVariable<int>("int_param",&int_param,"param description");ddr.publishServicesTopics();// Now parameter can be modified from the dynamic_reconfigure GUI or other tools and the variable int_param is updated automaticallyint_param=10;//This will also update the dynamic_reconfigure tools with the new value 10ros::spin();return0;}

Modifying a variable via a callback:

#include <ros/ros.h>
#include <ddynamic_reconfigure/ddynamic_reconfigure.h>
intglobal_int;voidparamCb(intnew_value){global_int=new_value;ROS_INFO("Param modified");}intmain(intargc,char**argv){// ROS init stageros::init(argc,argv,"ddynamic_tutorials");ros::NodeHandlenh;ddynamic_reconfigure::DDynamicReconfigureddr;ddr.registerVariable<int>("int_param",10/* initial value */,boost::bind(paramCb,_1),"param description");ddr.publishServicesTopics();// Now parameter can be modified from the dynamic_reconfigure GUI or other tools and the callback is called on each updateros::spin();return0;}

Issues

Undefined reference to registerVariable or registerEnumVariable

These methods are templated, but the implementation is hidden, and there are explicit template instantiations for int, bool, double and std::string. If you are getting an undefined reference to one of these methods, make sure that you are passing parameters of this type.