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

Revision history [back]

click to hide/show revision 1
initial version

answered 2012-12-06 10:25:26 -0600

joq gravatar image

For parameters that are only processed once at initialization, performance is not an issue. If there are a lot of them to set, YAML files are a good choice. They are easy to read and easy to edit. You can conveniently store them in packages. For a node with only a few parameters, it may be easier to set them in a launch file.

Sensible default values help keep things simple. Unused parameters can default to something like an empty string, where appropriate.

The only performance issue is when parameters need to be updated while the node is operating. Use getParamCached() instead of getParam() in that case, to avoid bogging down the parameter server. Or, use the excellent dynamic_reconfigure package, which will invoke a callback in your node whenever a parameter changes.

For parameters that are only processed once at initialization, performance is not an issue. If there are a lot of them to set, YAML files are a good choice. They are easy to read and easy to edit. You can conveniently store them in packages. For a node with only a few parameters, it may be easier to set them in a launch file.file. The rosrun command line is mostly good when running a node separately for testing or debugging.

Sensible default values help keep things simple. Unused parameters can default to something like an empty string, where appropriate.

The only performance issue is when parameters need to be updated while the node is operating. Use getParamCached() instead of getParam() in that case, to avoid bogging down the parameter server. Or, use the excellent dynamic_reconfigure package, which will invoke a callback in your node whenever a parameter changes.