Skip to content

Ros_gz_bridge startup enters infinite loop if YAML config file includes only services #877

@elmeripk

Description

@elmeripk

Environment

  • OS Version: Docker image: ros-jazzy-base
  • ROS2 version: Jazzy
  • Source or binary build: binary, from apt.
  • Ros_gz_bridge version:
    1.0.22-1noble.20260412.043437

Description

  • When supplying a service bridge configuration to ros_gz_bridge, the startup enters
    an infinite loop and the node is not visible using ros2 node list
  • This happens if the configuration includes services only and no topics
  • Expected behavior: the bridge starts normally, as when specifying regular topics

Steps to reproduce

  1. Write the following to a YAML config file:
- ros_type_name: ros_gz_interfaces/srv/ControlWorld
  service_name: /world/default/control
  gz_req_type_name: gz.msgs.WorldControl
  gz_rep_type_name: gz.msgs.Boolean
  1. Start the bridge (e.g. using a launch file or the command line), passing the YAML file to it:
bridge = Node(
        package="ros_gz_bridge", 
        executable="parameter_bridge", 
        name="service_bridge", 
        output="screen", 
        parameters=[ { "config_file": gz_bridge_config} ], )
  1. Observe when startup enters a loop

  2. Now modify the YAML to also include a topic to bridge:

- ros_type_name: std_msgs/msg/String
  ros_topic_name: /dummy
  gz_topic_name: /dummy
  gz_type_name: gz.msgs.StringMsg
  direction: ROS_TO_GZ

- ros_type_name: ros_gz_interfaces/srv/ControlWorld
  service_name: /world/default/control
  gz_req_type_name: gz.msgs.WorldControl
  gz_rep_type_name: gz.msgs.Boolean
  1. Launch the bridge again and the above loop does not occur.

Output

Interestingly, the bug does not occur, if I pass the bridges to create through extra_bridge_params (supported in Jazzy) using the RosGZBridge launch action:

bridge = RosGzBridge(
        bridge_name="my_bridge",
        config_file=gz_bridge_config,
        extra_bridge_params={
            "bridge_names": ["service_bridge"],
            "bridges.service_bridge.service_name": "/world/default/control",
            "bridges.service_bridge.ros_type_name": "ros_gz_interfaces/srv/ControlWorld",
            "bridges.service_bridge.gz_req_type_name": "gz.msgs.WorldControl",
            "bridges.service_bridge.gz_rep_type_name": "gz.msgs.Boolean",
        }
    )

Not certain, but could this be due to handles being empty which cause infinite spinning?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status
    Inbox

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions