Rosanswers logo

I have heard many people mention that they are saving the calibration data from a user and applying it to new users, in order to avoid the calibration pose. Where can I find the code that people are using to do this?

Originally posted by qdocehf on ROS Answers with karma: 208 on 2011-08-02

Post score: 0


1 Answer 1


Rosanswers logo

You can google around for it, but here are the functions:

XnStatus SaveCalibrationData( XnUserID user, XnUInt32 nSlot )
XnStatus LoadCalibrationData( XnUserID user, XnUInt32 nSlot )

and here they are in action:

XnStatus nRetVal = g_UserGenerator.GetSkeletonCap().SaveCalibrationData(nId, saveSlot);
    if (nRetVal == XN_STATUS_OK){
        printf("Calibration data has been saved!\n");
        printf("Saving calibration data has failed!\n");

XnStatus nRetVal = g_UserGenerator.GetSkeletonCap().LoadCalibrationData(nId, loadSlot);
        if (nRetVal == XN_STATUS_OK)

There's also a SaveCalibrationDataToFile but I haven't figured out a way to get it to work yet... Unless you can save it to a file, the user will have to calibration at least once because SaveCalibrationData only saves to memory from my understanding.

An example of the SaveCalibrationDataToFile can be found in the OpenNI github samples, specifically here: http://https://github.com/OpenNI/OpenNI/blob/master/Samples/NiUserTracker/main.cpp

Originally posted by daaango with karma: 101 on 2011-08-02

This answer was ACCEPTED on the original site

Post score: 1

Original comments

Comment by daaango on 2011-08-03:
The current version has SaveCalibrationData and LoadCalibrationData. As for the DataToFile ones, I'm not exactly sure on their status

Comment by qdocehf on 2011-08-03:
Where is the code for the implementation for these functions? I don't think the current version of ROS has them, so I would need to add them.

Comment by daaango on 2011-08-02:
So far, I've only tried it with myself and my calibration, but when it loads calibration for me, from what I remember, its completely accurate. I have yet to do any extensive testing though...

Comment by qdocehf on 2011-08-02:
Also, when I use LoadCalibrationData, how well does the data line up with the new user? Are all of the joints in the correct positions, or is it only likely that one or two will be?

Comment by daaango on 2011-08-02:
Well you're going to have to go around and understand the tracker code, but what you could do is put the SaveCalibrationData part into the "XN_CALLBACK_TYPE UserCalibration_CalibrationEnd", which is when a user is calibrated and it starts tracking. For the LoadCalibrationData, it dependsonyourneeds

Comment by qdocehf on 2011-08-02:
Should I copy this code and paste it in openni_tracker.cpp?


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.