User Tools

Site Tools


misc:hacks:leapmotion

This is an old revision of the document!


Flying the Crazyflie with the Leapmotion

There's a quick hack for flying the Crazyflie with the Leap Motion in the Crazyflie PC client repo on the dev-leapmotion branch. The application replaces the normal input with a Leap Motion input. So this branch only works with Leapmotion and not normal controllers. The code will be integrated with the main branch once development is done. The client with Leap Motion have been tested on Linux/Windows and should also work on MacOSX.

Please note: This is VERY experimental so be careful!

What you need

A Crazyflie, a Leap Motion, the normal Leapmotion installer and the SDK for your platform.

How to get it working

  • Download the SDK and unpack it
  • Download and install the normal installer (for Linux the installer is in the SDK)
  • Copy the file Leap.py from the directory LeapSDK/lib into the crazyflie-pc-client/lib/leapmotion directory
  • Copy the files in the LeapSDK/lib/x86 (or x64 directory) into the crazyflie-pc-client/lib/leapmotion directory
  • Plug your Leap Motion
  • Start up the Leap Motion daemon if it's not already started. On Linux this is done by issuing the following command
sudo leapd
  • Clone the crazyflie-pc-client repository and switch to the dev-leapmotion branch
hg clone https://bitbucket.org/bitcraze/crazyflie-pc-client
hg update dev-leapmotion
  • Start the normal client
cd crazyflie-pc-client/bin
./cfclient
  • You shouldn't run any input device config (it's not working) and don't select any mapping
  • Don't connect to the Crazyflie yet! First try out the controls and watch the UI to see how they work. Move the hand up/down to increase/decrease thrust, tilt it front/back for pitch and left/right for roll and rotate you hand (around the Z axis) for yaw. The Crazyflie will move according to you hand, so leading your hand front and left will lean the Crazyflie front and left
  • Fly :-)

In order to minimize the risk of accidental flying the orientation is only read when 4 or more fingers are detected. If the Crazyflie just drops out of the air it's probably because of this. So making a fist with your hand during flight will make the Crazyflie drop :-)

Tweaking

Have a look in the crazyflie-pc-client/lib/cfclient/utils/leapreader.py file.

misc/hacks/leapmotion.1376324479.txt.gz · Last modified: 2015-07-15 16:30 (external edit)