Giter Site home page Giter Site logo

Comments (7)

MattGrayUL avatar MattGrayUL commented on June 4, 2024

Hi @cubesky sorry for a late reply!

I am not sure it's possible to get to that line of code if the boneNum is 0

boneNum relates to the joints index where 0 is the metacarpal. The check just above in this loop will continue to the next index if the BoneType is Metacarpal:

                //Ignore the metacarpal as it will never really change.
                if (serializedHandBone.Type == Bone.BoneType.TYPE_METACARPAL)
                {
                    lastBoneRotation = activeHandBone.Rotation;
                    lastSerializedBoneRotation = serializedHandBone.Rotation;
                    continue;
                }

Are you actually getting this IndexOutOfRangeException? if so, I am happy to add an explicit check for boneNum == 0

from unityplugin.

cubesky avatar cubesky commented on June 4, 2024

Yes, I got this Exception.
image

I'm using Pose Detector, but I can not find any example for Pose Detector on this version. So I use the following code on Pose Detector.

using Leap.Unity;
using UnityEngine;

[CreateAssetMenu(fileName = "GrabPose", menuName = "ScriptableObjects/GrabPoseScriptableObject", order = 1)]
public class GrabPose : HandPoseScriptableObject
{
    public GrabPose() { 
        for (int i = 0; i < 5; i++)
        {
            this.fingerJointRotationThresholds[i].jointThresholds = new [] { 
                new Vector2(0,0),new Vector2(0,0),new Vector2(0,0),new Vector2(0,0),new Vector2(0,0)
            };
        }
        SetAllBoneThresholds(0.8f, true);
        Debug.Log(this.fingerJointRotationThresholds.Length);
    }
}

from unityplugin.

MattGrayUL avatar MattGrayUL commented on June 4, 2024

Ah, the Poses are not intended to be made via code - but it's good that you've drawn our attention to it!

If you are hoping to detect grabs, I recommend using the code paths for this, as "grab" can often mean different things for different people, so isn't best represented as a pose (a complete shape)

If you do, however want to use Poses:

We actually have a collection of Poses that ship with the plugin, discussed in this docs page

image

You can also produce your own Poses by using the Pose Recorder Example Scene discussed here

from unityplugin.

cubesky avatar cubesky commented on June 4, 2024

Oh, Hand Pose doesn't show up in Unity, and the document not mention it.

image

I find it in the sdk forwarding your image! Thanks

from unityplugin.

MattGrayUL avatar MattGrayUL commented on June 4, 2024

Ah, I see! That is because it's in the Packages folder, not Assets or Scene, which Unity hides by default 🤦 (see the hidden files in this screenshot!)

image

from unityplugin.

cubesky avatar cubesky commented on June 4, 2024

Oh! Thanks! Now I can see them in select dialog. May be a document update for this?

from unityplugin.

MattGrayUL avatar MattGrayUL commented on June 4, 2024

I will raise a ticket for it :)

Thanks for raising this issue, I will now close it

from unityplugin.

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.