ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

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");
    else 
        printf("Saving calibration data has failed!\n");

XnStatus nRetVal = g_UserGenerator.GetSkeletonCap().LoadCalibrationData(nId, loadSlot);
        if (nRetVal == XN_STATUS_OK)
        {
            g_UserGenerator.GetPoseDetectionCap().StopPoseDetection(nId);
            g_UserGenerator.GetSkeletonCap().StartTracking(nId);
        }

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 the SaveCalibrationData is only saved to memory.

An example of the SaveCalibrationDataToFile can be found in the OpenNI github samples, specifically this

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");
    else 
        printf("Saving calibration data has failed!\n");

XnStatus nRetVal = g_UserGenerator.GetSkeletonCap().LoadCalibrationData(nId, loadSlot);
        if (nRetVal == XN_STATUS_OK)
        {
            g_UserGenerator.GetPoseDetectionCap().StopPoseDetection(nId);
            g_UserGenerator.GetSkeletonCap().StartTracking(nId);
        }

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 the SaveCalibrationData is only saved to memory.saves to memory from my understanding.

An example of the SaveCalibrationDataToFile can be found in the OpenNI github samples, specifically this

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");
    else 
        printf("Saving calibration data has failed!\n");

XnStatus nRetVal = g_UserGenerator.GetSkeletonCap().LoadCalibrationData(nId, loadSlot);
        if (nRetVal == XN_STATUS_OK)
        {
            g_UserGenerator.GetPoseDetectionCap().StopPoseDetection(nId);
            g_UserGenerator.GetSkeletonCap().StartTracking(nId);
        }

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 thishere

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");
    else 
        printf("Saving calibration data has failed!\n");

XnStatus nRetVal = g_UserGenerator.GetSkeletonCap().LoadCalibrationData(nId, loadSlot);
        if (nRetVal == XN_STATUS_OK)
        {
            g_UserGenerator.GetPoseDetectionCap().StopPoseDetection(nId);
            g_UserGenerator.GetSkeletonCap().StartTracking(nId);
        }

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

here: http://https://github.com/OpenNI/OpenNI/blob/master/Samples/NiUserTracker/main.cpp