Giter Site home page Giter Site logo

ultraleap / unityplugin Goto Github PK

View Code? Open in Web Editor NEW
509.0 509.0 163.0 495.57 MB

Ultraleap SDK for Unity.

Home Page: https://docs.ultraleap.com/unity-api/

License: Apache License 2.0

C# 98.80% HLSL 0.33% ShaderLab 0.66% XSLT 0.06% PowerShell 0.16%
hand-interaction hand-tracking leap-motion leapmotion mixed-reality mr ultraleap unity unity3d virtual-reality vr xr

unityplugin's People

Contributors

acolgan avatar ajohnston33 avatar amarcolina avatar brycenewell-ul avatar craig-j avatar dwarph avatar elliotpadfieldul avatar hham avatar jamesmunro-ul avatar jamesprovan-ul avatar jcorvinus avatar jdonald avatar juliaronnebergerul avatar lazloringuh avatar mattfiler avatar mattgrayuh2 avatar mattgrayul avatar maxpalmer-uh avatar protodeep avatar rblenkinsopp avatar robertevans-ul avatar rodolphehoudas-ul avatar rorygames avatar tarumuh-ul avatar testmasterbright avatar themunro avatar ul-burge avatar vabrador avatar xelarse avatar zalo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

unityplugin's Issues

PlugInLeapNotice prefab is broken

3 things:

  1. On the LeapC side, IsServiceConnected isn't working because of a bug in LeapC. This has been fixed in platform. -- the fix should be in the assets by now.
  2. I am getting null object errors when the prefab is in the scene, so it seems that something might be missing from the prefab? -- further investigation reveals that at some point, some code was changed to expect a UI.Image instead of GUITexture, but other scripts still expect GUITexture.
  3. We shouldn't need to check for a connection every frame. Probably a coroutine that runs every couple of seconds is more efficient.

Hand misaligned to images in Unity Visualizer

If the service is not running when the scene is started, and then started, the hands and images become misaligned. Unity also throws an exception. This only seems to happen in the Visualizer scene, not, for example, the AR scene.

MissingReferenceException: The object of type 'LeapImageRetriever' has been destroyed but you are still trying to access it.
Your script should either check if it is null or you should not destroy the object.
UnityEngine.Component.GetComponentCamera
Leap.Unity.LeapImageRetriever.ApplyCameraProjectionValues () (at Assets/LeapMotion/Scripts/LeapImageRetriever.cs:351)
Leap.Unity.LeapImageRetriever.HandleOnValidCameraParams (CameraParams camParams) (at Assets/LeapMotion/Scripts/LeapImageRetriever.cs:287)
Leap.Unity.LeapVRCameraControl.OnPreCull () (at Assets/LeapMotion/Scripts/VR/LeapVRCameraControl.cs:81)

bugvisualizermissalignment

GetLeapMatrix does not belong in UnityMatrixExtension

UnityMatrixExtension by it's name is for extension methods, which GetLeapMatrix is not. Either we should move GetLeapMatrix to a different class, or rename UnityMatrixExtension to allow non-extension methods to make sense inside it.

Add component for notifying the user about disabled Images

When an app wants images but is not receiving them, we should be able to display a warning to the user warning them that the application will not function correctly until images are enabled. Optionally, we might be able to provide some sort of interface (a button for example) to enable images for the app for the duration of the application.

GetFixedFrame transforms more frames than it needs to

The current implementation of LeapProvider.GetFixedFrame calls GetTransformedFrame every time it obtains a new frame inside the inner loop. All but one of these frames is going to be discarded, and so the transformation is wasteful. It should acquire un-transformed frame objects, and only transform the once that is selected.

Switch to using text meta files

We should be using text meta files instead of binary. It will reduce repository size in the long run because we will only need to store patches upon commit instead of recommitting the entire binary file each time. It will also make merges easier for things like scenes or prefabs. It also makes it easier to tell what kind of modifications have been made to an object, since the format is fairly descriptive.

There is no tracking in built scenes.

Using the most recent develop core assests and the develop service as of 3/9/16 tracking appears not to work in built scenes.

This issue also occurs when using the public builds of the service.

Capsule hand wrist collapses at scale .3 or less

At a scale of .3 or less, the two wrist spheres collapse to the same location (the palm becomes a triangle rather than a rectangle). The rigid hand palm also stops rotating with the hand.

capsulehandcollapse

The lack of palm collider rotation is probably an error with the quaternion conversion --also getting this error:

Look rotation viewing vector is zero
UnityEngine.Quaternion:LookRotation(Vector3, Vector3)
Leap.Unity.UnityMatrixExtension:Rotation(Matrix) (at Assets/LeapMotion/Scripts/Utils/LeapUnityExtensions.cs:54)
Leap.Unity.HandModel:GetPalmRotation() (at Assets/LeapMotion/Scripts/Hands/HandModel.cs:99)
Leap.Unity.RigidHand:UpdateHand() (at Assets/LeapMotion/Scripts/Hands/RigidHand.cs:37)
Leap.Unity.HandProxy:UpdateRepresentation(Hand, ModelType) (at Assets/LeapMotion/Scripts/HandProxy.cs:43)
Leap.Unity.LeapHandController:UpdateHandRepresentations(Dictionary`2, ModelType, Frame) (at Assets/LeapMotion/Scripts/LeapHandController.cs:111)
Leap.Unity.LeapHandController:FixedUpdate() (at Assets/LeapMotion/Scripts/LeapHandController.cs:85)


The CapsuleHands class is throwing a similar, but independent error, which probably causes the wrist issue:

Look rotation viewing vector is zero
UnityEngine.Quaternion:LookRotation(Vector3, Vector3)
Leap.Unity.CapsuleHand:updateCapsules() (at Assets/LeapMotion/Scripts/Hands/CapsuleHand.cs:175)
Leap.Unity.CapsuleHand:UpdateHand() (at Assets/LeapMotion/Scripts/Hands/CapsuleHand.cs:101)
Leap.Unity.HandProxy:UpdateRepresentation(Hand, ModelType) (at Assets/LeapMotion/Scripts/HandProxy.cs:43)
Leap.Unity.LeapHandController:UpdateHandRepresentations(Dictionary`2, ModelType, Frame) (at Assets/LeapMotion/Scripts/LeapHandController.cs:111)
Leap.Unity.LeapHandController:Update() (at Assets/LeapMotion/Scripts/LeapHandController.cs:74)

Remove ToUnity and ToUnityScaled

Currently ToUnity and ToUnityScaled don't do anything different than ToVector3. Either they should be changed so that they have a use, or they should be removed.

Judder when moving hands in VR

See https://community.leapmotion.com/t/judder-in-vr-when-using-rigged-hands/4712

Developer reports horrible judder when using SkeletalHand-based hand models. Hand motion itself is fine, the judder occurs when the camera is moving (controlled by head tracking).

This sounds similar to the problem we had some time ago and which was fixed by parenting the hand objects to the HandController. In this earlier issue, attaching the HandController to a moving object caused the hands to judder when ever the parent object moved.

HandDrop destination seems fairly random

The position to which the hand model returns when tracking is lost seems fairly random. It isn't the starting point in the scene and it isn't the first tracked position of the hand. Just holding a hand steady in the Leap field of view and then covering the leap with the other hand so that the tracking is abruptly lost will result in the tracked hand model "dropping" to different positions on successive repetitions.

There is also a problem when hand re-identification occurs. If the hand switches chirality, the old hand remains stuck in the position of the switch. Oddly, in this case, the destination is consistent -- it doesn't move at all.

Issues in Leap.Hand.Basis and Leap.Hand.TransformedCopy

There are two issues in this method:

//TODO verify this calculation for both hands
_basis.zBasis = -Direction;
_basis.yBasis = -PalmNormal;
_basis.xBasis = _basis.zBasis.Cross(_basis.yBasis);

The first is that, as the comment present in code suggests, the cross product must be different for each hand, if a left-handed basis is expected for left hands, and a right-handed basis is expected for right hands.
The second is much more subtle. When you call the method Hand.TransformedCopy, a new Hand instance is created where the vectors Direction and PalmNormal are multiplied by a matrix, usually the LeapMatrix. Now, the LeapMatrix M, as currently provided by the method Controller.GetLeapMatrix, has a reflection on the Z axis, and thus we have that:

M(-Direction x -PalmNormal) != M(-Direction) x M(-PalmNormal)

Which is to say that the value of Hand.TransformedCopy(...).Basis.xBasis is wrong.

The following snippet illustrates the issue:

      Matrix leapMat = GetLeapMatrix();
      Frame frame = leap_controller_.Frame(); 
      Frame transformed = frame.TransformedCopy( leapMat );

      if (frame.Hands.Count > 0)
      {
          Assert.AreEqual(
              // _M_(-Direction x -PalmNormal)
              leapMat.TransformDirection(frame.Hands[0].Basis.xBasis).Normalized,

              // _M_(-Direction) x _M_(-PalmNormal)
              transformed.Hands[0].Basis.xBasis
              );
      }

The assertion always fails.

Hand always reports it is invalid

The hand constructor never set _isValid to true.

The IsValid concept has been removed from LeapC in platform. Mark this fixed when LeapC code is next merged here.

LeapUnityExtensions need some fixing

FlipZ was changed to not flip at all. It should be set to (1, 1, -1).
ToUnityScaled() doesn't scale. In its current form, it is equivalent to ToVector3(), simply converting a Leap.Vector object to a Unity Vector3 object.

There are several uses of ToUnityScaled() in the Orion assets. These also need to be changed to ToVector3().

Make Abstract class for LeapProvider

We should add an abstract base for LeapProvider, that way we can provide alternate ways to provide frames into the scene. Currently there is no way to play back recordings for example.

Add custom editor helper

In our custom editor scripts we often keep doing similar tasks. For example: Specifying a custom editor for a single variable, or hiding/showing a field based on a condition.

I feel that we can consolidate these separate efforts into a single subclass of Editor to both reduce boilerplate and reduce errors.

RigidHand prefabs don't scale well

If you scale the a parent of the hand objects, the capsule colliders get over scaled: https://community.leapmotion.com/t/unity-orion-physics-model-to-big/4752

In addition, the palm object's collider is set to be a few meters in size and then scaled down by its transform. This, apparently, leads to problems with interactions involving Unity physics: https://community.leapmotion.com/t/scaled-palm-bug/4816. Setting the proper size for the collider (in mm) and resetting the scale to (1,1,1) fixes the over scaling problem for the palm.

All Android files should be together

It is totally fine to have multiple different Plugins folders, and they do not need to be located at the root of the Assets. For the android files currently located in the root Plugins folder, we should move those to a new Plugins folder at Assets/LeapMotionModules/Android/Plugins

Investigate ways to profile time/memory on worker thread

Currently we have no way of easily profiling performance or garbage on the worker thread, which can make it difficult to track down issues. It would be nice to be able to have a nice process for this to be able to catch issues like #30 sooner.

Physics hands separate from graphics hands

See this post: https://community.leapmotion.com/t/unity3d-orion-rigidhand-not-following-capsulehand-during-movement/4780

"I have a project setup where I interact with the controls inside of a spaceship using Orion.
Problem is that the RigidHand hitbox does not follow the model of the hand as it should when the ship starts moving forward.

When the ship is idle everything works perfectly, but as soon as it starts moving, the RigidHand always drags up behind. Problem is probably due to a simple timing between updating the model of the hand and its hitboxes."

GetFixedFrame does not calculate timeline offset properly.

The timeline synchronization method previously used in HandController has not been properly ported over to LeapProvider.

There is a inspector-side variable called PerFrameFixedUpdateOffset but I am not sure why it exists. It is a constant value being passed into a smoothing structure (which can do nothing with a constant) and then used to calculate the correctedTimestamp. As far as I can see this is causing the physics hands to behave strangely and lag behind the graphical hands.

Leap.Finger.TransformedCopy doesn't propagate the fingerId correctly

The Finger constructor sets

_id = (handId *10) + fingerId

The fingerId itself is not stored in the Finger class. Later, when TransformedCopy is called, this _id is passed as fingerId to the constructor, which once again adds handId * 10.
The result is that the Id of the transformed copy is different from the original object.

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.