ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A answers.ros.org
Ask Your Question
0

Understanding Parameters - Changing & Using New Value On The Fly

asked 2022-03-01 09:23:45 -0500

Green01 gravatar image

I am new to ROS. I am using Python 3 and ROS Noetic on Ubuntu 20.04. I need help understanding parameters.

Currently, I use a launch file to set parameters and in the C++ publisher code I do a getParam to get the value of the parameter from the Parameter Server. This works fine.

Now, I want to create a rqt GUI and from the GUI change the value of a parameter, get the new value in the publisher code and act on it, without restarting the Parameter server or publisher.

Can I do this with setParam() and getParam()? I've read some about dynamic_reconfigure. Is that what I need to use rather than setParam()/getParam()?

Any help getting me started in the right direction is appreciated!

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2022-03-01 09:57:55 -0500

Delb gravatar image

If you want to change parameters values during the node execution then yes dynamic_reconfigure is what you are looking for. Moreover you have the package rqt_reconfigure creating the GUI for you.

You should check #q175010 comparing server parameters and dynamic reconfigure.

edit flag offensive delete link more

Comments

Thanks for the feedback. That is a helpful link to the question comparing server parameters and dynamic reconfigure as I hadn't found that question in my searches.

Green01 gravatar image Green01  ( 2022-03-01 12:26:43 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2022-03-01 09:23:45 -0500

Seen: 29 times

Last updated: Mar 01