Waiting for subscriber to connect to /cmd_vel
I'm doing a project to control a Sunfounder robot car kit, which includes a PCA9685 servo controller and TB6612 motor driver, using ROS. My current step is to control it directly with keyboard commands using teleop_twist_keyboard. I used this tutorial and code from Tiziano Fiorenzani, slightly modified where necessary. I have ROS Noetic installed on the robot and my laptop, and I run three nodes on the robot: roscore, the servo driver package, and the low level control package. On my laptop, I run roscore and teleop_twist_keyboard.
However, when I run the teleop_twist_keyboard.py node, I get the message "Waiting for subscriber to connect to /cmd_vel" continuously. When I do rostopic list on the laptop, it shows it sees the /cmd_vel topic. Letting the node run for several minutes doesn't change anything. A few things I should point out:
- In the tutorial, Fiorenzani stores most files on the laptop and uses Samba to bring them over to the robot car: I installed the files directly on the robot car
- The subscriber object is coded in the low level control package node
- My Ubuntu laptop and the robot car are actually running two different ROS distros: my Ubuntu laptop is on ROS Melodic, while the car is ROS Noetic. I read somewhere that this shouldn't be a major issue but perhaps it's what's causing this.
Does anyone know what could be causing this? Thanks for your help.