0
$\begingroup$

I'm using composition to leverage IPC to convert ZED Cameras depth maps into virtual laser scans with the depthimage_to_laserscan package.

The problem is that the defauls QoS of the depthimage_to_laserscan::DepthImageToLaserScanROS component are not correctly set and I get this exception when starting the node:

component_container-3] [ERROR] [1701705850.520313066] [zed.zed_depth_to_laserscan]: Component constructor threw an exception: intraprocess communication is not allowed with a zero qos history depth value
[ERROR] [launch_ros.actions.load_composable_nodes]: Failed to load node 'depthimage_to_laserscan' of type 'depthimage_to_laserscan::DepthImageToLaserScanROS' in container '/zed/zed_depth_to_laserscan': Component constructor threw an exception: intraprocess communication is not allowed with a zero qos history depth value

Do you know any workaround to solve this problem?

This is the part of my launch file that generates the problem:

    # ZED Wrapper component
    zed_wrapper_component = ComposableNode(
        package='zed_components',
        namespace=camera_name_val,
        plugin='stereolabs::ZedCamera',
        name=zed_node_name,
        parameters=[
            # YAML files
            config_common_path,  # Common parameters
            config_camera_path,  # Camera related parameters
            # Overriding
            {
                'general.camera_name': camera_name_val,
                'general.camera_model': camera_model_val,
                'general.svo_file': svo_path,
                'general.serial_number': serial_number
            }
        ],
        extra_arguments=[{'use_intra_process_comms': True}]
    )

    # Depth to Laser scan component
    zed_cvt_component = ComposableNode(
        package='depthimage_to_laserscan',
        namespace=camera_name_val,
        plugin='depthimage_to_laserscan::DepthImageToLaserScanROS',
        name='depthimage_to_laserscan',
        parameters=[
            config_path_cvt,
            # Overriding
            {
                'output_frame': camera_depth_frame
            }],
        remappings=[
                ('depth', zed_node_name_val + '/depth/depth_registered'),
                ('depth_camera_info', zed_node_name_val + '/depth/camera_info')
            ],
        extra_arguments=[
            {
                'use_intra_process_comms': True
                }
            ]
    )

    # ROS 2 Component Container
    container = ComposableNodeContainer(
            name='zed_depth_to_laserscan',
            namespace=camera_name_val,
            package='rclcpp_components',
            executable='component_container',
            composable_node_descriptions=[
                zed_wrapper_component,
                zed_cvt_component
            ],
            output='screen',
    )
```
$\endgroup$

1 Answer 1

1
$\begingroup$

Actually, yes! The code just has to provide the QoS override as a valid option:


node->create_publisher(
  "chatter",
  KeepLast{10},
  QosOverridingOptions{true});  // allow_reconfigurable all qos

Then it can be set:



/my/ns/node_name:
  ros__parameters:
    qos_overrides:  # group for all the qos settings
      'my/fully/qualified/topic/name/here':
        publisher:
          reliability: reliable
          history_depth: 100
          history: keep_last

I'm of the personal belief that this override capability should be default to true but currently it needs to be explicitly set by the code to allow the launch-time configuration. This is available in Galactic and newer!

$\endgroup$
5
  • $\begingroup$ Hi Steve, can I add 'QosOverridingOptions': True to extra_arguments in the launch file and then override the QoS parameter in the parameters list of the node? $\endgroup$
    – Myzhar
    Commented Dec 4, 2023 at 21:21
  • 1
    $\begingroup$ No, the override must be set in the code. But once that override is enabled, you can set the specific QoS profiles via the launch system, yes. $\endgroup$ Commented Dec 4, 2023 at 23:35
  • $\begingroup$ Ah OK, I did not want to modify the original code of the depthimage_to_laserscan package because I'm doing an example and all I wanted was to provide something ready to be used. I added an issue to the original GitHub repository: github.com/ros-perception/depthimage_to_laserscan/issues/75 $\endgroup$
    – Myzhar
    Commented Dec 5, 2023 at 15:22
  • 1
    $\begingroup$ You should also file a PR to just fix it. Its far more likely to get fixed if a maintainer can just click "merge" $\endgroup$ Commented Dec 5, 2023 at 22:46
  • $\begingroup$ PR ready to be reviewed: github.com/ros-perception/depthimage_to_laserscan/pull/76 $\endgroup$
    – Myzhar
    Commented Dec 8, 2023 at 13:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.