[LEAP MOTION + CRAZYFLIE]

Firmware/software/electronics/mechanics
jsalts
Beginner
Posts: 14
Joined: Tue Jan 16, 2018 12:34 pm

[LEAP MOTION + CRAZYFLIE]

Post by jsalts » Wed Jan 24, 2018 4:24 am

I'm currently working on integrating the Leap Motion Controller with the CrazyFlie. As of now, I'm stuck with the importing of libraries. Whenever I open the CrazyFlie PC Client, it says "Leap Motion libraries probably not installed" but I already have the Leap SDK, I just don't know where to put it. Any help is much appreciated. Many thanks!

Also, the cmd output is attached below for your reference.

Image

marcus
Bitcraze
Posts: 599
Joined: Mon Jan 28, 2013 7:02 pm
Location: Sweden
Contact:

Re: [LEAP MOTION + CRAZYFLIE]

Post by marcus » Wed Jan 24, 2018 9:27 am

Hi,

When the Crazyflie Python Client was moved from Python 2.7 to Python 3 the Leap Motion support was dropped since there's no bindings for Python 3. I checked the website quickly and I can still only find bindings for Python 2.7. This means that you cannot run the library from within the client. The loading of the library was left intact with the hopes that there would be Python 3 bindings later on.

If you want to fly the Crazyflie 2.0 with the Leap Motion I think your best bet is to try to use the headless client. There might be some changes needed since the input layer is also used by the client (which is only Python 3). But otherwise the cfheadless client only uses the library which is compatible with Python 2.7.

The other route you could try is to compile your own Python 3 bindings for the Leap Motion. Last time I checked there was a thread in their development forum describing how to do it.

jsalts
Beginner
Posts: 14
Joined: Tue Jan 16, 2018 12:34 pm

Re: [LEAP MOTION + CRAZYFLIE]

Post by jsalts » Sun Apr 29, 2018 6:12 pm

Hey man, I tried the older version of the crazyflie client using this link. I believe the leap motion does fine however, I can't seem to connect the crazyradio pa to the crazyflie. I already did all the zadig drivers thing. However it does not do any good. What could be the solution for this one?

marcus
Bitcraze
Posts: 599
Joined: Mon Jan 28, 2013 7:02 pm
Location: Sweden
Contact:

Re: [LEAP MOTION + CRAZYFLIE]

Post by marcus » Mon Apr 30, 2018 9:22 am

jsalts wrote:
Sun Apr 29, 2018 6:12 pm
Hey man, I tried the older version of the crazyflie client using this link. I believe the leap motion does fine however, I can't seem to connect the crazyradio pa to the crazyflie. I already did all the zadig drivers thing. However it does not do any good. What could be the solution for this one?
This might be tricky since you're trying to pair together a version of the client that is 5 years old with current stuff. Then you probably have to revert back to all the versions of things we had in 2013. Since this is before we had the Crazyflie 2.0/Crazyradio PA I'm not sure if you will get everything working. Like I wrote above your best bet is probably the headless client or compiling your own Python 3 bindings for the Leap Motion.

jsalts
Beginner
Posts: 14
Joined: Tue Jan 16, 2018 12:34 pm

Re: [LEAP MOTION + CRAZYFLIE]

Post by jsalts » Tue May 01, 2018 5:48 am

Upon searching on how to create Python 3 bindings for Leap Motion, everything seems faulty and the software often crashes. But, let say the Python 3 does work, how can I integrate it to the crazy python client folder?

jsalts
Beginner
Posts: 14
Joined: Tue Jan 16, 2018 12:34 pm

Re: [LEAP MOTION + CRAZYFLIE]

Post by jsalts » Tue May 01, 2018 6:09 pm

marcus wrote:
Mon Apr 30, 2018 9:22 am
jsalts wrote:
Sun Apr 29, 2018 6:12 pm
Hey man, I tried the older version of the crazyflie client using this link. I believe the leap motion does fine however, I can't seem to connect the crazyradio pa to the crazyflie. I already did all the zadig drivers thing. However it does not do any good. What could be the solution for this one?
This might be tricky since you're trying to pair together a version of the client that is 5 years old with current stuff. Then you probably have to revert back to all the versions of things we had in 2013. Since this is before we had the Crazyflie 2.0/Crazyradio PA I'm not sure if you will get everything working. Like I wrote above your best bet is probably the headless client or compiling your own Python 3 bindings for the Leap Motion.
I tried using your suggested approach but when I used it, here's the result:
"Leap Motion library probably not installed (dynamic module does not define module export function (PyInit__LeapPython))"
Image
What possibly have gone wrong now?

marcus
Bitcraze
Posts: 599
Joined: Mon Jan 28, 2013 7:02 pm
Location: Sweden
Contact:

Re: [LEAP MOTION + CRAZYFLIE]

Post by marcus » Mon May 07, 2018 11:15 am

What approach are you trying, building your own Python 3 bindings? I've never tried it so unfortunately I don't think I be very useful here. But I would recommend separating the problems. Make a Python 3 script that uses the bindings outside the client and make sure everything works. Then integrate that into the client.

jsalts
Beginner
Posts: 14
Joined: Tue Jan 16, 2018 12:34 pm

Re: [LEAP MOTION + CRAZYFLIE]

Post by jsalts » Mon May 07, 2018 12:22 pm

Thank you very much on responding to my questions, I really appreciate it. But what exactly do you mean by creating a separate python3 script? I’d be creating a working python script that would integrate the crazyflie and leap motion together all from scratch? I’m sorry if these questions sound amateur I’m still trying to learn all these. Thanks again!

marcus
Bitcraze
Posts: 599
Joined: Mon Jan 28, 2013 7:02 pm
Location: Sweden
Contact:

Re: [LEAP MOTION + CRAZYFLIE]

Post by marcus » Mon May 07, 2018 12:40 pm

I mean just create a small Python 3 script that reads out the values you're getting from the LeapMotion bindings. Once this is working then you can go on to integrating it into the real client. This way you separate the problem into "Make LeapMotion work with Python 3" and "Make Crazyflie work with LeapMotion".

jsalts
Beginner
Posts: 14
Joined: Tue Jan 16, 2018 12:34 pm

Re: [LEAP MOTION + CRAZYFLIE]

Post by jsalts » Mon May 07, 2018 12:58 pm

I see, I do understand now. Will surely try that, thank you again Marcus!

Post Reply