-
Notifications
You must be signed in to change notification settings - Fork 160
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
Can't load non-absolute node name in parameter file #648
Comments
I believe this is done on purpose, as the initial behavior allowed both, but after some discussion #590 (comment) and subsequent messages this was the conclusion: #600 |
Isn't there a mismatch in the way we load parameters then? I can pass the same yaml file to a node within a launch file without the leading slash, but if I later on start a node and load that parameter file via |
I don't know enough about all the use cases, but yeah sounds like a mismatch, which gives more importance to what I requested here ros2/rclpy#671 since basically the same code is reimplemented in multiple places, mismatches like this are bound to happen. |
pinging @audrow @ivanpauno @clalancette |
Maybe, I really don't know why I think we can copy what rcl does in |
both match. i guess |
This has been fixed with ros2/rclpy@3053a8a
### ros2 param load
root@tomoyafujita:~/ros2_ws/colcon_ws# ros2 run demo_nodes_cpp parameter_blackboard
[INFO] [1698706220.128919541] [parameter_blackboard]: Parameter blackboard node named '/parameter_blackboard' ready, and serving '6' parameters already!
...
root@tomoyafujita:~/ros2_ws/colcon_ws# cat params.yaml
parameter_blackboard:
ros__parameters:
foo: bar
root@tomoyafujita:~/ros2_ws/colcon_ws# ros2 param load /parameter_blackboard params.yaml
Set parameter foo successful
root@tomoyafujita:~/ros2_ws/colcon_ws# ros2 param get /parameter_blackboard foo
String value is: bar
### --ros-args --params-file params.yaml
root@tomoyafujita:~/ros2_ws/colcon_ws# ros2 run demo_nodes_cpp parameter_blackboard --ros-args --params-file params.yaml
[INFO] [1698706337.110460136] [parameter_blackboard]: Parameter blackboard node named '/parameter_blackboard' ready, and serving '7' parameters already!
...
root@tomoyafujita:~/ros2_ws/colcon_ws# ros2 param get /parameter_blackboard foo
String value is: bar
### ros2 param load
root@tomoyafujita:~/ros2_ws/colcon_ws# ros2 run demo_nodes_cpp parameter_blackboard
[INFO] [1698706519.744738775] [parameter_blackboard]: Parameter blackboard node named '/parameter_blackboard' ready, and serving '6' parameters already!
...
root@tomoyafujita:~/ros2_ws/colcon_ws# cat params.yaml
/parameter_blackboard:
ros__parameters:
foo: bar
root@tomoyafujita:~/ros2_ws/colcon_ws# ros2 param load /parameter_blackboard params.yaml
Set parameter foo successful
root@tomoyafujita:~/ros2_ws/colcon_ws# ros2 param get /parameter_blackboard foo
String value is: bar
### --ros-args --params-file params.yaml
root@tomoyafujita:~/ros2_ws/colcon_ws# ros2 run demo_nodes_cpp parameter_blackboard --ros-args --params-file params.yaml
[INFO] [1698706478.171368734] [parameter_blackboard]: Parameter blackboard node named '/parameter_blackboard' ready, and serving '7' parameters already!
...
root@tomoyafujita:~/ros2_ws/colcon_ws# ros2 param get /parameter_blackboard foo
String value is: bar
### ros2 param load
root@tomoyafujita:~/ros2_ws/colcon_ws# ros2 run demo_nodes_cpp parameter_blackboard
[INFO] [1698706679.815384266] [parameter_blackboard]: Parameter blackboard node named '/parameter_blackboard' ready, and serving '6' parameters already!
...
root@tomoyafujita:~/ros2_ws/colcon_ws# cat params.yaml
/**/parameter_blackboard:
ros__parameters:
foo: bar
root@tomoyafujita:~/ros2_ws/colcon_ws# ros2 param load /parameter_blackboard params.yaml
Set parameter foo successful
root@tomoyafujita:~/ros2_ws/colcon_ws# ros2 param get /parameter_blackboard foo
String value is: bar
### --ros-args --params-file params.yaml
root@tomoyafujita:~/ros2_ws/colcon_ws# ros2 run demo_nodes_cpp parameter_blackboard --ros-args --params-file params.yaml
[INFO] [1698706712.118549727] [parameter_blackboard]: Parameter blackboard node named '/parameter_blackboard' ready, and serving '7' parameters already!
...
root@tomoyafujita:~/ros2_ws/colcon_ws# ros2 param get /parameter_blackboard foo
String value is: bar |
Bug report
I have a parameter file in the style of
Expected behavior
ros2 param load
works to load the correct parameters for nodesome_node_name
even though the node name is not specified as absolute.Actual behavior
error is raised:
param file does not contain parameters for /some_node_name, only for nodes: dict_keys(['some_node_name'])
Note that there's a simple mismatch between the node names given that one is absolute.
Additional information
The reproducer here is based on a ros2-control example in which I would like to use the spawner script to spawn a controller with a given type and a parameter file.
@v-lopez fyi
The text was updated successfully, but these errors were encountered: