How can I communicate with a ros1 service from ros2 humble?
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?