Controlling the crazyflie 10 dof with kinect

Discussions and questions about the Crazyflie Nano Quadcopter
Post Reply
Albert96
Beginner
Posts: 7
Joined: Mon Jun 17, 2013 3:17 am

Controlling the crazyflie 10 dof with kinect

Post by Albert96 »

Is anyone working on this topic? I have done quite a few projects with the Kinect and would like to integrate the crazyflie quadcopter with the Kinect(using the Kinect sdk)
The languages that I know:
c, c#, java and c++
How am I supposed to program the crazyflie and send commands through the radio dongle?
marcus
Bitcraze
Posts: 659
Joined: Mon Jan 28, 2013 7:02 pm
Location: Sweden
Contact:

Re: Controlling the crazyflie 10 dof with kinect

Post by marcus »

Hi,

This sounds very interesting! We haven't tried the Kinect but we did try something similar (but not nearly as cool.. :D ) using OpenCV and a webcam. Basically you get the image/data from the camera, process it and calculate the new values for roll/pitch/yaw/thrust and then send them to the Crazyflie. The test we did using OpenCV was not very successful since the there was a lag of ~1 second for the PC control loop (though OpenCV) and that was way too long. Also we used movement to detect the position of the Crazyflie and that also caused some lag. But we only spent one night working on it so it can be made a lot better. So it would probably be better to use something like the Kinect.

If you would like to do this in Python then have a look at the wiki doc for the Python API. If you are interested in communicating with the Crazyflie from C then you should have a look at the work that Jan has done on a C-library.

Here's some Python code to connect and send commands:

Code: Select all

    cflib.crtp.init_drivers()
    crazyflie = Crazyflie()
    crazyflie.open_link("radio://0/10/250K")
    while (connected):
        image_source = grab_new_image() # Grab image from some source
        [roll, pitch, yaw, thrust] = do_calculations(image_source) # Do calculations to get the new control values for Crazyflie
        crazyflie.commander.send_setpoint(roll, pitch, yawrate, thrust) # Send the new values to the Crazyflie
    crazyflie.close_link()
Keep us posed on the progress, it would be really cool to see this work!
atomicdog
Expert
Posts: 105
Joined: Tue Mar 12, 2013 2:50 am
Location: San Diego

Re: Controlling the crazyflie 10 dof with kinect

Post by atomicdog »

There's a C++ library for the crazyflie that you may be able to integrate with the Kinect SDK.
6-DOF CF | wireless xbox 360 controller
Post Reply