rgbdemo / nestk

C++ Library for Kinect
http://nicolas.burrus.name/index.php/Research/KinectUseNestk
Other
78 stars 45 forks source link

openni/nite update #10

Open hackma opened 12 years ago

hackma commented 12 years ago

Can you update the openni/nite to the latest unstable version? Because the version have now the auto calibration feature, that the user must not do the psi pose. ;)

I have the latest libs from openni/nite/primesence installed. Can i disable openni/nite from nestk and use the unstable versions that i have also installed? I try it with NESTK_USE_EMBEDDED_OPENNi but it dont work. Maybe you can please tell me how i can upgrade the stuff.

Thx!

Best Regards, Marco

hackma commented 12 years ago

When i have set SET(NESTK_USE_EMBEDDED_OPENNI 0) than i get the following errors..

1334315768488301 INFO Log XnLog.cpp 333 New log started on 2012-04-13 13:16:08 1334315768488347 INFO Log XnLog.cpp 337 OpenNI version is 1.5.2 (Build 23)-Linux-x86 (Dec 28 2011 17:53:48) 1334315768488363 INFO Log XnLog.cpp 307 --- Filter Info --- Minimum Severity: NONE 1334315768488378 INFO Log XnLog.cpp 307 --- Filter Info --- Minimum Severity: WARNING 60610 WARNING xnOS LinuxSysVNamedEvents.cpp 130 Open named event: failed to open key file (2) - event might not exist... 10943700 WARNING xnOS LinuxSharedMemory.cpp 136 Could not create file '' for shared memory (2). 22637557 WARNING xnOS LinuxSharedMemory.cpp 136 Could not create file '' for shared memory (2). 23609733 WARNING xnOS LinuxSharedMemory.cpp 136 Could not create file '' for shared memory (2). 24616267 WARNING xnOS LinuxSharedMemory.cpp 136 Could not create file '' for shared memory (2). 25621319 WARNING xnOS LinuxSharedMemory.cpp 136 Could not create file '' for shared memory (2). 26622439 WARNING xnOS LinuxSharedMemory.cpp 136 Could not create file '' for shared memory (2). 27612197 WARNING xnOS LinuxSharedMemory.cpp 136 Could not create file '' for shared memory (2). 28616423 WARNING xnOS LinuxSharedMemory.cpp 136 Could not create file '' for shared memory (2). 29627054 WARNING xnOS LinuxSharedMemory.cpp 136 Could not create file 'É°ž@' for shared memory (2). 30621347 WARNING xnOS LinuxSharedMemory.cpp 136 Could not create file 'É°ž@' for shared memory (2).

Have you an idea how can i fix that? The application starts rgb/depth image is working but user generator don't works :(

Best Regards, Marco

nburrus commented 12 years ago

Hi Marco,

It should work if you disable the NESTK_USE_EMBEDDED_OPENNI cmake variable. If it doesn't, please open an issue with the errors you get.

Thanks, Nicolas

On Thu, Apr 12, 2012 at 8:21 AM, Marco reply@reply.github.com wrote:

Can you update the openni/nite to the latest unstable version? Because the version have now the auto calibration feature, that the user must not do the psi pose. ;)

I have the latest libs from openni/nite/primesence installed. Can i disable openni/nite from nestk and use the unstable versions that i have also installed? I try it with NESTK_USE_EMBEDDED_OPENNi but it dont work. Maybe you can please tell me how i can upgrade the stuff.

Thx!

Best Regards, Marco


Reply to this email directly or view it on GitHub: https://github.com/nburrus/nestk/issues/10

hackma commented 12 years ago

Hello, i has used the old nite version. I have now removed the old libs and reinstall the unstable openi/nite/sensorkinect stuff.

Now i can start my application, but it crashes when calibration is finished :( It must be a problem with access the m_ni_user_generator.GetSkeletonCap() in the calibrationCompletedCallback.

I have added in the openni_grabber following things to get autocalibration work:

void OpenniGrabber :: calibrationCompletedCallback(XnUserID nId, XnCalibrationStatus eStatus) { ntk_dbg(1) << cv::format("Calibration finished %d\n", nId); //m_ni_user_generator.GetSkeletonCap().AbortCalibration(nId);

if (eStatus == XN_CALIBRATION_STATUS_OK)
  {
        ntk_dbg(1) << cv::format("Calibration complete, start tracking user %d\n", nId);
        m_ni_user_generator.GetSkeletonCap().StartTracking(nId);
        return;
    }

    ntk_dbg(1) << cv::format("Calibration failed for user %d\n", nId);
   // m_ni_user_generator.GetSkeletonCap().AbortCalibration(nId);

    if(eStatus==XN_CALIBRATION_STATUS_MANUAL_ABORT)
                {
                    printf("Manual abort occured, stop attempting to calibrate!");
                    return;
                }

    if (m_need_pose_to_calibrate)
    {
        m_ni_user_generator.GetPoseDetectionCap().StartPoseDetection(m_calibration_pose, nId);
    }
    else
    {
        m_ni_user_generator.GetSkeletonCap().RequestCalibration(nId, TRUE);
    }

}

AND

XnCallbackHandle hCalibrationStart, hCalibrationComplete,hPoseDetected; m_ni_user_generator.GetSkeletonCap().RegisterToCalibrationStart(UserCalibration_CalibrationStart, NULL, hCalibrationStart); m_ni_user_generator.GetSkeletonCap().RegisterToCalibrationComplete(UserCalibration_CalibrationComplete, NULL, hCalibrationComplete);

    if (m_ni_user_generator.GetSkeletonCap().NeedPoseForCalibration())
    {
        m_need_pose_to_calibrate = true;
        if (!m_ni_user_generator.IsCapabilitySupported(XN_CAPABILITY_POSE_DETECTION))
            ntk_throw_exception("Pose required, but not supported\n");

        //m_ni_user_generator.GetPoseDetectionCap().RegisterToPoseCallbacks(UserPose_PoseDetected, NULL, this, hPoseCallbacks);
        m_ni_user_generator.GetPoseDetectionCap().RegisterToPoseDetected(UserPose_PoseDetected, NULL, hPoseDetected);
        m_ni_user_generator.GetSkeletonCap().GetCalibrationPose(m_calibration_pose);
    }

    //m_ni_user_generator.GetSkeletonCap().SetSkeletonProfile(XN_SKEL_PROFILE_ALL);
    m_ni_user_generator.GetSkeletonCap().SetSkeletonProfile(XN_SKEL_PROFILE_UPPER);

Nicolas have you tried out the auto calibration? Are my changes correct in the openni_grabber.cpp class? I did the same as in the Simple_UserTracker example from openni.

Thanks for your help!

Best regards, Marco