Waiting for subscriber to connect to /cmd_vel

I have finished to set up a ROS workstation on my native Ubuntu and successfully connect Magni and workstation together by following the tutorial. However, when I type “rosrun teleop_twist_keyboard teleop_twist_keyboard.py” in a ssh window, I get “Waiting for subscriber to connect to /cmd_vel” even though there is the topic named “cmd_vel” when I type “rostopic list”. How could I solve this problem?

Ah yeah I think I’ve come across this one recently, never did figure out what the issue with it is though. Try checking if the topics are actually present (as in data si being sent, by checking say rostopic echo /battery_state or something) instead of just the topics being there, which could mean that there’s a network issue. In my case this was working fine though.

Could be something to do with the teleop package itself, I installed it from apt at the time, so you could try compiling it locally from master if it makes any difference.

This means no node is subscribing to the /cmd_vel topic (which I think you know).
Is this a Magni from the factory or have you burned a new image for the Pi?
If you burned a new image do you recall which one it was and if you had since the image ever done ‘sudo apt upgrade’? This will help us understand more.

Have you tried waiting 3 minutes and then see if it works?
I ask this because there are certain things link really old image or missing the CR2032 battery that can lead to very long startup times.

  • ssh window to magni ‘rostopic list’ should be showing about 30 or more topics?
    If not the magni is not showing quite a few then try ‘rosnode list’ and verify that motor_node is running.

We can go from there perhaps, thanks.

@MoffKalast
Thank you for answering my question. When I typed “rostopic echo /battery_state” in a ssh window, I got “WARNING: topic [/battery_state] does not appear to be published yet” which means a topic named battery_state is not running on Magni. Could you please help me with how to publish the topic?

@mjstn2011
Thank you for your help. I actually have not burned a new image for the Pi. I am using Magni and the image for the Pi with the condition after unboxing. In addition, I have tried waiting for more than 3 min but nothing happened, and I also tied to git clone the teleop_twist_keyboard from the source by typing “git clone https://github.com/ros-teleop/teleop_twist_keyboard.git” in ~/catkin_ws/src, and catkin_make was successfully done. It is because there was no teleop_twist_keyboard.py in /opt/ros/kinetic/share/teleop_twist_keyboard. Lastly, this is the output of “rostopic list”. Obviously, it is not showing about 30 or more topics as you suggested. Could you please tell me the command of how to run motor_node? I am still learning ROS.
list

Ok, this tells me that the motor node is not starting which matches your earlier observation that there was no subscriber to /cmd_vel.

When you said you ‘ssh’ and get a console, I want to be sure you are doing the ‘ssh’ to the magni itself. Lets get everything going on the magni then worry about laptop remote operations. You laptop likely does not have teleop_twist_keyboard installed but our robot does have it installed.

Look at this page: https://learn.ubiquityrobotics.com/verification

Go right to 1.1 to check the leds.
Also go to section 2.1 and if you have a recent Magni then the serial debug leds will make this easier.

Well that is rather odd, though I’ve seen missing scripts in the past as for example the upgrade firmware script wasn’t included with the compiled motor node package. I’d imagine it’s an issue with the package itself.

Inspired by this forum post and others I have worked on in the past today has been posted a greatly enhanced troubleshooting page on our ‘Learn’ documents site.

it goes well beyond what we have been starting to discuss today and I hope that it solves the problem seen in this post (and other users problems in the future too!)

@mjstn2011
Thank you for your response and for updating the troubleshooting page. I have been following the verification tutorial to understand and solve the issue in the past day. Yes, I have solved the issue missing /cmd_vel by typing “$ rostopic echo /cmd_vel” in another ssh window (but Magni did not move). However, I have got another error when I followed the verification page that you suggested.

The STATUS led which is the rightmost one in the row of 5 LEDs is blinking on around every 5-6s, so I assume that my Magni has Revision 5.0 MCB (Section 1.1 in the verification page).

output

Also, in the section 2.1, I am not sure which one is SOUT LED and SIN LED on MCB, but I can see there is a LED blinking rapidly (below a Sonor sensor in the middle in the row of three Sonor sensors as shown in this video). In the section 2.3, I have typed “$ rostopic echo /diagnostics” in a ssh window, and this is the output that I got. I do not think I can see the items such as Battery Voltage, Motor Power, Firmware Version, Firmware Date, and Firmware Options like the description on the verification page.

Are all the results caused because I am using a Ubuntu desktop computer with an Ethernet cable rather than a desktop computer with WiFi? Or are there any other problems? I am still working on the troubleshooting page that you suggested, and I will let you know what I got later.

Next time you get back to this besides following the troubleshooting guide can you get an ssh session to a console on the magni and type this then post the output?

uname -a

more /etc/network/interfaces

env | grep ROS_

Thanks

@mjstn2011
Thank you so much! I finally could make Magni move by following the troubleshooting page. This is the process that I have done to make Magni move.
On a ssh window 1,
$ cd ~/catkin_ws/src
$ git clone https://github.com/ros-teleop/teleop_twist_keyboard.git
$ cd …
$ catkin_make
$ sudo systemctl stop magni-base
$ source /opt/ros/kinetic/setup.bash
(I am not sure why I have to restate this source command even though this line is added at the end of .bashrc file. Otherwise, I get the error "ERROR: cannot launch node of type [magni_bringup/launch_core.py]: can’t locate [launch_core.py] in package [magni_bringup]) when launching “$ roslaunch magni_bringup base.launch”)
$ roslaunch magni_bringup base.launch
On a ssh window 2,
$ rostopic echo /cmd_vel
On a ssh window 3,
$ rosrun teleop_twist_keyboard teleop_twist_keyboard.py

In addition, this is the output when typing these commands that you suggested.
output

Thanks

This is wonderful news! I consider this issue closed from your point of satisfaction.

You are the very first user to try the page so I was looking for a person who needed it and it could maybe help by trying the page.

I am puzzled on some things but it’s ok, you keep going and make progress.
I am going to have our lab test group take a brand new robot and see if what you saw is happening for some reason from the factory. All the things below should not have been needed

  1. the clone of twist. It is supposed to be there already.
  2. The re-sourcing of /opt/ros/kinetic/setup.bash should have been taken care of already
  3. Having to stop and manually start the magni-base service

You do not worry about this but I will have our team look into this, it is not the way we planed it for whatever reasons.

Thank you for your working this out. Mark

@mjstn2011
Thank you so much, Mr. Mark!