-
Notifications
You must be signed in to change notification settings - Fork 421
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
Cannot load yaml config to composable node in dashing #715
Comments
A minimal example composable node: test.zip. I skipped over some important bits to make the node actually composable to make it compilable on crystal and dashing. If you compile and run: |
If I understand your issue correctly, this is an intentional change in behavior with #495. Basically, you should update your code to use The other two options to consider are:
I recommend you use Sorry, we haven't yet updated the migration page on the dashing doc page: https://index.ros.org/doc/ros2/Releases/Release-Dashing-Diademata/#changes-since-the-crystal-release But we're working on that right now in preparation for pushing out changes for our API freeze. |
Indeed, it works after declaring all the parameters beforehand. Thanks. Maybe a call to |
I am still struggling with configuring a composable node. If I launch a composable node via: def generate_launch_description():
composable_node = ComposableNode(
node_name='apriltag',
package='apriltag_ros', node_plugin='AprilTagNode',
remappings=[("/apriltag/image", "/camera/image"), ("/apriltag/camera_info", "/camera/camera_info")],
parameters=[get_package_share_directory('apriltag_ros')+"/cfg/tags_16h5_all.yaml"])
container = ComposableNodeContainer(
node_name='tag_container',
node_namespace='apriltag',
package='rclcpp_components',
node_executable='component_container',
composable_node_descriptions=[composable_node],
output='screen'
) I now get the parameters correctly listed as:
i.e. parameter However, it is not recognising the value in the configuration file: apriltag:
apriltag:
ros__parameters:
size: 0.162 # tag edge size in meter
|
It should raise an exception: rclcpp/rclcpp/include/rclcpp/node.hpp Lines 623 to 624 in d399fef
Unless you're using If you're using
Are you using |
Yes, I was using |
I'll try to reproduce this soon (or maybe one of the other maintainers can if I can't), but there are tests for this case (getting values from initial parameter values), e.g.: rclcpp/rclcpp/test/test_node.cpp Lines 384 to 390 in d399fef
But it could be an issue with composition specifically, or yaml parsing, or the particular invocation you're using... We'll have to see. |
I created a simple composable node with launch files: test.zip I can load the node successfully with configuration using:
However, loading the config from the yaml file via the |
To load the yaml file in the launch script, I need to provide a configuration file without node name and without some_int: 42
a_string: "Hello world" although the yaml syntax is given different at https://github.com/ros2/rcl/tree/master/rcl_yaml_param_parser. Is this intended? It would be good if configuration files could be reused for the same node (with the same name), regardless if it is launched from a standalone node, via the component manager or via the launch file. However, in this case the launch file won't deal with list. E.g. adding: some_integers: [1, 2, 3, 4] to the configuration causes: |
Hey @christianrauch, @wjwwood and I spent some time discussing this today, and here's the conclusion for the The way that you are currently passing the parameters to the load command The current implementation of the
I think that there are two potential short-term workarounds (without requiring major changes in the way that the
This will then pass in parameters similar to the
And then pass that in as
The caveat on approach 1 is that any additional loose parameters passed via the So in the case of:
The parameter
The parameter |
According to discussion in RCLCPP, for ROS2 Dashing release, "declare parameter" is expected to load configures from yaml file. See detail discussion here: ros2/rclcpp#715 Signed-off-by: Sharron LIU <sharron.liu@intel.com>
Fix issue intel#55 According to discussion in RCLCPP, for ROS2 Dashing release, "declare parameter" is expected to load configures from yaml file. See detail discussion here: ros2/rclcpp#715 Signed-off-by: Sharron LIU <sharron.liu@intel.com>
Fix issue intel#55 According to discussion in RCLCPP, for ROS2 Dashing release, "declare parameter" is expected to load configures from yaml file. See detail discussion here: ros2/rclcpp#715 Signed-off-by: Sharron LIU <sharron.liu@intel.com>
@mjcarroll any update on this? The last of the discussion looks to be before the dashing release. We're coming up on Foxy and this feels like something that should be included in the next LTS. |
I cannot understand why I'm facing this issue too: I could not understand why my component manually composed in a launch file did not correctly load the parameters from the YAML files and I finally found this issue. I think that the workarounds proposed by @mjcarroll are good, but I cannot use both of them:
Other solutions? PS I'm using Eloquent... |
I have been bitten by this too :( |
Me too! I ran into it in Foxy. We cannot use the same param files for |
The fact that in launch the parameters file format is different when using The other issues mentioned here seem to have been resolved. |
* Fix missing call fini() for lifecycle_transition and node in test_rcl_lifecycle Signed-off-by: Barry Xu <barry.xu@sony.com> * Fix error overwritten while allocator is Nullptr. Signed-off-by: Barry Xu <barry.xu@sony.com> * Optimize used variables Signed-off-by: Barry Xu <barry.xu@sony.com>
* use rclcpp::Node for generic pub/sub Signed-off-by: Karsten Knese <Karsten1987@users.noreply.github.com> * address review comments Signed-off-by: Karsten Knese <Karsten1987@users.noreply.github.com> * export symbols on windows Signed-off-by: Karsten Knese <Karsten1987@users.noreply.github.com> * use rclcpp logging macros Signed-off-by: Karsten Knese <Karsten1987@users.noreply.github.com> * do not use node for error logging Signed-off-by: Karsten Knese <Karsten1987@users.noreply.github.com>
Bug report
I used to load a yaml configuration file into a composable node with ROS crystal that is started from a standalone executable. This stopped working after porting to dashing. The lack of parameter file loading examples for composable nodes also makes debugging this more difficult.
Required Info:
Steps to reproduce issue
AprilTag2Node::AprilTag2Node(rclcpp::NodeOptions options) : Node("apriltag2", "apriltag", options.use_intra_process_comms(true))
ros2 run your_package your_node __params:=<path_to>/config.yaml
Expected behavior
A call to
get_parameter_or<double>("size", tag_edge_size, 2.0);
within the node should provide the value of the parameter in the yaml file.Actual behavior
The default parameter is returned.
Additional information
The main change for porting from crystal to dashing is the adaptation of the node options:
This should keep the namespace intact and not change the behaviour of setting parameters.
The text was updated successfully, but these errors were encountered: