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
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."
Please start posting anonymously - your entry will be published after you log in or create a new account.
Asked: 2014-08-05 06:06:26 -0500
Seen: 1,561 times
Last updated: Aug 05 '14
How to display only selected topics in rqt topic monitor
ros2 run demo_nodes_py listener not working
swapping between two topics in rqt_image_view
How to run rospy.spin() and Tkinter.mainloop() at the same time?
How do I use eclipse with python (pydev)
Publisher/subscriber in one python script
roslaunch Python arg substitution finds wrong package folder path?
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