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

Echo topic from a docker container from another machine in the same network

asked 2021-04-12 02:30:16 -0500

J. J. gravatar image

updated 2021-04-18 19:41:46 -0500

I just came back to ROS after a long while and now I'm learning ROS2. My objective is simply to echo or see a topic broadcasted inside a docker container from Machine 1 to Machine 2. Machine 1 and Machine 2 are both in the same network. Some basic things I tried is adding the parameter of --net=host to spin up my docker container like the following:

Machine 1:

$ docker run -it --name ros2_container --net=host ros_foxy_image

Inside the container:

$ source /opt/ros/foxy/install/setup.bash

ros2 run demo_nodes_cpp talker

Machine 2:

$ source /opt/ros/foxy/setup.bash

I expect to at least see /chatter from using ros2 topic list however I only see /parameter_events and /rosout

Some context:

Machine 1 is a jetson_nano and I installed the foxy docker image as stated in their repos.

Machine 2 is running on a Ubuntu 20 VM with foxy installed from the debian package.

I can see the topics being broadcasted from Machine 1 just fine but I can't see the topics from Machine 2.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2021-04-18 19:42:58 -0500

J. J. gravatar image

This was mainly due to the network of the VM connected to NAT. The fix was to enable a Bridge connection to enable the VM to be seen as a physical machine. Using the settings in VirtualBox the fix was simply: Settings -> Network -> Change to Bridge.

edit flag offensive delete link more

Question Tools

3 followers

Stats

Asked: 2021-04-12 02:30:16 -0500

Seen: 651 times

Last updated: Apr 18 '21