0

I am trying to run the sample openNI Skeleton Tracking application (UserTracker.java application) on a pre-recorded .oni file. I have edited the SamplesConfig.xml file to direct the input from the ONI file and not a Kinect (I don't actually have one). However, I get the following Exception. Can anybody help me here?

org.OpenNI.StatusException: Function was not implemented!

at org.OpenNI.WrapperUtils.throwOnError(WrapperUtils.java:30)

at org.OpenNI.Context.initFromXmlEx(Context.java:371)

at org.OpenNI.Context.createFromXmlFile(Context.java:36)

at UserTracker.<init>(UserTracker.java:149)

at UserTrackerApplication.main(UserTrackerApplication.java:67)

Any help will be appreciated. Thanks!

EDIT: I found a solution here, this has removed the earlier exception that I was getting, but now I get the following!

org.OpenNI.StatusException: This operation is invalid!

Anybody knows why this is happening?

Community
  • 1
  • 1
mksh15
  • 97
  • 8

1 Answers1

2

I had a similar problem, I wanted to read data from a .oni file that I generated and I was getting the same issue. Now the problem is solved and maybe you solved it too, but I think it's important to share information to others that might come to this post. I found some clues in others posts by the way.

So here is the solution. The NiUserTracker sample can be used with an .oni file so I checked the code and they do the following:

xn::Player g_Player; //Global variable

// This goes in the main or another function

if (argc > 1)
{
    nRetVal = g_Context.Init();
    CHECK_RC(nRetVal, "Init");
    nRetVal = g_Context.OpenFileRecording(argv[1], g_Player);
    if (nRetVal != XN_STATUS_OK)
    {
        printf("Can't open recording %s: %s\n", argv[1], xnGetStatusString(nRetVal));
        return 1;
    }
}

This is C++ code, I work with c++. So as you can see they don't init the kinect via XML file if they want to open a recorded .oni file, they just init it via Init() method and then open a file with openFileRecording method.

If you want to open a .oni file there's no need to modify your XML, this way you can do an application that allows you to chose if you want to use a .oni or the kinect.

I hope this helps someone.

cheers.

Emil
  • 7,220
  • 17
  • 76
  • 135
FEL
  • 21
  • 1