rosparams vs. command line arguments for initialization
In my understanding, nodes can get initialization arguments in two ways:
- rosrun or roslaunch xml files can pass command line arguments straight to the main method
- the node can use the ros parameter server to get parameters that have been loaded by rosparam or roslaunch loading a yaml config file.
Are there any benefits to one over the other? Perhaps in terms of performance (I plan to use ROS on embedded devices), flexibility, or some other way I'm not thinking of? Or is there a best practice?
I see a clear case for yaml in the case of things like motor parameters, since you may want to tweak them while the node is running and save the value you ended up with for subsequent runs.
But what about a parameter that will not change during execution such as a parameter that specifies whether a node is left or right handed?
Or what about parameters that are not always used? For example, a node type could be 'tcp' or 'serial.' It then either needs an IP address or a port, but not both.