ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Can I dynamically set a parameter for c++ node?

asked 2013-02-22 10:14:17 -0600

AdrianPeng gravatar image

I have c++ node running, I am wondering can I change value of a parameter(define value in launch file) dynamically in that node(which means take effect without relaunch the launch file)?

Thanks in advance!

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2013-02-22 10:24:57 -0600

You can change the parameter on the parameter server anytime you want, but unless your node checks for changes, it won't know about it. For values that you expect to change during execution, dynamic_reconfigure is a better option.

edit flag offensive delete link more

Comments

1

Also, you can call getParamCached() anytime a new value might be worth using. Don't use getParam() in that case, it would hammer the parameter server too hard.

joq gravatar image joq  ( 2013-02-22 13:56:57 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2013-02-22 10:14:17 -0600

Seen: 1,743 times

Last updated: Feb 22 '13