Echo topic from a docker container from another machine in the same network
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.