Adjuvo / SenseGlove-Unity

The latest stable Unity SDK for the SenseGlove.
MIT License
34 stars 10 forks source link

Get fingertip position #18

Closed missxa closed 3 years ago

missxa commented 4 years ago

In your C++ SDK you have a function CalculateFingerTips() to get cartesian coordinates of the fingertips relative to the hand origin. I don't seem to find an analogous function for Unity. What is the best way to implement getting the fingertip position?

MaxLammers commented 4 years ago

The C++ API offers more advanced features than the current release of our Unity Plugin (v1.2). In the next release (v1.3, planned release 1/10/20), our Unity SDK will use a similar backed to the C++ API in C#, and it will become much easier to access fingertip position.

If you want to get this functionality up and running now, I'd recommend looking at the last of the gloveRotations and glovePositions in the SG_SenseGloveDatathat you get from a SG_SenseGloveHardWare component. These represent the Quaternion rotation and position of each glove's linkage, relative to the glove origin. You might want to add an estimated offset to account for how far the Velcro straps have been pulled over the fingers. This is the approach that is applied in the C++ and next C# release as well.

The above example refers to the fingertip positions as determined by the Glove exoskeleton. If you wish to access the fingertip positions as the result of the hand pose that we calculate, your need look no further than the handRotations and handPositions in the same SG_SenseGloveData script.