Jump to content

Trouble at listening gestures (ControllerButton) via ViveInput


12345467860785678
 Share

Recommended Posts

@12345678912345678912345678 You can calculate the curl angle for each finger.

For example,

private float GetFingerCurl(Vector3 root, Vector3 node1, Vector3 top)

{
            return Vector3.Angle(node1 - root, top - node1);
}

GetFingerCurl(hand.points[2], hand.points[3], hand.points[4]);

For thumb, you can use Promixal, Distal and Tip.

For rest of the fingers, you can use Proximal, Intermediate and Tip.

 

You can check the float value when you open or close your fingers.

Let me know if you still have issues, thank

Link to comment
Share on other sites

@chengnay Sorry, but how can I get the variable "hand" in your example code?

And ViveJointPoseTracker seem notworking to me. the log will just log once time when I open my fingers, and it won't update anymore.

Am I wrong in my understanding on this API?

My testing code:

public class Test : ViveJointPoseTracker
{
    public override void OnNewPoses()
    {
        RuntimeDebug.Log($"{posOffset}\r\n{transform.position}\r\n{origin.position}");
    }
}

Link to comment
Share on other sites

@chengnay It seem that still wasn't working to me...

Here is my testing code, and it will always print "Nothing" is there anything I miss it?

public class Test : MonoBehaviour
{
    public void Update()
    {
        if(VivePose.TryGetHandJointPose(HandRole.LeftHand, HandJointName.IndexTip, out var indexTip))
        {
            RuntimeDebug.Log($"indexTip pos={indexTip.pose.pos}\r\n rot={indexTip.pose.rot}");
        }
        else if (VivePose.TryGetHandJointPose(HandRole.LeftHand, HandJointName.IndexProximal, out var indexProximal))
        {
            RuntimeDebug.Log($"indexProximal pos={indexProximal.pose.pos}\r\n rot={indexProximal.pose.rot}");
        }
        else
        {
            RuntimeDebug.LogWarning("Nothing");
        }
    }
}

Link to comment
Share on other sites

Hi @chengnay  I'm @12345467860785678 my account got banned cause posting too many reply today.

It work perfectly now. 

But I got a new question, is there anyway to control VIU simulator's Hand via my hand? just like oculus develop tools, cause I need this to create my own gesture.

---

In addition the simulator's control devices can be hand in my memory, but it always render controller now even if I change the target device to hand.

Is there any problem on my settings?

image.png.8c389618d3d508b08a6fa670c456448c.png

Edited by Naukri
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...