-
Notifications
You must be signed in to change notification settings - Fork 192
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clarify ros2 arguments precedence #289
base: gh-pages
Are you sure you want to change the base?
Conversation
Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com>
@hidmic can you make a first pass? |
Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com> Co-authored-by: Michel Hidalgo <michel@ekumenlabs.com>
Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com> Co-authored-by: Michel Hidalgo <michel@ekumenlabs.com>
Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com>
Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com> Co-authored-by: Michel Hidalgo <michel@ekumenlabs.com>
Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com>
As the starting point of what rules are currently in place, this is great. Thanks @ivanpauno . Where we want to go is harder to say. I would say that there are 2 main problems pointed out here:
I'm going to concentrate on the second one for now (the first one is unfortunate, but at least documented now). The problem as I understand it is that launch does not (and cannot) know the fully-qualified node name. That's because the node may have hard-coded node names and even namespaces internally to itself. Is that a good summary of the problem? If that's the case, I'm wondering what would happen if we end up making launch a bit dumber. That is, launch would just pass along the arguments exactly as it had them. Then the precedence rules would be figured out by the rcl/rclcpp layer inside of the node, and the parameters applied. This takes launch completely out of the equation when doing overrides, and concentrates all of the logic of overrides in one place (it needs to be in rcl/rclcpp for the command-line case anyway). I'm sure there are complications to the above, so I'm looking for feedback on why that would or wouldn't work. |
The current implementation tries to be as dumb as possible. When launch generates a command from: Node(
package='my_pkg',
executable='my_exec',
name = 'my_node',
parameters=['path/to/file', {'my_param': 'my_value}]
) the result can be: (op A) /path/to/executable/in/package --ros-args -r __node:=my_node --params-file path/to/file -p my_param:=my_value or: (op B) /path/to/executable/in/package --ros-args -r __node:=my_node --params-file path/to/file --params-file path/to/tmp/param/file where: # path/to/tmp/param/file contents
/**:
ros__parameters:
my_param: my_value Currently, launch is doing op B, but I'm not sure of what modifications in Support to wildcards in parameter files was added to solve the problem of not knowing the fully qualified node name at launch time (see ros2/launch_ros#35, ros2/launch_ros#4). Considering that that was the main goal of wildcards, maybe we could make them have the same precedence than parameter assignments targeting a specific node. The problem is that that is a bit counter intuitive (I find it super counter intuitive, but it would solve the launch file use case). |
Reviewing proposed changes for additional wildcard support (ros2/rclcpp#1265) brought me here. I've opened #303 to document how wildcards can be used in parameter files. I have not addressed precedence (like this PR aims to do). |
Adds a section to the
command line arguments
article, clarifying how precedence currently works.Adds a discussion section exposing inconsistencies and weird interaction with launch files.
The goal of this PR is to state how precedence currently works to kick off a discussion on how it should work.
After that discussion takes place, I will update the document with the conclusion.
Follow up of ros2/rclcpp#953.