ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
The answer to http://answers.ros.org/question/57498/notify-changes-to-dynamic_reconfigure/ has a line (and the context is useful also, but this is the key thing I assume causes the values as seen in rqt_dynamic_configure or elsewhere to be changed):
dynamic_reconfigure_server.updateConfig(config);
2 | No.2 Revision |
The answer to http://answers.ros.org/question/57498/notify-changes-to-dynamic_reconfigure/ has a line (and the context is useful also, but this is the key thing I assume causes the values as seen in rqt_dynamic_configure or elsewhere to be changed):
dynamic_reconfigure_server.updateConfig(config);
Update
This is something I just tried in python that didn't require the node hosting the server to call its own set_parameters service (and thus requiring multiple threads and mutex protection)
self.srv = Server(FooConfig, self.callback)
config = self.srv.config.copy()
config.x = rospy.get_param("x", 0.0);
self.srv._change_config(config, 0)
It is hacky using the _change_config
, and probably can both change without warning and fail in unexpected ways (there is a mutex around it one use of it in the server source).
The server has an update_configuration(self, changes)
method that may be better, but I don't know how to create the changes parameter yet.
3 | No.3 Revision |
The answer to http://answers.ros.org/question/57498/notify-changes-to-dynamic_reconfigure/ has a line (and the context is useful also, but this is the key thing I assume causes the values as seen in rqt_dynamic_configure or elsewhere to be changed):
dynamic_reconfigure_server.updateConfig(config);
Update
This is something I just tried in python that didn't require the node hosting the server to call its own set_parameters service (and thus requiring multiple threads and mutex protection)
self.srv = Server(FooConfig, self.callback)
config = self.srv.config.copy()
config.x = rospy.get_param("x", 0.0);
self.srv._change_config(config, 0)
It is hacky using the _change_config
, and probably can both change without warning and fail in unexpected ways (there is a mutex around it one use of it in the server source).
The server has an update_configuration(self, changes)
method that may be better, but I don't know how to create the changes parameter yet.
4 | No.4 Revision |
The answer to http://answers.ros.org/question/57498/notify-changes-to-dynamic_reconfigure/ has a line (and the context is useful also, but this is the key thing I assume causes the values as seen in rqt_dynamic_configure or elsewhere to be changed):
dynamic_reconfigure_server.updateConfig(config);
Update
This is something I just tried in python that didn't require the node hosting the server to call its own set_parameters service (and thus requiring multiple threads and mutex protection)
self.srv x = Server(FooConfig, self.callback)
rospy.get_param("z", 0.0)
config y = self.srv.config.copy()
rospy.get_param("z", 0.0)
config.x = rospy.get_param("x", 0.0);
self.srv.update_configuration({\
self.srv._change_config(config, 0)
"x":x,
"y":y,
})
It This is hacky sort of shown in one tutorial, but the client is using it rather than going direct on the server.
I'd like to figure out how to do this in _change_config
, and probably can both change without warning and fail unexpected ways (there is a mutex around it one use of it in the server source).C++ now.
The server has an update_configuration(self, changes)
method that may be better, but I don't know how to create the changes parameter yet... though it looks like it is right in the tutorial http://wiki.ros.org/dynamic_reconfigure/Tutorials/UsingTheDynamicReconfigurePythonClient so I'll try that.