Rosanswers logo

I'm using hector_quadrotor, and am trying to get a simple quadrotor moving in it using my keyboard.

I run the demo using roslaunch hector_quadrotor_demo outdoor_flight_gazebo.launch and it gives out a few messages which can be seen here (There are no errors, but a few warnings are there)

Then I run rosrun teleop_twist_keyboard teleop_twist_keyboard.py which gives out the following output

When i press u,i,o,j,k,l,m ... nothing happens

My understanding is that they send/recv messages on /cmd_vel to talk to each other. So, I read that I can see that using rostopic info /cmd_vel and i get :

Type: geometry_msgs/Twist

 * /teleop_twist_keyboard (http://ajk-VPCSB38GG:49644/)

 * /gazebo (http://ajk-VPCSB38GG:46506/)

So, it seems both are connected to the node, and rostopic echo /cmd_vel gives:

$ rostopic echo /cmd_vel
WARNING: no messages received and simulated time is active.
Is /clock being published?
  x: 0.5
  y: 0.0
  z: 0.0
  x: 0.0
  y: 0.0
  z: 1.0

when I press u in the teleop_twist_keyboard. So, it seems to be sending, but the hector_quadrotor_demo isn't catching it.

A bit more info : I am using Ubuntu 14.04 and ROS indigo. I installed all packages using the Ubuntu ppa for ROS and apt-get.

Originally posted by AbdealiJK on ROS Answers with karma: 98 on 2015-05-13

Post score: 3

Original comments

Comment by creative_cimmons on 2015-06-06:
Yeah, even I am facing the same issue!!!

Comment by c123 on 2015-06-07:
Same for myself.

Comment by creative_cimmons on 2015-06-09:
[ INFO] [1433906927.086001345, 0.001000000]: imu plugin missing , defaults to 0s [ INFO] [1433906927.086072918, 0.001000000]: imu plugin missing , defaults to 0s

I guess the problem is because of missing imu plugin,, could anybody debug that!!!


2 Answers 2


Rosanswers logo

So, as there has been no answer - I am posting the solution I found myself... It seems the We wrote a code to teleop_twist_keyboard doesn't give the quadrotor linear z velocity to go upward. So, if you start the quadrotor at a height (let's say 1000 m) ... while it falls down you can move left/right and so on.

We wrote our own module to test it out which works. Here's the code :

#!/usr/bin/env python

import rospy
import Tkinter as tk
import threading
import thread
import time
from geometry_msgs.msg import Twist
import pygame, sys

def talker():
    global clock

    pub = rospy.Publisher('cmd_vel', Twist, queue_size=10)
    rospy.init_node('controller', anonymous=True)
    rate = rospy.Rate(10) # 10hz
    while not rospy.is_shutdown():
        msg = Twist()
        for event in pygame.event.get():
            if event.type == pygame.QUIT:

        array = pygame.key.get_pressed()
        if array[pygame.K_UP]:
            msg.linear.z = 1;
        elif array[pygame.K_DOWN]:
            msg.linear.z = -1;
        if array[pygame.K_w]:
            msg.linear.y = 1;
        elif array[pygame.K_s]:
            msg.linear.y = -1;
        if array[pygame.K_d]:
            msg.linear.x = 1;
        elif array[pygame.K_a]:
            msg.linear.x = -1;


size = [100, 100]
screen = pygame.display.set_mode(size)
clock = pygame.time.Clock()

if __name__ == '__main__':
    # threading.Thread(target=tk_func())    
    except rospy.ROSInterruptException:

Originally posted by AbdealiJK with karma: 98 on 2015-06-10

This answer was ACCEPTED on the original site

Post score: 2


Rosanswers logo

And here is the link to cpp version.

I am not sure about the 1000 m initialization,, I don't think that is required

Originally posted by creative_cimmons with karma: 47 on 2015-06-16

This answer was NOT ACCEPTED on the original site

Post score: 2


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.