Software Archive
Read-only legacy content
17060 Discussions

QueryFingerData

Scott_W_1
Beginner
289 Views

Could someone provide an example of using QueryFingerData?

I've been trying to piece it together from the documentation, but not having much success yet.

I'm able to use QueryTrackedJoint to output the realworld positions of each joint, but want to compare it with the foldedness state of each finger.

Ideally, I would like to iterate through each finger, record the finger label, then output the foldedness of each. I've been working within the tutorial, trying to modify it for finger data:

for(int i = 0 ; i < numOfHands; i++)
        {
            // get hand joints by time of appearence
            PXCHandData::IHand* handData;

            if(outputData->QueryHandData(PXCHandData::ACCESS_ORDER_BY_TIME,i,handData) == PXC_STATUS_NO_ERROR)

            {
                PXCHandData::FingerData FingerData;
                //PXCHandData::JointType jointType;
                // iterate through fingers and get finger data    

        

                for(int j = 0; j < PXCHandData::NUMBER_OF_Fingers ; j++)
                    {

                      //pseudocode below 

                       handData->QueryFingerData(j,fingerdata);
                       //insert code to output data here similar to line below for jointdata
                        

                       //std::printf("Tracked Joint: %i, X: %2f, Y: %2f, Z: %2f \n",j, jointData.positionWorld.x, jointData.positionWorld.y, jointData.positionWorld.z);

                    }

 

0 Kudos
1 Solution
Jack_K_1
New Contributor II
289 Views

Scott,

The attached archive contains two C++ files: A modified main_hand_tracking_procedural.cpp (in the hand tracking tutorial) that has calls to routines in FingerUtils.cpp. 

The basic idea is to map a hand joint to a finger and then call the appropriate routine to get the finger information.

Regards,

Jack

View solution in original post

0 Kudos
2 Replies
Jack_K_1
New Contributor II
290 Views

Scott,

The attached archive contains two C++ files: A modified main_hand_tracking_procedural.cpp (in the hand tracking tutorial) that has calls to routines in FingerUtils.cpp. 

The basic idea is to map a hand joint to a finger and then call the appropriate routine to get the finger information.

Regards,

Jack

0 Kudos
Scott_W_1
Beginner
289 Views

Thanks! Perfect timing. I'm setting up a snapshot app to record hand poses. It currently can record the joint data. I'm now ready for the finger data.

0 Kudos
Reply