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 -0500
Seen: 1,891 times
Last updated: Aug 05 '14
Instance settings can't get restored (rqt)
AttributeError's when running Python scripts
Unsuitable PythonLibs building catkin (Mac OS X 10.9.3)
Dependency on python module `sys`
service does not exist - app_manager rapp, hydro, python, turtlebot
How to use a service to make a snapshot?
rostest & Python - Multiple Test Fixtures In Single File
RQT command does not display plugins after clean install
Including both Python and C++ Plugins in a single RQT Plugin
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