# rostopic shows /odom publisher and subscriber, but topic monitor shows "unknown"

I am trying to get a new robot up and running. Everything is fine but for some reason data published by the robot over topics are not making it to my remote computer. For example, when I do this:

rostopic info /odom


I see both a publisher and subscriber, but,

the problem is that rqt topic monitor shows /odom (and all other topics) to be with unknown values.

Note that I am enabling the checkbox in topic monitor for the topics. Also I verified that when I shutdown the Turtlebot all those topics disappeared off the list. So the topics are being published by the robot but for some reason the data is not showing up in topic montor

My configuration includes three computers:

1. The Turtlebot3
2. The computer running Roscore (Linux)
3. The computer I was doing these experiments on (Linux)

They were all three pointing to (2) as master. And they all three had localhost as their ros_name. In other words their rosname was not set to a specific IP address.

Also, when I used the teleop utility the robot didn’t move even though the cmd_vels were being published.

I dont think this matters, but we don't have the Lidar attached and during bringup there is an error but I was assuming this was not the cause. See the output of bringup:

roslaunch turtlebot3_bringup turtlebot3_robot.launch
... logging to /home/robot/.ros/log/b9caeb96-8f70-11e8-bce4-4437e6b74bd1/roslaunch-donatello-2966.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://localhost:40822/

SUMMARY
========

PARAMETERS
* /rosdistro: kinetic
* /rosversion: 1.12.13
* /turtlebot3_core/baud: 115200
* /turtlebot3_core/port: /dev/ttyACM0
* /turtlebot3_core/tf_prefix:
* /turtlebot3_lds/frame_id: base_scan
* /turtlebot3_lds/port: /dev/ttyUSB0

NODES
/
turtlebot3_core (rosserial_python/serial_node.py)
turtlebot3_diagnostics (turtlebot3_bringup/turtlebot3_diagnostics)
turtlebot3_lds (hls_lfcd_lds_driver/hlds_laser_publisher)

ROS_MASTER_URI=http://roscore1.cs.brandeis.edu:11311

process[turtlebot3_core-1]: started with pid [2976]
process[turtlebot3_lds-2]: started with pid [2977]
process[turtlebot3_diagnostics-3]: started with pid [2978]
[ERROR] [1532458956.235254716]: An exception was thrown: open: No such file or directory
[turtlebot3_lds-2] process has died [pid 2977, exit code 255, cmd /home/robot/catkin_ws/devel/lib/hls_lfcd_lds_driver/hlds_laser_publisher __name:=turtlebot3_lds __log:=/home/robot/.ros/log/b9caeb96-8f70-11e8-bce4-4437e6b74bd1/turtlebot3_lds-2.log].
log file: /home/robot/.ros/log/b9caeb96-8f70-11e8-bce4-4437e6b74bd1/turtlebot3_lds-2*.log
[INFO] [1532458957.120586]: ROS Serial Python Node
[INFO] [1532458957.164305]: Connecting to /dev/ttyACM0 at 115200 baud
[INFO] [1532458959.304822]: Note: publish buffer size is 1024 bytes
[INFO] [1532458959.306076]: Setup publisher on sensor_state [turtlebot3_msgs/SensorState]
[INFO] [1532458959.322023]: Setup publisher on version_info [turtlebot3_msgs/VersionInfo]
[INFO] [1532458959.375162]: Setup publisher on imu [sensor_msgs/Imu]
[INFO] [1532458959.388988]: Setup publisher on cmd_vel_rc100 [geometry_msgs/Twist]
[INFO] [1532458959.411120]: Setup publisher on odom [nav_msgs/Odometry]
[INFO] [1532458959.425082]: Setup publisher on joint_states [sensor_msgs/JointState]
[INFO] [1532458959.438586]: Setup publisher on battery_state [sensor_msgs/BatteryState]
[INFO] [1532458959.452736]: Setup publisher on magnetic_field [sensor_msgs/MagneticField]
[INFO] [1532458961.739648]: Setup publisher on /tf [tf/tfMessage]
[INFO] [1532458961.761586]: Note: subscribe buffer size is 1024 bytes
[INFO] [1532458961.762970]: Setup subscriber on cmd_vel ...
edit retag close merge delete

Sort by » oldest newest most voted

And they all three had localhost as their ros_name. In other words their rosname was not set to a specific IP address.

I don't recognise the ros_name you mention, but if you're referring to either ROS_IP or ROS_HOSTNAME, then localhost is not a good value for either in a multi-machine setup.

At the very least, set ROS_IP on each computer to the IP address that they have been configured with. Without that, topics will show up, but none of your nodes will be able to connect to nodes on other machines (localhost always points to the local machine, for every machine, so that is a problem).

Also, when I used the teleop utility the robot didn’t move even though the cmd_vels were being published.

This is expected in a multi-machine setup which is misconfigured.

Note that those two pages work with hostnames intead of IP addresses. That will require a working DNS server or manually adding the correct information to /etc/hosts on all computers.

more

You got it right! IThis relates to the other question that I was asking that you, @gvdhoorn, had commented on. When it is ok to use localhost for ros_hostname. Well from this it would seem that the answer is "never" or at least, "only when there's only one computer involved! THANKS!

( 2018-07-26 21:09:11 -0600 )edit

@gvdhoorn - a follow up.Can you explain exactly what was happening to cause the problem? In other words, it would seem that my Turtlebot3 (1) was subscribed to cmd_vel, and that my coding computer (3) knew that (because it appeared on the topic list) but still the actual messages were not picked up.

( 2018-07-27 08:32:00 -0600 )edit

rostopic list communicates with the master, not with nodes. Your nodes were telling each other the wrong hostname/IP, causing them not be able to connect to each other.

( 2018-07-27 08:46:07 -0600 )edit