I can only echo a subset of ROS topics from a remote machine
I am running ROS Melodic on Ubuntu 18.04 on both my robot and laptop. While SSH'd into the robot, I can view all nodes and topics, and echo the contents of all the topics no problem.
From my remote laptop however, with ROS_IP=<laptop_ip> and ROS_MASTER_URI=http://<robot_ip>:11311 I can view all topics, and I can echo most (/tf, /pointcloud, /odom, etc.) but some I cannot... For example I cannot echo /map or /scan. It does not say that the topics has not been written too, or that I have not built my messages, but rather just hangs and outputs nothing... It seems very strange to me that only a subset of the topics would fail from the remote machine. I have also configured /etc/hosts on the robot with the appropriate machine names.
Any suggestions would be greatly appreciated.
I'd suggest to set
ROS_IP
on your robot's PC as well and see whether things work normally just to diagnose what's going on (basically: avoid using hostnames completely).Setting the robots ROS_IP worked for me. Thanks for the tip :)
This was only a diagnostic step. Not the solution.
If setting
ROS_IP
(where? On which host(s)?) works, that would point to DNS problems.You mention you "also configured /etc/hosts on the robot". Did you do that just on the robot's PC, or on both PCs?