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

daaango's profile - activity

2012-04-19 03:04:02 -0500 received badge  Famous Question (source)
2011-11-30 19:26:35 -0500 received badge  Notable Question (source)
2011-09-09 00:28:23 -0500 received badge  Popular Question (source)
2011-08-09 07:33:39 -0500 commented answer OpenNI: "Save calibration to file failed: This operation is invalid!"
you're right, sorry about that. I deleted UserCalibration_CalibrationEnd completely from my version as its not called anywhere in the program.
2011-08-08 08:15:39 -0500 commented answer OpenNI: "Save calibration to file failed: This operation is invalid!"
check the post! I added a second edit
2011-08-08 07:45:29 -0500 received badge  Nice Answer (source)
2011-08-08 07:34:07 -0500 received badge  Self-Learner (source)
2011-08-08 07:04:21 -0500 commented question OpenNI: "Save calibration to file failed: This operation is invalid!"
To get it to save calibration, all you have to do is paste "g_UserGenerator.GetSkeletonCap().IsCalibrated(aUserIDs[i])" into the XN_CALLBACK_TYPE UserCalibration_CalibrationStart function, specifically after "g_UserGenerator.GetSkeletonCap().StartTracking(nId)" which is around line 130.
2011-08-08 06:56:38 -0500 answered a question OpenNI: "Save calibration to file failed: This operation is invalid!"

Looks like it has to do with the ROS version of OpenNI, as saving to file works when using the unstable version of OpenNI. Refer to the original post for a link to instructions on how to do that.

Special thanks to Miguel Prada and Asomerville!


edit: For those who wish to test this for themselves (specifically qdocehf cough cough), after installing OpenNI navigate to the folder OpenNI/Samples/NiUserTracker/ and copy the following files to a new directory: SceneDrawer.cpp SceneDrawer.h main.cpp

Open up main.cpp and after line 146, paste

g_UserGenerator.GetSkeletonCap().SaveCalibrationDataToFile(nId, "calibration.bin")

and then compile the file with g++:

g++ -o NiUserTracker SceneDrawer.cpp main.cpp -I/usr/include/ni/ -l'OpenNI' -l'glut'

This will simply save the calibration of any user who performs the psi pose (continuously overwriting the .bin file). This is meant to just be a quick demo to make sure saving calibration data to file works. There is already a function on line 167 that is supposed to save calibration when the s key is pushed, but I must be using it wrong because I didn't get it working and don't really care for it enough to figure it out.

edit2: For testing loading calibration files, around line 90 of main.cpp, just paste in the following code:

g_UserGenerator.GetSkeletonCap().LoadCalibrationDataFromFile(nId, "calibration.bin");
g_UserGenerator.GetPoseDetectionCap().StopPoseDetection(nId);
g_UserGenerator.GetSkeletonCap().StartTracking(nId);

This will simply load up a calibration file as soon as a new user detected, so you'll want to fiddle around some more with code to make sure a calibration file is available, make sure its not requesting calibration after loading, etc...

2011-08-06 14:08:01 -0500 received badge  Good Question (source)
2011-08-03 06:13:15 -0500 commented answer Recycling Calibration Data for Skeleton Tracking
The current version has SaveCalibrationData and LoadCalibrationData. As for the DataToFile ones, I'm not exactly sure on their status
2011-08-02 19:14:09 -0500 received badge  Teacher (source)
2011-08-02 07:39:47 -0500 commented answer Recycling Calibration Data for Skeleton Tracking
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...
2011-08-02 07:10:56 -0500 commented answer Recycling Calibration Data for Skeleton Tracking
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
2011-08-02 06:26:33 -0500 commented question OpenNI: "Save calibration to file failed: This operation is invalid!"
I was hoping it would maybe be a usage error on my part or something, but I guess deep down I had an inclination that it had something to do with openni... Hopefully someone who deals with OpenNI integration in ROS will stumble upon this thread and provide some insight!
2011-08-02 06:16:42 -0500 answered a question Recycling Calibration Data for Skeleton Tracking

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: http://https://github.com/OpenNI/OpenNI/blob/master/Samples/NiUserTracker/main.cpp

2011-07-26 06:26:55 -0500 received badge  Supporter (source)
2011-07-24 23:36:18 -0500 received badge  Nice Question (source)
2011-07-24 02:17:09 -0500 received badge  Student (source)
2011-07-22 07:10:12 -0500 received badge  Organizer (source)
2011-07-22 07:06:59 -0500 received badge  Editor (source)
2011-07-20 06:48:29 -0500 asked a question OpenNI: "Save calibration to file failed: This operation is invalid!"

Hi everyone,

I've been trying to use the SaveCalibrationDataToFile function in OpenNI but so far, it hasn't been going so well. When I try to call it, it returns a

Save calibration to file failed: This operation is invalid!

Here's the few lines of code:

  if (g_UserGenerator.GetSkeletonCap().IsCalibrated(nId)){
      XnStatus nRetVal = g_UserGenerator.GetSkeletonCap().SaveCalibrationDataToFile(nId, calib.bin);
      if (nRetVal != XN_STATUS_OK)
          printf("Save calibration to file failed: %s\n", xnGetStatusString(nRetVal));
  }

I also downloaded someone else's calibration file and tried to load it, but it yielded the same "operation is invalid" message. Anyone have any clues?

Thanks

Update: I tried installing ROS and OpenNI via source in order to use the newest version, but it still displays the horrid and vague "invalid" message.

Update2: I installed the latest unstable version of OpenNI and SaveCalibrationDataToFile works! For anyone who wants to do that, http://groups.google.com/group/openni... will prove to be very useful