-
Notifications
You must be signed in to change notification settings - Fork 81
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
Support both parameter file configurations for composable nodes #259
Conversation
Signed-off-by: Rebecca Butler <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like a reasonable approach to me:
- Could you add a test for it?
- Could you add a release note related to this?
try: | ||
param_dict = param_dict[node_name_with_slash]["ros__parameters"] | ||
except KeyError: | ||
pass |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rebecca-butler hmm, a few questions about behavior:
- What if no node name was specified for the node on launch?
- What if there's no entry in the parameter file for that node name?
- What if a wildcard was used in the file?
Signed-off-by: Rebecca Butler <[email protected]>
I've written a few test cases. While doing this I realized there's another format we should probably support:
I changed the implementation so now it combines all the keys that come before "ros__parameters" to get the full name. |
@hidmic to address your questions:
What is the expected behaviour for this case? Currently if no node name is provided, then parameter files using the
We only remove the
Good point, I didn't consider that. I've added support for the |
Assuming Note this is not the case when launching plain
So long as
For parameters I think not. There's a design document for wildcard matching in remapping rules, from which I believe parameter wildcards are inspired on. Anyhow, IIRC |
Preferedly, we should log a warning in that case, it seems to be something that can be detected |
) | ||
]) | ||
request = mock_component_container.requests[3] | ||
assert get_node_name_count(context, '//test_node_name') == 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think two leading slashes should be a valid node name, I would have expected the name to be /test_node_name
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think get_node_name_count()
expects the name to be of the form /ns/node_name
, so if the namespace is empty, it has to be //node_name
🤷 It doesn't work without the extra slash.
test_launch_ros/test/test_launch_ros/actions/test_load_composable_nodes.py
Show resolved
Hide resolved
Signed-off-by: Rebecca Butler <[email protected]>
Signed-off-by: Rebecca Butler <[email protected]>
Signed-off-by: Rebecca Butler <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kudos for all those tests !
Signed-off-by: Jacob Perron <[email protected]>
Signed-off-by: Jacob Perron <[email protected]>
I've address the most recent comments. Ready for another round of review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall LGTM. __format_dict
implementation is a bit unusual but OK.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have some minor comments, LGTM!
- Rename private function for dealing with ros__parameters entries - Keep recursive parameters internal to function - Skip evaluating parameters if dictionary is empty - Use isinstance - Strip trailing and leading '/' from node namespace Signed-off-by: Jacob Perron <[email protected]>
Signed-off-by: Jacob Perron <[email protected]>
@ros-pull-request-builder retest this please |
We actually do this for the case of multiple entries like this: /ns_1: /node_1: ros__parameters: param_1: 1 param_2: 2 /**: ros__parameters: param_2: 22 param_3: 33 Signed-off-by: Jacob Perron <[email protected]>
RPr job is failing because it can't find the test data file I can't reproduce locally. |
I tried this as well, couldn't reproduce the error. It is weird cause there are other parameter files as well, which seem to be working fine. |
Rather than reusing the test file that is used in test_node. Signed-off-by: Jacob Perron <[email protected]>
On a whim, I've pushed a commit that makes the failing test use a copy of |
The job passes now... but why? 😕 |
This enhancement does a great help to the project I'm working on which is based on ROS Galactic. So I wonder when will it be updated to And thank you for your great work on ROS. |
The changes to |
I just ran into this on Galactic as well. Seems like an odd and unexpected thing to change parameter config between regular nodes and components. Thanks to everyone here who worked on this! (awaiting back-patch but glad to have a work-around until then.) |
Closes #156. With these changes, loading a composable node will work with both parameter file configs:
and
Signed-off-by: Rebecca Butler [email protected]