ros1_bridge icon indicating copy to clipboard operation
ros1_bridge copied to clipboard

[Humble] No conversion from `rcl_interfaces/msg/Log` and `rosgraph_msgs/Log`

Open Timple opened this issue 2 years ago • 21 comments
trafficstars

Bug report

Required Info:

  • Operating System:
    • Docker (ubuntu:jammy)
  • Installation type:
    • ROS1 from ubuntu binaries
    • ROS2 from source (because of catkin conflict)
    • ros_bridge from source
  • Version or commit hash:
    • master
  • DDS implementation:
    • Fast-RTPS
  • Client library (if applicable):

Steps to reproduce issue

git clone https://github.com/contradict/ros-humble-ros1-bridge.git
cd ros-humble-ros1-bridge
docker build . -t bridge

Then run with this docker-compose file:

version: "2.1"
services:
  roscore:
    image: "ros:noetic"
    network_mode: host
    command: roscore
  ros1-bridge:
    image: bridge
    network_mode: host
    command: ros2 run ros1_bridge dynamic_bridge

Expected behavior

Bridging /rosout

Actual behavior

Not bridging /rosout

Additional information

Seems like the mapping is not found: https://github.com/ros2/rcl_interfaces/blob/humble/rcl_interfaces/mapping_rules.yaml

Relevant other issues:

https://github.com/ros2/ros1_bridge/issues/159 Was fixed, is broken again for humble https://github.com/contradict/ros-humble-ros1-bridge/issues/2 (Not the fault of the dockerfile I think)

Timple avatar Jan 12 '23 11:01 Timple

PS. Also seems to be the case for rolling.

Timple avatar Jan 12 '23 18:01 Timple

Not a fix, but a workaround to enable the use of ROS1 bridge with the above Dockerfile (without logging):

Instead of roscore run rosmaster --core

brow1633 avatar Feb 02 '23 15:02 brow1633

But that would mean I would need to configure all nodes to run without /rosout right?

Timple avatar Feb 18 '23 08:02 Timple

Hi! Were you able to resolve the issue? I am also experiencing the same error.

faraz7321 avatar Mar 06 '23 20:03 faraz7321

I did something similar here, but with the addition of rosbridge_suite: https://github.com/brow1633/ros_docker/blob/main/ros-humble-bridge

I'm not sure about configuring other nodes. I haven't run into issues, but haven't run this extensively to be honest.

brow1633 avatar Mar 06 '23 21:03 brow1633

@brow1633 because you are using rosmaster --core instead of roscore. Therefore you simply skip logging and there is no issue with converting the logging message.

Timple avatar Mar 14 '23 07:03 Timple

So this https://github.com/ros2/ros1_bridge/issues/393#issuecomment-1471540515 led me to investigate the history.

The last working commit for Log messages was 81f8b08671c8d161a0f0482bae4580d4d01e69c9. Since 2381bf474aa70323752b9f66cb5bbe93a5b0f99c it's broken (PR #382).

@LoyVanBeek did you ever run in to problems with Log messages?

Timple avatar Mar 16 '23 20:03 Timple

Hey Tim

Nope, have never tried bridging those until now. We only use the parameter_bridge. When I configure it to bridge /rosout and type rcl_interfaces/msg/Log with this config:

topics:
  - topic: /rosout
    type: rcl_interfaces/msg/Log
    queue_size: 1

I get:

failed to create bidirectional bridge for topic '/rosout' with ROS 2 type 'rcl_interfaces/msg/Log': No template specialization for the pair

We're still on Foxy + Noetic btw.

Even with the mapping rules in https://github.com/ros2/rcl_interfaces/blob/humble/rcl_interfaces/mapping_rules.yaml, the 'enum' for error levels also doesn't yet line up. And the ROS1 field topics[] is also missing from the ROS 2 variant. But I'd expect that to be fine: https://github.com/ros2/ros1_bridge/commit/2381bf474aa70323752b9f66cb5bbe93a5b0f99c#diff-addbc08357f431e24b7c461dce9513f7aa52338c08319c8929b17e213a9e4037R808-R822

    ros1_field_missing_in_ros2 = any(ros1_fields_not_mapped)

    if ros1_field_missing_in_ros2:
        # if some fields exist in ROS 1 but not in ROS 2
        # check that no fields exist in ROS 2 but not in ROS 1
        # since then it might be the case that those have been renamed and should be mapped
        for ros2_member in ros2_spec.structure.members:
            for ros1_field in ros1_spec.parsed_fields():
                if ros1_field.name.lower() == ros2_member.name:
                    break
            else:
                # if fields from both sides are not mappable the whole message is not mappable
                return None
return mapping

So I'm not sure what the problem is. I have a branch on my fork https://github.com/LoyVanBeek/ros1_bridge/tree/debug/mapping_uuids that adds a whole bunch of logging to pinpoint this. All I have to offer at the moment.

LoyVanBeek avatar Mar 17 '23 15:03 LoyVanBeek

Yes, i found the same issue for rolling ros2 version. i installed the ros noetic version in my ubuntu22 docker container built from source. and when I print out the pairs, there is no output like this: " - 'rcl_interfaces/msg/Log' (ROS 2) <=> 'rosgraph_msgs/Log' (ROS 1)"

I have tried many methods to solve this problem, but it does not work. i would appreciate that If anybody could provide a solution to it.

kennyS99 avatar Oct 07 '23 13:10 kennyS99

Yes, i found the same issue for rolling ros2 version. i installed the ros noetic version in my ubuntu22 docker container built from source. and when I print out the pairs, there is no output like this: " - 'rcl_interfaces/msg/Log' (ROS 2) <=> 'rosgraph_msgs/Log' (ROS 1)"

I have tried many methods to solve this problem, but it does not work. i would appreciate that If anybody could provide a solution to it.

Hi guys, I have solved this problem with this commit b9f1739fd84fc877a8ec6e5c416b65aa2d782f89. My work env is (ubuntu 22 jammy + build from source ros noetic + ros2 rolling) docker container.

kennyS99 avatar Oct 08 '23 07:10 kennyS99

You are pointing to a commit that modified a typo in a readme. I guess you meant another commit?

Timple avatar Oct 08 '23 13:10 Timple

This commit 81f8b08 is still stuck on the same issue that /rosout topics cannot be mapped. Nope, this commit solved my problem. https://github.com/ros2/ros1_bridge/commit/b9f1739fd84fc877a8ec6e5c416b65aa2d782f89

kennyS99 avatar Oct 08 '23 14:10 kennyS99

is there a solution to this problem? failed to create 2to1 bridge for topic '/rosout' with ROS 2 type 'rcl_interfaces/msg/Log' and ROS 1 type 'rosgraph_msgs/Log': No template specialization for the pair

do we just checkout the code at this point of commit https://github.com/ros2/ros1_bridge/commit/b9f1739fd84fc877a8ec6e5c416b65aa2d782f89?

limshoonkit avatar Nov 14 '23 06:11 limshoonkit

We do. But it's a shame we miss all the new features and improvements that are being implemented.

But that's how it goes: workaround is in place, so the issue plunges down the backlog :slightly_frowning_face:

Timple avatar Nov 14 '23 08:11 Timple

@Timple,

Thanks for the follow up. I modified https://github.com/contradict/ros-humble-ros1-bridge/blob/main/Dockerfile to checkout the commit. Screenshot from 2023-11-14 17-05-29

Afterwards, I tried running the examples. I have the following docker containers running with -net=host option.

ros-humble-ros1-bridge running ros1-bridge osrf/ros:noetic-desktop-full running roscore osrf/ros:noetic-desktop-full for running ros1 talker osrf/ros:humble-desktop-full for running ros2 listener

i can see that the bridge is connected Screenshot from 2023-11-14 17-13-44

but my listener is not outputting anything. Screenshot from 2023-11-14 17-14-39

is there another bug i am unaware of?

update

I run the commnad ros2 topic info /chatter --verbose Type: std_msgs/msg/String

Publisher count: 1

Node name: NODE_NAME_UNKNOWN Node namespace: NODE_NAMESPACE_UNKNOWN Topic type: std_msgs/msg/String Endpoint type: PUBLISHER GID: 01.0f.0c.f2.55.00.80.68.01.00.00.00.00.00.12.03.00.00.00.00.00.00.00.00 QoS profile: Reliability: RELIABLE History (Depth): UNKNOWN Durability: VOLATILE Lifespan: Infinite Deadline: Infinite Liveliness: AUTOMATIC Liveliness lease duration: Infinite

Subscription count: 1

Node name: NODE_NAME_UNKNOWN Node namespace: NODE_NAMESPACE_UNKNOWN Topic type: std_msgs/msg/String Endpoint type: SUBSCRIPTION GID: 01.0f.0c.f2.55.00.80.68.01.00.00.00.00.00.13.04.00.00.00.00.00.00.00.00 QoS profile: Reliability: BEST_EFFORT History (Depth): UNKNOWN Durability: VOLATILE Lifespan: Infinite Deadline: Infinite Liveliness: AUTOMATIC Liveliness lease duration: Infinite

and apparently the Node name for the ros1_bridge package in my ros2 humble docker is not defined. NODE_NAME_UNKNOWN i am expecting the node to be ros1_bridge as i can see it in my ros1 noetic docker with rosnode list.

issue resolved

problem was my docker network configuration and host firewall settings, the ros1_bridge works fine. recommend to disable firewall with sudo ufw disable

limshoonkit avatar Nov 14 '23 09:11 limshoonkit

Not to my knowledge.

But if you go bug-hunting: might as well try the master :wink:

Timple avatar Nov 14 '23 09:11 Timple

Hi. This thread helped me a lot in getting the ros1-bridge to work on my ROS2 Humble + ROS Noetic setup. I've created a Docker image that can build the ros-humble-ros1-bridge package in 10 minutes -- no need to compile ROS2 Humble from the source. You can find my setup here: https://github.com/TommyChangUMD/ros-humble-ros1-bridge-builder/

TommyChangUMD avatar Nov 18 '23 18:11 TommyChangUMD

Hi @TommyChangUMD

Nice work. I actually made it to work on ROS2 Iron + ROS Noetic. Also the bridge works by copying the build output into my ROS2 install folder which is very neat and clean.

KKSTB avatar Dec 22 '23 04:12 KKSTB

I'm running a horrible amalgamation of master + action support + some cherry picked fixes. I had to create custom convert_2_to_1 template specializations to convert the severity levels between ros1/ros2. The dynamic bridge needed an extra check to set the QoS for /rosout as well. The other nodes might need that too, but I haven't looked at them.

I'm not sure if this repo is still alive, or will accept changes for humble.

smith-doug avatar Feb 01 '24 18:02 smith-doug