ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

ROS 1 Bridge running in docker container not receiving published topics from ROS 2 humble

asked 2023-05-19 20:28:58 -0500

ros-nice-nick gravatar image

updated 2023-05-19 20:38:02 -0500

I am using my system to simulate(22.04 & Humble) a turtlebot3 and a teleop twist keyboard. This system publishes camera topics to be used by container 1.

2 docker containers. Container 1: runs ORB SLAM3(18.04 & Melodic)
I've tried to install ROS2 in this container so I can just run the bridge straight away but since it's running 18.04 I have been unable to install ros 2

Container 2&3: runs ros 1 bridge(foxy & noetic) & master taken from link text

Although when running ROSCORE in Container 1 it acts as the master node and gives the ip 127.0.0.1 without running the master node container in container 2&3 I will get the error that there is no master, which is why I am running 2 ROS1 masters.

Issue When running rostopic list in container 1, no topics publsihed from the system are received

I have implemented this method because I'd like to use ROS2 Humble for whatever I am able to and add in a docker containers which contain 1 of several visual SLAM algorithms I'd like to use since they are all written for various distros and ubuntu versions

edit retag flag offensive close merge delete

Comments

This doesn't sound like bridging ros1-ros2 question. It sounds like using network app (e.g. ROS) in Docker container question. Without a proper configuration, local addresses used in your Docker container do not access outside of the same container.

130s gravatar image 130s  ( 2023-05-20 10:43:25 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2023-05-20 05:28:51 -0500

updated 2023-05-20 06:35:52 -0500

Two ROS1 masters cannot make the systems communicate with each other through ROS topics as you observed. Instead, you can try using docker's --net=host (for example docker run -it --net=host --name container_name image_name:image_tag) while running the containers. (or in case of docker-compose network-mode: "host")

This allows them to share the network resources (such as IP) and then you don't need two ROS masters.

Alternatively, you can also try following the tutorial: http://wiki.ros.org/ROS/Tutorials/Mul... if you want the dockers to be on isolated networks.

PS: In case you find ros1 bridge to introduce latencies or packet drop, consider trying the slim_bridge!

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2023-05-19 20:28:58 -0500

Seen: 867 times

Last updated: May 20 '23