12345467860785678 Posted August 26, 2021 Share Posted August 26, 2021 I can get callback from TestListener.cs when my gesture was index pinch, middle pinch. But it doesn't work if listening other gesture like fist, five, ok... And here is my testing properties. Link to comment Share on other sites More sharing options...
VIVE_chengnay Posted August 26, 2021 Share Posted August 26, 2021 @12345678912345678912345678 Currently, VIU is not supporting static gesture like fist, five, ok... etc. We are planning to add this in the future. Will keep you updated when it is ready. Link to comment Share on other sites More sharing options...
12345467860785678 Posted August 26, 2021 Author Share Posted August 26, 2021 @chengnay Thank for your reply. But is there any alternative solutions for this? Like using ViveJointPoseTracker to discriminate what gesture it is? Link to comment Share on other sites More sharing options...
VIVE_chengnay Posted August 26, 2021 Share Posted August 26, 2021 @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 More sharing options...
12345467860785678 Posted August 26, 2021 Author Share Posted August 26, 2021 @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 More sharing options...
VIVE_chengnay Posted August 26, 2021 Share Posted August 26, 2021 @12345678912345678912345678 I suggest that you can write another script, and you can get joint pose from below API. For example, var indexProximal = default(JointPose); VivePose.TryGetHandJointPose(role, HandJointName.IndexProximal, out indexProximal); Link to comment Share on other sites More sharing options...
12345467860785678 Posted August 26, 2021 Author Share Posted August 26, 2021 @chengnay I got it, thank you very much. I will give it a try and reply here if I got any trouble. 1 Link to comment Share on other sites More sharing options...
12345467860785678 Posted August 26, 2021 Author Share Posted August 26, 2021 @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 More sharing options...
VIVE_chengnay Posted August 26, 2021 Share Posted August 26, 2021 @12345678912345678912345678 How about add below code? public ViveRoleProperty role = ViveRoleProperty.New(); And set role in Unity Editor. Link to comment Share on other sites More sharing options...
Naukri Posted August 26, 2021 Share Posted August 26, 2021 (edited) 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? Edited August 26, 2021 by Naukri Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now