0
$\begingroup$

Rosanswers logo

Hello,

i use the openNi skeleton tracking. I achieved good results by saving the calibration data of the first Person, and the loading the data for all other Persons. Is it possible to save/load the data to/from a file or something like that? I found nothing like that in the API...

cheers, Thorsten


Originally posted by Thorsten on ROS Answers with karma: 61 on 2011-03-17

Post score: 2

$\endgroup$

2 Answers 2

0
$\begingroup$

Rosanswers logo

you can use Bags if you want to store ROS messages, if thats what you want. If its just some bunch of params then you could just write your own file for saving and loading.


Originally posted by blueskin with karma: 284 on 2011-03-17

This answer was ACCEPTED on the original site

Post score: 0


Original comments

Comment by tfoote on 2011-09-11:
Bags are the solution in ROS, for OpenNI native solution I suggest you ask this on their forums.

Comment by Thorsten on 2011-03-17:
I know about bags, but that's not the solution... The Problem is in the OpenNi API...

$\endgroup$
0
$\begingroup$

Rosanswers logo

I recently realised that new methods have been added to the OpenNI API to allow saving/loading skeleton calibration data to a file. However, I've trying to make them work without success. The methods I'm talking about are

XnStatus xn::SkeletonCapability::SaveCalibrationDataToFile(XnUserID user, const XnChar * strFileName)
XnStatus xn::SkeletonCapability::LoadCalibrationDataFromFile(XnUserID user, const XnChar * strFileName)

Has anyone managed to use those successfully?

Update: The code I used to test this is a modified version of openni_tracker.cpp in trunk. You can check lines 201 to 268 in http://pastebin.com/d0m6J6tb

The service requests contain the user id (int) and a filename (string), and I've tried both absolute and relative paths for the filename without success.

Update 2: Apparently it is a OpenNI version issue: http://answers.ros.org/question/1631/openni-save-calibration-to-file-failed-this


Originally posted by Miguel Prada with karma: 1071 on 2011-07-19

This answer was NOT ACCEPTED on the original site

Post score: 2


Original comments

Comment by qdocehf on 2011-08-08:
I have installed the latest unstable version of OpenNI, but running the Sample-NiUserTracker does not save the calibration. Which programs do I need to run to save the data? Also, what type of file do I need when using the SaveCalibrationToFile function?

Comment by Miguel Prada on 2011-08-07:
Apparently it is a OpenNI version issue: http://answers.ros.org/question/1631/openni-save-calibration-to-file-failed-this

Comment by qdocehf on 2011-08-05:
Also, why is it set up to advertise the save and load functions? Shouldn't they just be performed by openni_tracker.cpp?

Comment by qdocehf on 2011-08-05:
Where can I find more information on calibration_save_load? The parameters for the save and load functions come from it, but I don't see any constructions for these parameters.

Comment by qdocehf on 2011-08-05:
I am going to experiment with this, and if I get something that works, I will post it.

Comment by qdocehf on 2011-08-05:
Thanks, that worked. After trying out the code, It seemed to act exactly like the original openni_tracker.cpp. I think that it might be better for the CalibrationEnd function to call the save functions, and for the NewUser function to call the load functions, as opposed to main calling these.

Comment by Miguel Prada on 2011-08-04:
You probably need write permissions on the whole folder. Do a chmod -R a+rw to be safe ;)

Comment by qdocehf on 2011-08-04:
I removed the ROS_NOBUILD file, but I still have to use sudo to change any files. Also, when I try to rosmake the package, an error appears when it tries to create the binary file.

Comment by Miguel Prada on 2011-08-04:
You can make a copy of the package and prepend its path to ROS_PACKAGE_PATH. The ROS tools (rosmake, rosrun, etc.) will use the copy of the package found first (leftmost) on ROS_PACKAGE_PATH. If you copy a package installed with apt, you'll need to fix permissions and remove the ROS_NOBUILD file.

Comment by qdocehf on 2011-08-04:
I want to try this out, but I want to leave a copy of the original openni_tracker package. What is the best way to do this? I think that simply using the "cp" command would cause problems.

Comment by Miguel Prada on 2011-08-03:
Don't worry, it was a legitimate question. The way I tried those was by adding a couple of load/save services to openni_tracker. Unfortunately the files are on my laptop at work, so I'll be unable to show them until tomorrow (maybe late evening for you).

Comment by qdocehf on 2011-08-03:
Sorry, that was pretty dumb of me. Are you using these with the ROS code at all? If so, could you show me how you altered the code?

Comment by Miguel Prada on 2011-08-02:
No, @qdocehf, I'm not ;)

Comment by qdocehf on 2011-08-02:
Are you just copying the functions from the OpenNI API and pasting them into the ROS code?

Comment by Miguel Prada on 2011-07-28:
I'm guessing that it might be related to the OpenNI version in the Ubuntu openni-dev package. I'm afraid to test installing a newer version by hand on the production machine. When can a new version of OpenNI and NITE be expected to be released as an Ubuntu package?

Comment by JoeRomano on 2011-07-19:
they do not work for me either. I didn't try and debug too much. I'd be interested if there is a fix.

$\endgroup$

Your Answer

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