# Waiting for subscriber to connect to /cmd\_vel

**URL:** <https://forum.ubiquityrobotics.com/t/waiting-for-subscriber-to-connect-to-cmd-vel/616>\
**Category:** Uncategorized\
**Created:** [August 19, 2020, 3:33pm UTC](https://forum.ubiquityrobotics.com/t/waiting-for-subscriber-to-connect-to-cmd-vel/616 "2020-08-19T15:33:12Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![tnk](https://forum.ubiquityrobotics.com/letter_avatar_proxy/v4/letter/t/6bbea6/32.png) [@tnk](https://forum.ubiquityrobotics.com/u/tnk)\
**Post date:** [August 19, 2020, 3:33pm UTC](https://forum.ubiquityrobotics.com/t/waiting-for-subscriber-to-connect-to-cmd-vel/616/1 "2020-08-19T15:33:12Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![MoffKalast](https://forum.ubiquityrobotics.com/user_avatar/forum.ubiquityrobotics.com/moffkalast/32/214_2.png) [@MoffKalast](https://forum.ubiquityrobotics.com/u/MoffKalast)\
**Post date:** [August 20, 2020, 4:48pm UTC](https://forum.ubiquityrobotics.com/t/waiting-for-subscriber-to-connect-to-cmd-vel/616/2 "2020-08-20T16:48:46Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![mjstn2011](https://forum.ubiquityrobotics.com/user_avatar/forum.ubiquityrobotics.com/mjstn2011/32/30_2.png) [@mjstn2011](https://forum.ubiquityrobotics.com/u/mjstn2011)\
**Post date:** [August 21, 2020, 7:46am UTC](https://forum.ubiquityrobotics.com/t/waiting-for-subscriber-to-connect-to-cmd-vel/616/3 "2020-08-21T07:46:23Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![tnk](https://forum.ubiquityrobotics.com/letter_avatar_proxy/v4/letter/t/6bbea6/32.png) [@tnk](https://forum.ubiquityrobotics.com/u/tnk)\
**Post date:** [August 21, 2020, 6:13pm UTC](https://forum.ubiquityrobotics.com/t/waiting-for-subscriber-to-connect-to-cmd-vel/616/4 "2020-08-21T18:13:06Z")

</div>

@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?

---

<div class="post-metadata">

**Author:** ![tnk](https://forum.ubiquityrobotics.com/letter_avatar_proxy/v4/letter/t/6bbea6/32.png) [@tnk](https://forum.ubiquityrobotics.com/u/tnk)\
**Post date:** [August 21, 2020, 6:24pm UTC](https://forum.ubiquityrobotics.com/t/waiting-for-subscriber-to-connect-to-cmd-vel/616/5 "2020-08-21T18:24:25Z")

</div>

@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](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](https://frm.ubiquityrobotics.com/uploads/default/original/1X/f9316a6c8bf0dbb244889179f2d7c633508d87a9.png)

---

<div class="post-metadata">

**Author:** ![mjstn2011](https://forum.ubiquityrobotics.com/user_avatar/forum.ubiquityrobotics.com/mjstn2011/32/30_2.png) [@mjstn2011](https://forum.ubiquityrobotics.com/u/mjstn2011)\
**Post date:** [August 21, 2020, 7:13pm UTC](https://forum.ubiquityrobotics.com/t/waiting-for-subscriber-to-connect-to-cmd-vel/616/6 "2020-08-21T19:13:41Z")

</div>

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](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.

---

<div class="post-metadata">

**Author:** ![MoffKalast](https://forum.ubiquityrobotics.com/user_avatar/forum.ubiquityrobotics.com/moffkalast/32/214_2.png) [@MoffKalast](https://forum.ubiquityrobotics.com/u/MoffKalast)\
**Post date:** [August 21, 2020, 8:25pm UTC](https://forum.ubiquityrobotics.com/t/waiting-for-subscriber-to-connect-to-cmd-vel/616/7 "2020-08-21T20:25:45Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![mjstn2011](https://forum.ubiquityrobotics.com/user_avatar/forum.ubiquityrobotics.com/mjstn2011/32/30_2.png) [@mjstn2011](https://forum.ubiquityrobotics.com/u/mjstn2011)\
**Post date:** [August 22, 2020, 12:48am UTC](https://forum.ubiquityrobotics.com/t/waiting-for-subscriber-to-connect-to-cmd-vel/616/8 "2020-08-22T00:48:25Z")

</div>

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!)

> **[Troubleshooting](https://learn.ubiquityrobotics.com/troubleshooting)**
>
> Tutorials for Magni

---

<div class="post-metadata">

**Author:** ![tnk](https://forum.ubiquityrobotics.com/letter_avatar_proxy/v4/letter/t/6bbea6/32.png) [@tnk](https://forum.ubiquityrobotics.com/u/tnk)\
**Post date:** [August 22, 2020, 6:41pm UTC](https://forum.ubiquityrobotics.com/t/waiting-for-subscriber-to-connect-to-cmd-vel/616/9 "2020-08-22T18:41:43Z")

</div>

@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](https://frm.ubiquityrobotics.com/uploads/default/original/1X/882d59e539ef3841df8f5aeb734eca73c6116f5f.gif)

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.

 ![diag](https://frm.ubiquityrobotics.com/uploads/default/original/1X/d89b99cb2e663a6f3a07f4cf07dc2f95606df4dd.png)

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.

---

<div class="post-metadata">

**Author:** ![mjstn2011](https://forum.ubiquityrobotics.com/user_avatar/forum.ubiquityrobotics.com/mjstn2011/32/30_2.png) [@mjstn2011](https://forum.ubiquityrobotics.com/u/mjstn2011)\
**Post date:** [August 23, 2020, 8:20am UTC](https://forum.ubiquityrobotics.com/t/waiting-for-subscriber-to-connect-to-cmd-vel/616/10 "2020-08-23T08:20:05Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![tnk](https://forum.ubiquityrobotics.com/letter_avatar_proxy/v4/letter/t/6bbea6/32.png) [@tnk](https://forum.ubiquityrobotics.com/u/tnk)\
**Post date:** [August 23, 2020, 7:15pm UTC](https://forum.ubiquityrobotics.com/t/waiting-for-subscriber-to-connect-to-cmd-vel/616/11 "2020-08-23T19:15:42Z")

</div>

@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](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](https://frm.ubiquityrobotics.com/uploads/default/original/1X/e4b8c59795184832b8d55e244a248bc8e5baa932.png)

Thanks

---

<div class="post-metadata">

**Author:** ![mjstn2011](https://forum.ubiquityrobotics.com/user_avatar/forum.ubiquityrobotics.com/mjstn2011/32/30_2.png) [@mjstn2011](https://forum.ubiquityrobotics.com/u/mjstn2011)\
**Post date:** [August 24, 2020, 6:06am UTC](https://forum.ubiquityrobotics.com/t/waiting-for-subscriber-to-connect-to-cmd-vel/616/12 "2020-08-24T06:06:56Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![tnk](https://forum.ubiquityrobotics.com/letter_avatar_proxy/v4/letter/t/6bbea6/32.png) [@tnk](https://forum.ubiquityrobotics.com/u/tnk)\
**Post date:** [August 24, 2020, 6:49pm UTC](https://forum.ubiquityrobotics.com/t/waiting-for-subscriber-to-connect-to-cmd-vel/616/13 "2020-08-24T18:49:25Z")

</div>

@mjstn2011  
Thank you so much, Mr. Mark!

---

<div class="post-metadata">

**Author:** ![justinzw](https://forum.ubiquityrobotics.com/user_avatar/forum.ubiquityrobotics.com/justinzw/32/584_2.png) [@justinzw](https://forum.ubiquityrobotics.com/u/justinzw)\
**Post date:** [August 19, 2021, 3:05pm UTC](https://forum.ubiquityrobotics.com/t/waiting-for-subscriber-to-connect-to-cmd-vel/616/14 "2021-08-19T15:05:02Z")

</div>

I have this same issue and am not sure how to go about debugging.

I am sure I have ssh into the robot and the motors are running find because we ran the motor test.

Any tips on how I can debug?

---

<div class="post-metadata">

**Author:** ![mjstn2011](https://forum.ubiquityrobotics.com/user_avatar/forum.ubiquityrobotics.com/mjstn2011/32/30_2.png) [@mjstn2011](https://forum.ubiquityrobotics.com/u/mjstn2011)\
**Post date:** [August 20, 2021, 3:38am UTC](https://forum.ubiquityrobotics.com/t/waiting-for-subscriber-to-connect-to-cmd-vel/616/15 "2021-08-20T03:38:26Z")

</div>

This thread was from a year ago and many things were discussed.  
@justinzw Please briefly state the problem you are having.

1. Verify that when you are doing an ssh into the robot that you can get this command to at least be found and run:

```auto
rosrun teleop_twist_keyboard teleop_twist_keyboard.py  

```

For more help see this page we have for verification of operation:

> **[Verification](https://learn.ubiquityrobotics.com/verification)**
>
> Tutorials for Magni

Mark
