Python script for controlling the AR Drone doesn't work
I have written a simple python script to takeoff the drone.
#! /usr/bin/env python
import rospy
from std_msgs.msg import Empty
rospy.init_node('cipek')
empty = Empty()
takeoff = rospy.Publisher('/ardrone/takeoff', Empty, queue_size=1)
land = rospy.Publisher('/ardrone/land', Empty, queue_size=1)
takeoff.publish(empty)
print("works")
I have created a package with catkin. In one terminal I run roscore
, in the other rosrun ardrone_autonomy ardrone_driver
and in third rosrun my_package script.py
. The python script is runnable (I have run chmod +x
on it), and it works because it print out "works". The problem is that the drone doesn't react at all. However, when I run rostopic pub ardrone/takeoff std_msgs/empty "{}" --once
in the console it works perfectly. Any ideas what is wrong?