Coder Social home page Coder Social logo

Comments (17)

pythonian4000 avatar pythonian4000 commented on August 13, 2024

The latest SDK should work. I set up Linux support using SDK 0.8.0.5300 and it works fine for me.

from pyleapmouse.

skylogic004 avatar skylogic004 commented on August 13, 2024

I'm on Windows 8, and the latest SDK version is 1.0.8.7665 (I notice that the latest Linux version is older).

I'm using Python 2.7 x86, and the x86 files from the SDK.

This is the output I'm getting: (the last error repeats forever.)

>python PyLeapMouse.py
----------------------------------PyLeapMouse----------------------------------
Use --finger (or blank) for pointer finger control, and --palm for palm control.
Use -h or --help for more info.

Using finger mode...
Adding Listener.
Traceback (most recent call last):
  File "C:\Users\Matthew\Documents\GitHub\PyLeapMouse\FingerControl.py", line 23, in on_init
    if controller.calibrated_screens.empty:
  File "C:\Users\Matthew\Documents\GitHub\PyLeapMouse\Windows\Leap.py", line 1005, in <lambda>
    __getattr__ = lambda self, name: _swig_getattr(self, Controller, name)
  File "C:\Users\Matthew\Documents\GitHub\PyLeapMouse\Windows\Leap.py", line 55, in _swig_getattr
    raise AttributeError(name)
AttributeError: calibrated_screens
Press Enter to quit...
Connected
Traceback (most recent call last):
  File "C:\Users\Matthew\Documents\GitHub\PyLeapMouse\FingerControl.py", line 41, in on_frame
    if not frame.hands.empty:  #Make sure we have some hands to work with
  File "C:\Users\Matthew\Documents\GitHub\PyLeapMouse\Windows\Leap.py", line 745, in <lambda>
    __getattr__ = lambda self, name: _swig_getattr(self, HandList, name)
  File "C:\Users\Matthew\Documents\GitHub\PyLeapMouse\Windows\Leap.py", line 55, in _swig_getattr
    raise AttributeError(name)
AttributeError: empty

from pyleapmouse.

skylogic004 avatar skylogic004 commented on August 13, 2024

According to the SDK change log:

Removed the following methods that had been deprecated since version 0.7.7:
    Controller::calibratedScreens() — use Controller::locatedScreens() instead.
    ...

So in FingerControl.py I changed calibrated_screens to located_screens (and empty to is_empty). But it turns out that this is_empty is True... so it prints "Calibrate your Leap screen feature".

What does "Leap screen feature" refer to?

from pyleapmouse.

wyager avatar wyager commented on August 13, 2024

You do that from the leap motion options menu. It walks you through a process where you point you finger at various locations on the screen, and then that screen is "calibrated". Try that out, and if it works with located_screens instead of calibrated_screens, please either let me know or submit a pull request with your changes and I'll merge it.

from pyleapmouse.

skylogic004 avatar skylogic004 commented on August 13, 2024

Ok, in the options (Control panel) I tried Troubleshooting > Recalibrate Device. It had me lift up the leap and point it at a reflective surface. Then I had to "paint" the window by rotating the leap motion. Doing this did not help - located_screens is still empty.

There's a forum thread where a moderator states:

We were actually able to do this without the user needing to point at the corners of the screen. The user would click "calibrate screen", point at a green dot that appeared on the screen three times and then there would be extremely precise calibration. Unfortunately, developers couldn't really rely on it for their apps since some users would perform the calibration and others wouldn't. That's why we temporarily removed it from the control panel. It is going to be replaced with an API so the developer can invoke it inside their application and thus know that everyone is calibrated and having the same experience.

https://forums.leapmotion.com/showthread.php?3209-Screen-detection-screen-location-calibration&p=17195&viewfull=1#post17195

Is the thing they removed the calibration process you are referring to?

from pyleapmouse.

wyager avatar wyager commented on August 13, 2024

Yeah, the device calibration is different from the screen calibration. The screen calibration involved you pointing your finger at some circles on the screen.

If they removed screen calibration, I'm not sure what they replaced it with. Anyone care to comment? I haven't been able to use the leap motion lately.

from pyleapmouse.

pythonian4000 avatar pythonian4000 commented on August 13, 2024

I don't think screen calibration even made it into the Linux SDK as I could not get FingerControl to work.

@skylogic004 HandControl should still work for you, because that uses the tilt angle of the palm to move the mouse, and doesn't involve screen position logic.

from pyleapmouse.

skylogic004 avatar skylogic004 commented on August 13, 2024

@pythonian4000 I assume you mean PalmControl. Yes it works (though I had to change frame.hands.empty to frame.hands.is_empty)

from pyleapmouse.

skylogic004 avatar skylogic004 commented on August 13, 2024

Oh, the change log for SDK 0.8.2 says:

Removed the Screen Locator tool. We are re-evaluating this feature due to the difficulty in performing the location procedure and confusion about its purpose. The Screen class still exists in the API, but should not be used in consumer-facing applications until the Screen Locator tool (or an equivalent utility) is available.

from pyleapmouse.

wyager avatar wyager commented on August 13, 2024

Hmm. That's odd. Not sure what to use instead. Anyone care to comment? I haven't updated this utility for a few SDK versions, so I'm not well informed of recent API changes.

from pyleapmouse.

wyager avatar wyager commented on August 13, 2024

Closing. Someone can re-open with more info or submit a pull request.

from pyleapmouse.

markusbona avatar markusbona commented on August 13, 2024

I am working on a solution by writing a method "intersect" to calculate what Leap Motion did. At the moment it works with my screen setup.

I will submit a pull request after having a working calibartion method.

from pyleapmouse.

skylogic004 avatar skylogic004 commented on August 13, 2024

I did a similar thing (made my own intersect method), though it was quite hackish and I don't have a way to calibrate it. So I'm glad you're coming up with something :)

from pyleapmouse.

markusbona avatar markusbona commented on August 13, 2024

yeah... its not too simple to do the calibration. For my intersect method i would basicly need a point on the screen and its width/height in the coorinatesystem of the leap. Further my method curently needs a screen orthogonal to the leap. I am not sure if this would cover all possible screen setups.

It would be nice to have calibration phase where the user has to point at some random (or not random) points apearing on the screen... I never realy programmed something in python. i thin that would bring the need of a graphics library of some sort?

from pyleapmouse.

wyager avatar wyager commented on August 13, 2024

Can someone let me know what the deal is with this? Did they get rid of the Intersect part of the API? What are we supposed to use instead?

from pyleapmouse.

bugzy avatar bugzy commented on August 13, 2024

Not sure if this is helpful at all but Desktop leapr (https://github.com/hsocasnavarro/DesktopLeapr), which is also a python script, seems to be able to detect a single finger and use it for mouse control.

Edit: Never mind, readme says

"*Use one finger to move the mouse pointer. Pointer is given by the
position of the palm, not the finger but this is unnoticeable in practice "

from pyleapmouse.

markusbona avatar markusbona commented on August 13, 2024

@wyager At the moment, there is nothing to use instead. They plan to provide an API call to initiate the configuration process in order to use this feature again. But nothing of this is done atm.
see 2nd last post: https://forums.leapmotion.com/forum/general-discussion/general-discussion-forum/3028-screen-detection-screen-location-calibration

edit: or maybe here https://logotype.se/leapmotion/docs/com/leapmotion/leap/Controller.html Leap.Controller.locatedScreens() ... i'll have a look

@bugzy I think he doesn't use the intersect method at all. No absolute movement (point at screen where you want the mouse) but relative movement (like a joystik or a real mouse). Can anyone with a linuxsystem try that?
I think to be able to point at the screen to set the mouses location is better?

from pyleapmouse.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.