Rosparam in RqtGui
Hi, is there a way in Ros to implement a funcition to get/set parameter of rosparam server similar to rosservice in python?
Thanks
ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
This link should have all the information you need.
There are many ways to get:
global_name = rospy.get_param("/global_name")
relative_name = rospy.get_param("relative_name")
private_param = rospy.get_param('~private_name')
default_param = rospy.get_param('default_param', 'default_value')
# fetch a group (dictionary) of parameters
gains = rospy.get_param('gains')
p, i, d = gains['P'], gains['I'], gains['D']
And set:
rospy.set_param('a_string', 'baz')
rospy.set_param('~private_int', 2)
rospy.set_param('list_of_floats', [1., 2., 3., 4.])
rospy.set_param('bool_True', True)
rospy.set_param('gains', {'p': 1, 'i': 2, 'd': 3})
rospy.get_param('gains/P') #should return 1
You can do a lot of other things like delete params, check and see if a param exists, list all params, etc. All of it is covered in that link.
This might be of interest to. It looks like someone already had something like this but used the rx stuff (I just skimmed it, you might want to look closer).
Lastly, if you do build a plugin, please let people know about it here to prevent duplicate efforts. I also notice on that page that the description of the Node_Manager plugin says something about managing params, you might want to look at that to.
It looks like that only works for parameters that are setup with dynamic_reconfigure. "In the future, arbitrary parameters that are not associated with any nodes (which are not handled by dynamic_reconfigure) might become handled. However, currently as the name indicates, this pkg solely is dependent on dynamic_reconfigure that allows access to only those params latched to nodes."
Asked: 2014-08-05 06:06:26 -0600
Seen: 1,966 times
Last updated: Aug 05 '14
Do I need to know any specific computer language or framework to use ROS?
Is anybody in ROS community using PySide?
Any good examples of using dynamic_reconfigure for a python node?
is there a python equivalent of fromROSMsg/toROSMsg (pcl stack)
How to contributing python versions of tutorials? e.g. Tutorials for arm_navigation
How to recieve an array over Publisher and Subscriber? (Python)
Getting all parameter names using C++
Error assigning a python quaternion
Using python for automatically writing data in bag to csv file
Are you asking how to get/set parameters programmatically using python? Or are you asking how to get/set parameters using the rqt gui?
Programmatically using python because I need to create a rqt plugin