0
$\begingroup$

Rosanswers logo

I can get things to work if I stick with galactic, but there does not appear to be a build of ros1_bridge for humble and the build instructions on github don't work on ubuntu jammy (cannot install the required versions of boost). Here is a demonstration of the problem.

First, start a ros1 master and the demo service:

$ docker network create ros
724602ee919cae9c9decc71cfabcc098ecdf07d428df70a789059ea5303ef6d5
$ docker run -it --rm --net ros --name rosmaster osrf/ros:noetic-desktop roscore
...output ommitted...
$ docker run -it --rm --net ros --name server \
   -e ROS_MASTER_URI=http://rosmaster:11311/ \
   -e ROS_HOSTNAME=server \
   osrf/ros:noetic-desktop \
   rosrun roscpp_tutorials add_two_ints_server

Then, configure and create the bridge.

$ cat >bridge.yaml <<EOF
services_2_to_1:
  -
    service: /add_two_ints  # ROS 1 service name
    type: roscpp_tutorials/TwoInts  # The ROS 1 service type name
EOF
$ docker run -it --rm --net ros --name load \
   -e ROS_MASTER_URI=http://rosmaster:11311/ \
   -e ROS_HOSTNAME=interact \
   -v `pwd`/bridge.yaml:/bridge.yaml \
   osrf/ros:noetic-desktop rosparam load bridge.yaml
$ docker run -it --rm --net ros \
   -e ROS_MASTER_URI=http://rosmaster:11311/ \
   ros:galactic-ros1-bridge \
   ros2 run ros1_bridge parameter_bridge
The parameter 'topics' either doesn't exist or isn't an array
The parameter 'services_1_to_2' either doesn't exist or isn't an array
Trying to create bridge for ROS 1 service '/add_two_ints' with type 'roscpp_tutorials/TwoInts'
Created 2 to 1 bridge for service /add_two_ints

This setup works fine if I make the request from galactic

$ docker run -it --rm --net ros osrf/ros:galactic-desktop \
   ros2 service call /add_two_ints example_interfaces/srv/AddTwoInts "{a: 1, b:2}"
requester: making request: example_interfaces.srv.AddTwoInts_Request(a=1, b=2)

response:
example_interfaces.srv.AddTwoInts_Response(sum=3)

But hangs if I make the request from humble:

$ docker run -it --rm --net ros osrf/ros:humble-desktop \
   ros2 service call /add_two_ints example_interfaces/srv/AddTwoInts "{a: 1, b: 2}"
requester: making request: example_interfaces.srv.AddTwoInts_Request(a=1, b=2)

Is there a build of ros1_bridge that can communicate with humble? Are there instructions to create one somewhere?


Originally posted by contradict on ROS Answers with karma: 43 on 2022-08-18

Post score: 1

$\endgroup$

2 Answers 2

0
$\begingroup$

Rosanswers logo

Did you check out this tutorial Using ros1_bridge with upstream ROS on Ubuntu 22.04?

It requires using ROS 2 built from source:

The release of ROS 2 Humble (and Rolling) on Ubuntu 22.04 Jammy Jellyfish marks the first ROS 2 release on a platform with no official ROS 1 release. While ROS 1 Noetic will continue to be supported through the duration of its long term support window, it will only target Ubuntu 20.04. Alternatively, there are upstream variants of ROS 1 packages in Debian and Ubuntu that are not maintained as an official distribution by the ROS maintainers.

This guide outlines the current mechanism for bridging ROS 2 releases with these upstream packages on Ubuntu 22.04 Jammy Jellyfish. This provides a migration path for users who still depend on ROS 1, but desire moving to newer ROS 2 and Ubuntu releases.


Originally posted by ljaniec with karma: 3064 on 2022-08-18

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by contradict on 2022-08-19:
Thank you! I missed that. The instructions are a bit tricky to follow so I created a Dockerfile demonstrating how I finally got it to work: https://github.com/contradict/ros-humble-ros1-bridge

Comment by ljaniec on 2022-08-19:
I think you could prepare a Pull Request with this Dockerfile there: https://github.com/ros2/ros2_documentation/tree/humble/source/How-To-Guides - it will be helpful for everyone later!

$\endgroup$
0
$\begingroup$

You could also try using ros-humble-ros1-bridge-builder. It does not involve building Humble from source.

https://github.com/TommyChangUMD/ros-humble-ros1-bridge-builder

$\endgroup$

Your Answer

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