I've been playing around with the Python library for the Crazyflie, unfortunately the documentation is a bit lacking so it's a bit of a challenge. I was just wondering if anyone else has used the library yet and if you've managed to get thrust into the Crazyflie?
I put together a very simple script to check if things were working, but I'm getting an interesting output. Here's the code I'm using:
Code: Select all
from cflib.crazyflie import Crazyflie
from cflib.utils import callbacks
import cflib.crtp
def connected(linkURI):
print "Connected!"
def connectSetupFinished(linkURI):
print "connectSetupFinished"
roll = 0.0
pitch = 0.0
yawrate = 0
thrust = 9
crazyflie.commander.send_setpoint(roll, pitch, yawrate, thrust)
crazyflie = Crazyflie()
cflib.crtp.init_drivers()
crazyflie.open_link("radio://0/10/250K")
crazyflie.connected.add_callback(connected)
crazyflie.connectSetupFinished.add_callback(connectSetupFinished)
Code: Select all
G:\Python\Sites\crazyflie>main2.py
WARNING:cflib.crazyflie:ExpectAnswer: ERROR! Older timer whas running while scheduling new one on [5]
WARNING:cflib.crazyflie:ExpectAnswer: ERROR! Older timer whas running while scheduling new one on [5]
WARNING:cflib.crazyflie:ExpectAnswer: ERROR! Older timer whas running while scheduling new one on [5]
WARNING:cflib.crazyflie:ExpectAnswer: ERROR! Older timer whas running while scheduling new one on [5]
Connected!
ERROR:cflib.crazyflie.toc:Got packet that was not on TOC channel, TOC fetch will probably not succeed
WARNING:root:[5]: Was expecting 0 but got 9
WARNING:root:[5]: Was expecting 0 but got 9
WARNING:root:[5]: Was expecting 0 but got 9
WARNING:root:[5]: Was expecting 0 but got 9
connectSetupFinished
Cheers,
Daniel.