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 Leapmotion in the Crazyflie PC client repo on the dev-leapmotion branch. It's just a quick test so far so it's a bit glitchy and only works for Linux (but this could easily be changed).

Please note: This is VERY experimental so be careful!

What you need

A Crazyflie, a Leapmotion and you need to download the SDK for Linux from the Leapmotion devevloper site (yes, you have to register..).

How to get it working

  • Download the SDK for Linux and unpack it
  • Install the leap-*.deb packet that fits (64/32-bit)
  • Plug you leap motion and orient it so that the connector is on your right side
  • Start up the leap motion daemon 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.1375794035.txt.gz · Last modified: 2015-07-15 16:30 (external edit)