OpenNI UserTracker.java 示例崩溃

发布于 2024-11-26 06:50:08 字数 1804 浏览 0 评论 0原文

我已经从 Github 上的源代码构建了 OpenNI 和 Sensor,并安装了 Nite。我已经在具有 2.6.39 内核和不同版本 Java 的 Debian 上进行了测试,并在另一台具有 Lubuntu 11.04 以及 OpenNI不稳定和 avin2 传感器的计算机上进行了测试 - 相同的结果。我还使用预构建的二进制文件进行了测试。

C++ 和 .NET 中的 UserTracker 示例可以工作,但 UserTracker.java 会运行并检测我的轮廓,然后当我做出校准姿势时 JVM 崩溃。这是崩溃前的输出:

New user 1
Pose Psi detected for 1

我尝试过使用代码,但找不到导致它的代码片段 - 它不会在 PoseDetectedObserver.update 中崩溃。

以下是相关示例的链接: https://github.com/OpenNI/OpenNI/blob/master/Samples/UserTracker.java/org/OpenNI/Samples/UserTracker/UserTracker.java

有没有其他人遇到过这个问题,或者也许发现了什么问题?

编辑:我已经在 SamplesConfig.xml 和 Java 示例中打开了日志记录 在启动时输出这些警告,而 C++ 和 .NET 示例只是 有最后一个 - 这是我在日志中发现的唯一区别。

  125 INFO       OpenNI version is 1.3.2 (Build 3)-Linux-x86 (Jul 28 2011 03:43:14)
  141 INFO       Filter Info - minimum severity: WARNING, masks: ALL
 2482 WARNING    Failed loading lib: /usr/lib/libXnVFeatures_1_3_0.so: undefined symbol: xnOSStrFormat

 2489 WARNING    Failed to load '/usr/lib/libXnVFeatures_1_3_0.so' - missing dependencies?
 4080 WARNING    Failed loading lib: /usr/lib/libXnVHandGenerator_1_3_0.so: undefined symbol: xnOSStrFormat

 4087 WARNING    Failed to load '/usr/lib/libXnVHandGenerator_1_3_0.so' - missing dependencies?
 7581 WARNING    Open named event: failed to open key file (2) - event might not exist...

edit2:我现在已经设置了赏金,这里有一个详细的日志文件,并从 Lubuntu 11.04 上最新不稳定版本的 OpenNI、NITE 和 avin2 的 SensorKinect 转储: http://pastebin.com/anG18agp http://pastebin.com/mAkf0G6M

I've built OpenNI and Sensor from source on Github and installed Nite. I've tested this on Debian with 2.6.39 kernel and with different versions of Java, and on another computer with Lubuntu 11.04 and also with OpenNI unstable and avin2 Sensor - same result. I've also tested with prebuilt binaries.

The UserTracker sample in C++ and .NET works, but the UserTracker.java runs, detects my silhouette, and then the JVM crashes when I make the calibration pose. This is the output before the crash:

New user 1
Pose Psi detected for 1

I've tried playing around with the code, but I can't find the piece of code that causes it - it doesn't crash in PoseDetectedObserver.update.

Here is the link to the example in question: https://github.com/OpenNI/OpenNI/blob/master/Samples/UserTracker.java/org/OpenNI/Samples/UserTracker/UserTracker.java

Has anyone else encountered this problem, or perhaps sees what could be wrong?

edit: I've turned on logging in the SamplesConfig.xml, and the Java samples
output these warnings on startup, while the C++ and .NET samples, just
have that last one - that's the only difference I find in the logs.

  125 INFO       OpenNI version is 1.3.2 (Build 3)-Linux-x86 (Jul 28 2011 03:43:14)
  141 INFO       Filter Info - minimum severity: WARNING, masks: ALL
 2482 WARNING    Failed loading lib: /usr/lib/libXnVFeatures_1_3_0.so: undefined symbol: xnOSStrFormat

 2489 WARNING    Failed to load '/usr/lib/libXnVFeatures_1_3_0.so' - missing dependencies?
 4080 WARNING    Failed loading lib: /usr/lib/libXnVHandGenerator_1_3_0.so: undefined symbol: xnOSStrFormat

 4087 WARNING    Failed to load '/usr/lib/libXnVHandGenerator_1_3_0.so' - missing dependencies?
 7581 WARNING    Open named event: failed to open key file (2) - event might not exist...

edit2: I've now set a bounty and here's a verbose log file and dump from the latest unstable versions of OpenNI, NITE and avin2's SensorKinect on Lubuntu 11.04: http://pastebin.com/anG18agp http://pastebin.com/mAkf0G6M

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

身边 2024-12-03 06:50:08

OpenNI 的 java 包装类中有一个错误:

在 org_OpenNI_NativeMethods.cpp 中读取:

void XN_CALLBACK_TYPE PoseDetectionHandler(XnNodeHandle hNode, const XnChar* strPose, XnUserID user, void* pCookie)
{
    CallbackCookie* pCallback = (CallbackCookie*)pCookie;
    JNIEnvSupplier supplier;
    jstring jPose = supplier.GetEnv()->NewStringUTF(strPose);
    supplier.GetEnv()->CallVoidMethod(pCallback->obj, pCallback->mid, jPose, user);
    supplier.GetEnv()->ReleaseStringUTFChars(jPose, strPose);
}

但是您不应该释放 StringUTF 分配有 newStringUTF 的字符串...因此它崩溃了..
请参阅此处的示例: http://www.velocityreviews.com/forums/t144581-crash-while-calling-releasestringutfchars-for-newstringutf-string.html

获取源代码...取消注释发布行..构建 OpenNI.jni.dll 并且 usetracker.java 将运行!

此致,
大卫

there is an error in the java wrapper classes of OpenNI:

In org_OpenNI_NativeMethods.cpp is reads:

void XN_CALLBACK_TYPE PoseDetectionHandler(XnNodeHandle hNode, const XnChar* strPose, XnUserID user, void* pCookie)
{
    CallbackCookie* pCallback = (CallbackCookie*)pCookie;
    JNIEnvSupplier supplier;
    jstring jPose = supplier.GetEnv()->NewStringUTF(strPose);
    supplier.GetEnv()->CallVoidMethod(pCallback->obj, pCallback->mid, jPose, user);
    supplier.GetEnv()->ReleaseStringUTFChars(jPose, strPose);
}

But you are not supposed to releaseStringUTF a string allocated with newStringUTF... therefore it crashes..
See here for an example: http://www.velocityreviews.com/forums/t144581-crash-while-calling-releasestringutfchars-for-newstringutf-string.html

Get the source code... Uncomment the release line.. build the OpenNI.jni.dll and the usetracker.java will run!

Best regards,
David

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文