Skip to content
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

Node parameters not parsed correctly when using python composite launch [Foxy] #324

Open
Imaniac230 opened this issue May 9, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@Imaniac230
Copy link

Imaniac230 commented May 9, 2024

Is your feature request related to a problem? Please describe.
This also is related to the unresolved part of #212 (comment).

While experimenting with my additions from #323 on the ros2-foxy branch, I stumbled upon this issue from launch_ros ros2/launch_ros#156 when launching the composite mode python launchfile (sensor.composite.launch.py). The behavior is exactly the same as described in the launch_ros issue:

  • composite nodes launch correctly only when the namespace, node name, and ros__parameters keys are completely removed from the config (os_sensor_cloud_image_params.yaml), otherwise the sensor composite node fails to launch.

To Reproduce

  1. Checkout ros2-foxy (tested from commit 1d7d506) and configure required parameters in os_sensor_cloud_image_params.yaml
  2. Colcon build with ROS2 foxy and source the current workspace.
  3. Run ros2 launch ouster_ros sensor.composite.launch.py

Expected behavior
All composable nodes launch correctly.

Actual behavior
Sensor node fails with missing parameter error:

[component_container_mt-1] [ERROR] [1715262197.518517912] [ouster.os_sensor]: Must specify a sensor hostname

Describe the solution you'd like
The issue was resolved by ros2/launch_ros#259 in humble and onward (which added support for both types of syntax in .yaml files), but does not appear to be back-ported to foxy (the fixing commit is not present in the foxy branch history). I am not sure if the fix will get to foxy eventually, but I think a quick workaround could be quite straightforward with a pre-processing step that would be added into the launch file:

  • First possible solution:
    1. load all data from the params file,
    2. remove any occurences of the ros__parameters key and the keys one line above it (this should be quite consistent, since the ros__parameters key doesn't change),
    3. check for any repeating duplicates and keep only the first occurence,
    4. finally, pass these pre-processed parmeters to all composite nodes.
  • Second possible solution:
    1. load all data from the params file,
    2. for each node, extract only the raw parameters (after ros__parameters),
    3. pass these parameters to each node respetively,
  • Another solution would be to have a separate params file for the composite launch in foxy, but I think this would be more messy.

Targeted Platform (please complete the following information only if applicable, otherwise dot N/A):

  • ROS version/distro -> foxy
  • Operating System -> 5.15.0-105-generic #115~20.04.1-Ubuntu
  • Architecture -> x86_64
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants