-
Notifications
You must be signed in to change notification settings - Fork 418
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
Odd parameter overrides' ordering when using wildcards #953
Comments
My opinion is that this should be the rule.
Yep, totally agreed. |
I was discussing a larger, breaking API change in Ideally, and if everyone agrees, I'd much like to revamp |
This behavior change introduced a problem in launch files: ...
Node(
...,
parameters: [parameter_file_path, {param1: value1, param2: value2}],
...,
)
... If the user doesn't explicitly pass the node name and namespace, we can't know the fully qualified node name in advance. In both cases, the issue is that we cannot override a parameter passed in the parameter file (which was using the fully qualified node name), no matter the ordering in which they are passed. IMO, we should change behavior again, so both wildcards and parameters with explicitly specified node fqn have the same priority. Last passed argument will always be the valid one. The other question is if we should backport that fix, as it's a behavior change. |
If we categorize this as buggy behavior (which I think it is), then I think backporting a fix should be okay. |
So, it's important to stick to a precedence in all client libraries. That's what the PRs that were aiming to address this issue did. Before that, it was UB. @ivanpauno Your argument is a valid one. I think we may get around it in an ABI compatible way by performing wildcard matching down in But I will say that:
isn't strictly true. It is impossible as long as you combine exact node FQNs in the parameter YAML file with command line parameter overrides without a node FQN. One could argue that if you knew enough about the executable to hardcode node FQNs in that file, you know enough to provide it in the |
@clalancette @hidmic friendly ping. |
I'm fine with using command line order instead of a wildcard precedence. It's not necessarily worst. But I do think that |
Sorry, I missed the previous comments and I pinged again unnecessarily 😁.
We can pass the node name and namespace to
Sounds good. |
One more thought about this. At the time, best match-based precedence made sense to me. It made it easy to specialize configuration with no regard for order. But I could also imagine someone trying to mass apply a change after all other configuration has been provided. So, what about respecting order but adding a CSS' |
I think I still stand behind my previous thought that specificity should override more general terms. That is, a specific node name should override the wildcard, because a common use case is to have a parameter that is the same across nodes, but one that is different. While using command-line ordering is also valid (assuming it is consistent), I think it is more surprising. If we assume that that logic is what we want, it sounds like the technical issue here is that we are applying the ordering too early in the process. We may have to change it so that we delay the applying of parameters until much later in the process, until we know what the fully-qualified node name is. That may be easier said than done, but I think we should shoot for a good user experience. |
I think that's technically impossible. If the user doesn't specify the node name and namespace at launch time, The only thing that can be done in launch to improve the situation was proposed in ros2/launch_ros#154. |
I don't know the specifics here, but how can this be the case? At some point during the startup of a process, we have to know the fully-qualified node name. Otherwise how would we get that information for |
When executing the command, the node name and namespace can't be known except remapping rules for then (_ns, _name) are passed, as they are hard-coded in the executable. Parameters can also be modified at runtime with services. Passing parameters through command line or at runtime will not necessarily produce the same behavior. (edit) To sum up: we must know the node fqn before running the executable to be able to pass the correct arguments without using a wildcard. Replacing passing arguments through the command line with runtime service calls won't result in the same behavior. |
I'm still trying to wrap my head around the issue. Is it possible to give wildcard params passed on the command line higher precedence than wildcard params passed in a YAML file? Then |
It isn't impossible, but |
I don't know if it's intuitive, but I don't think it's counter-intuitive 😄 |
Maybe that's not a bad idea: my_node:
ros__parameters:
my_int: 42
/**:
ros__parameters:
my_int: 43 In that case, I would be really surprised if the parameter using a wildcard overrides the one using a fqn.
In that case, I'm really not surprised. It feels pretty natural besides not using |
@ivanpauno To clarify, are you saying that it's not that surprising if the assigned value was |
Can I suggest here that we instead change this to a design document (or modification to one) now? I think I've seen at least 3 or 4 different proposals here (though some of them overlap), and it would be good to consolidate all of that down to one document. Once we have agreement on the design document, then we can think about how to implement it. What do people think? |
👍 to @clalancette proposal. |
Two changes here: 1. Update the list of DISTRIBUTIONs affected by this Mimick limitation 2. Update the mechanism to specifically skip the affected test instead of skipping the entire binary. Only one of the nine tests in that binary are affected. Signed-off-by: Scott K Logan <logans@cottsay.net>
Bug report
Required Info:
Steps to reproduce issue
Write a parameter YAML file,
explicit_params.yaml
, settinguse_sim_time
explicitly referring to a node:Write a parameter YAML file,
wildcard_params.yaml
, settinguse_sim_time
implicitly using wildcards:Run a
talker
node:Passing the parameter YAML file using wildcards first:
Passing the parameter YAML file being explicit first:
Expected behavior
I'm not sure if we've ever fully specified behavior when using wildcards.
If wildcards have lower precedence than fully qualified names, command line order should not matter i.e.
use_sim_time
alwaysfalse
.If command line order is respected,
use_sim_time
should befalse
in the first case,true
in the second case.Actual behavior
First given override wins.
Additional information
This is inconsistent with how it works for
rclpy
nodes, where command line order is respected. Looking at bothrclpy
andrclcpp
implementations, it looks behavior emerged by pure chance. We should probably be matching wildcards where we can enforce a consistent precedence, down inrcl
.The text was updated successfully, but these errors were encountered: