Subscriber not connected to topic

asked 2021-04-24 19:47:51 -0500

PointCloud gravatar image

updated 2021-04-25 08:34:13 -0500

gvdhoorn gravatar image

Hi all, I have spent several hours searching the web and the forum for a suitable answer to my "Waiting for subscriber to connect to /cmd_vel" issue that I'm having, when launching the teleop_twist node on my ubuntu vm. If I however start the teleop_twist node in another terminal on the raspberry pi, then everything works as expected. The tutorial I'm following is from Tiziano Fiorenzani.

I have made sure to follow the following steps catkin_ws:

catkin_make
source devel/setup.bash
source /opt/ros/noetic/setup.bash
sudo echo "source /opt/ros/noetic/setup.bash" >> ~/.bashrc
source ~/.bashrc

On the raspberry pi I have started roscore (and only on the pi, not the vm) Then on my ubuntu vm I have made sure to use the correct path to the master, by: export ROS_MASTER_URI=http://ubuntu:11311/ in case the nameserver won't resolve the host properly I have also done: this:

export ROS_MASTER_URI=http://192.168.1.111:11311 (just in case)
export ROS_IP=192.168.1.111

I'm quite sure the environment is setup properly. Here some debug info. I try to make it short and easy to read:

  • Using donkey car
  • 1x raspberry pi 4b, 2GB running Ubuntu 20.04 server (Armf x64... headless), ROS noetic
  • 1x Ubuntu 20.04 Desktop in virtual machine on Windows 10 host, ROS noetic
  • 1x i2cpwm_board

In the VM:

$ rostopic list -v
Published topics:
 * /rosout_agg [rosgraph_msgs/Log] 1 publisher
 * /rosout [rosgraph_msgs/Log] 4 publishers
 * /servos_absolute [i2cpwm_board/ServoArray] 1 publisher

Subscribed topics:
 * /rosout [rosgraph_msgs/Log] 1 subscriber
 * /cmd_vel [geometry_msgs/Twist] 2 subscribers
 * /statistics [rosgraph_msgs/TopicStatistics] 1 subscriber
 * /servos_absolute [i2cpwm_board/ServoArray] 1 subscriber
 * /servos_proportional [i2cpwm_board/ServoArray] 1 subscriber
 * /servos_drive [geometry_msgs/Twist] 1 subscriber

On the Pi:

$ rostopic list -v
Published topics:
 * /rosout_agg [rosgraph_msgs/Log] 1 publisher
 * /rosout [rosgraph_msgs/Log] 5 publishers
 * /servos_absolute [i2cpwm_board/ServoArray] 1 publisher
 * /cmd_vel [geometry_msgs/Twist] 1 publisher

Subscribed topics:
 * /rosout [rosgraph_msgs/Log] 1 subscriber
 * /cmd_vel [geometry_msgs/Twist] 2 subscribers
 * /statistics [rosgraph_msgs/TopicStatistics] 1 subscriber
 * /servos_absolute [i2cpwm_board/ServoArray] 1 subscriber
 * /servos_proportional [i2cpwm_board/ServoArray] 1 subscriber
 * /servos_drive [geometry_msgs/Twist] 1 subscriber

Running roswtf in the VM:

$ roswtf
Loaded plugin tf.tfwtf
No package or stack in the current directory
================================================================================
Static checks summary:
Found 1 warning(s).
Warnings are things that may be just fine, but are sometimes at fault
WARNING ROS_IP may be incorrect: ROS_IP [192.168.1.111] does not appear to be an IP address of a local network interface (one of ['127.0.0.1', '10.0.2.15']).
================================================================================
Beginning tests of your ROS graph. These may take a while...
analyzing graph...
... done analyzing graph
running graph rules...
... done running graph rules
running tf checks, this will take a second...
... tf checks complete

Online checks summary:

Found 2 warning(s).
Warnings are things that may be just fine, but are sometimes at fault

WARNING The following node subscriptions are unconnected:
 * /rostopic_4102_1619305761791:
   * /cmd_vel
 * /dk_llc:
   * /cmd_vel
 * /i2cpwm_board_node:
   * /servos_proportional
   * /servos_drive

WARNING No tf messages

Running roswtf on the Pi:

$ roswtf
No package or stack in the current ...
(more)
edit retag flag offensive close merge delete

Comments

On the raspberry pi I have started roscore (and only on the pi, not the vm) Then on my ubuntu vm I have made sure to use the correct path to the master, by: export ROS_MASTER_URI=http://ubuntu:11311/ in case the nameserver won't resolve the host properly I have also done: this:

export ROS_MASTER_URI=http://192.168.1.111:11311 (just in case)
export ROS_IP=192.168.1.111

I'm confused. You state that the master is on the Pi, but on the VM, ROS_MASTER_URI and ROS_IP point to the same address. ROS_IP should point to the VM's address, which should be different than the master's (see ROS/EnvironmentVariables and ROS/NetworkSetup).

tryan gravatar image tryan  ( 2021-04-25 09:41:53 -0500 )edit