[ros-users] [Discourse.ros.org] [Next Generation ROS] Initializing ROS 2 parameters

William Woodall ros.discourse at gmail.com
Thu Dec 28 18:05:37 UTC 2017



> How can you set a parameter to an initial value when launching a node?

Indeed, we do not have that yet. But that's on our short list of things to do, since something like roslaunch isn't that useful if you cannot remap things and set parameters from the start of a node.

We first want to tie up some loose ends with parameters (https://github.com/ros2/ros2/issues/432) and then we'll do setting parameters from at least the command line (when you have your own executable).

Even with that we still need to find a way to support initializing the parameters with the "nodelet" style of loading a node, where you run a process and then dynamically load your node into that process with a service call. As well as other patterns, like when you have multiple nodes in a single executable.

[quote="nerian, post:1, topic:3542"]
I understand that ROS 2 will use a python based launch system, which isnt yet available (is that still so?).
[/quote]

That's correct, we have something that can run and manage processes (called [`launch`](https://github.com/ros2/launch)), but not the equivalent of "roslaunch" which can actually run nodes and take remappings for topics or set parameters or place whole nodes and other launch files into a namespace.

[quote="nerian, post:1, topic:3542"]
I would have assumed that parameters can be set through command line arguments, like it was possible in ROS 1. Certainly the ROS 1 syntax doesnt work anymore. I wasnt able to locate any code that parses parameters in the RCL github repository. Is this functionality not yet implemented? Is it recommended to just use ordinary command line arguments instead (through getop etc.)?
[/quote]


We will support that, but likely not exactly like the ROS 1 syntax (since we can have more than one node per executable now). We don't have anything implemented yet, but as I said, it's on the todo list. For now the best workaround is as you suggested, parsing your own arguments and setting the parameters to that.





---
[Visit Topic](https://discourse.ros.org/t/initializing-ros-2-parameters/3542/4) or reply to this email to respond.




More information about the ros-users mailing list