Git Product home page Git Product logo

leapjna's Introduction

LeapJna

Java CI Quality Gate Status Coverage Maintainability Rating

Java bindings for the Ultraleap SDK

LeapJna is a library that provides Java bindings for the Ultraleap (formerly Leap Motion) SDK. The official Java bindings were deprecated in the Orion SDK 3 and can not be used at all with Orion SDK 4. LeapJna uses Java Native Access to create an interface for communicating with the Ultraleap SDK's LeapC API to fetch tracking data from an Ultraleap Tracking device.

Note: Neither LeapJna nor I (Komposten) am associated with Ultraleap Ltd.

Supported API features

LeapJna includes Java bindings for all functionality in the following Ultraleap C API versions:

Ultraleap SDK LeapJna version
4.0.0+52173 1.0.2
4.1.0+52211 1.0.2
5.0.0-preview+52386 1.1.0
5.6.1.0 1.2.0

Untested API bindings

LeapJna's bindings for some of the API features have not been tested with an actual UltraLeap Tracking device. Those are as follows:

  • Device failure events (I don't have a failing device to test this)
  • Point mappings (I'm not sure what they are and how to enable them; deprecated in LeapJna 1.2.0)
  • Eye events (I don't think the Leap Motion Controller peripheral device supports this)
  • IMU events (I don't think the Leap Motion Controller peripheral device supports this)

These should still work, as I have tested the bindings using a mock Leap C API, but I can't guarantee it.

Broken API features

Some features specified in the Ultraleap SDK are broken or non-functional in the C API as far as I can see, which means that they won't work as expected in LeapJna either.

A list of these features can be found here: Broken API Features.

Using LeapJna in your project

  1. Add LeapJna to your classpath.
    • If you don't use Maven/Gradle you will need to add JNA as well.
  2. Download the UltraLeap SDK, put LeapC.dll in a folder "win32-x86-64" and add that folder to your classpath.
  3. Import LeapC in your Java class: import komposten.leapjna.leapc.LeapC;
  4. Obtain the LeapC instance using LeapC.INSTANCE.
    • Use this instance to access the LeapC API's functions.
    • All related data structures can be found in the komposten.leapjna.leapc packages.
  5. Refer to the official SDK guide for the basics of using the LeapC API.
    • Refer to the documentation of each method and data structure in LeapJna for information on how to use them.

2D visualiser example

LeapJna has an example application which takes the form of a simple visualiser. To launch this:

  1. Clone LeapJna.
  2. Open LeapJna as a Maven project in your preferred IDE.
  3. Launch komposten.leapjna.example.VisualiserExample.

License

The license for LeapJna's source code can be found in the LICENSE file.

Since most of the documentation for the methods in LeapC.java and classes in komposten.leapjna.leapc.* originally comes from the official UltraLeap API Reference, it falls under the same license as the official reference.

The Ultraleap SDK (not included in this repository) is licensed according to the Ultraleap Tracking SDK Agreement.

leapjna's People

Contributors

komposten avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

kyucraftv2

leapjna's Issues

Can't install using mvn.

Hi,

I'm trying to install the bindings. I cloned the repo, downloaded all the assets, and added the configuration to the POM file.

When running mvn install within the directory, I get the following error:

[ERROR] Failed to execute goal on project leapjna: Could not resolve dependencies for project komposten.leapjna:leapjna:jar:1.2.0: The following artifacts could not be resolved: komposten.leapjna.LeapJna:leapjna:jar:1.2.0 (absent): Could not find artifact komposten.leapjna.LeapJna:leapjna:jar:1.2.0 in central (https://repo.maven.apache.org/maven2

Any help would be appreciated.

Mapping LeapJNA events to JavaFX Gestures

Hello @Komposten ! Great job with maintaining this functionality after Leap stopped doing so. Thank you.
I make a lot of JavaFX visualizations and one of them is for a touch screen. We have purchased an Ultra Leap and would like to try to map Leap motion "gestures" to normal JavaFX gestures. (Rotate, Zoom, Swipe, Tap, Scroll etc).

Have you ever tried this with your library? Is using your library the correct approach?

Build using Java 11

SonarCloud will stop accepting Java 8 in Oct 2020, so we should bump the Java version from 8 to 11.

We could maybe do two separate builds:

  1. Java 8 - No SonarCloud analysis
  2. Java 11 - With SonarCloud analysis

I believe this can be done in Actions using a strategy matrix and an "if" on the Sonar step.

Add missing documentation/descriptions

Package descriptions

  • komposten.leapjna.leapc
  • komposten.leapjna.leapc.data
  • komposten.leapjna.leapc.enums
  • komposten.leapjna.leapc.events
  • komposten.leapjna.leapc.util
  • komposten.leapjna.util

Class descriptions

  • LeapC
  • LEAP_IMAGE
  • LEAP_TELEMETRY_DATA
  • LEAP_VARIANT.ValueUnion
  • LEAP_VECTOR.ByValue
  • Enums
  • Enums.ByteEnum
  • Enums.IntEnum
  • Enums.IntFlagEnum
  • eLeapDroppedFrameType
  • eLeapServiceDisposition
  • eLeapValueType
  • LEAP_EVENT
  • LEAP_HEAD_POSE_EVENT
  • eLeapRSConverter
  • LeapTypeMapper

Method descriptions

  • Enums.createMask and .parseMask

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.