I have a docker container that runs a ROS2 (humble) node that publishes (among other things) imu data on a topic. The host is an NVIDIA jetson AGX orin. This part runs fine. I run the Docker container with host network with the aim of being able to access this published topic outside the container. This is where trouble begins.
When a run another container on the same host (also with host network), the topic shows up when I run ros2 topic list and I am able to subscribe by ros2 topic echo /sensor1/imu.
When I try to connect from a different machine (since the host has no ROS2 installed), the topic shows up with ros2 topic list but when I try ros2 topic echo /sensor1/imu, I get no response, and more importantly, the memory usage of the ROS2 node in the Docker container spikes to the maximum available memory after which it gets killed.
Update: ros2 topic bw /sensor1/imu and ros2 topic hz /sensor1/imu are working fine and giving the correct output.
Since I am able to remotely connect to the host, and get a list of available topics, I don't see why this is happening.
I have little experience with network settings, but I know the two machines are in the same local network and both are configured with (non identical) static ips through ethernet.
Since there are many different things involved, I'm not sure where to start. Is this related to Docker, Jetson, ROS2, ip or something else?
Update: The issue originated from different versions of ROS2. The Docker container used humble, while the remote pc had iron installed. Matching the versions on the two devices, fixed the issue.