调用getPoseAtTime()

时间:2016-06-27 22:30:15

标签: java android java-native-interface google-project-tango

我要做的是基本上获取设备的位置,就像运动跟踪示例一样。我阅读了Tango网站上的exmaple和示例Java代码。我尝试了Mira的Mira和Okul版本,但崩溃一直在发生。不确定我做了哪一步是错的。

完整的logcat输出发布在github gist上。对于较短的版本:

A/art: art/runtime/check_jni.cc:64] JNI DETECTED ERROR IN APPLICATION: jfieldID was NULL
A/art: art/runtime/check_jni.cc:64]     in call to SetDoubleField
A/art: art/runtime/check_jni.cc:64]     from int com.google.atap.tango.TangoJNINative.GetPoseAtTime(double, int, int, com.google.atap.tangoservice.TangoPoseData)
A/art: art/runtime/check_jni.cc:64] "LTSensorActivity" prio=5 tid=14 Runnable
A/art: art/runtime/check_jni.cc:64]   | group="main" sCount=0 dsCount=0 obj=0x64929dc8 self=0x4b160d68
A/art: art/runtime/check_jni.cc:64]   | sysTid=14960 nice=0 cgrp=apps sched=0/0 handle=0x43f05ec8
A/art: art/runtime/check_jni.cc:64]   | state=R schedstat=( 2661834 1966000 13 ) utm=0 stm=0 core=3 HZ=100
A/art: art/runtime/check_jni.cc:64]   | stack=0x4b48e000-0x4b492000 stackSize=1040KB
A/art: art/runtime/check_jni.cc:64]   native: art::Thread::DumpStack(std::ostream&) const+87 [0x4165db78] (libart.so)
A/art: art/runtime/check_jni.cc:64]   native: ??? [0x415098a6] (libart.so)
A/art: art/runtime/check_jni.cc:64]   native: art::JniAbortF(char const*, char const*, ...)+51 [0x4150a254] (libart.so)
A/art: art/runtime/check_jni.cc:64]   native: ??? [0x4150d036] (libart.so)
A/art: art/runtime/check_jni.cc:64]   native: ??? [0x41510336] (libart.so)
A/art: art/runtime/check_jni.cc:64]   native: Java_com_google_atap_tango_TangoJNINative_GetPoseAtTime__DIILcom_google_atap_tangoservice_TangoPoseData_2+57 [0x4b789dfe] (libtango_client_api.so)
A/art: art/runtime/check_jni.cc:64]   at com.google.atap.tango.TangoJNINative.GetPoseAtTime(Native method)
A/art: art/runtime/check_jni.cc:64]   at com.google.atap.tangoservice.Tango.getPoseAtTime(Tango.java:582)
A/art: art/runtime/check_jni.cc:64]   at info.dword1511.aoasensor.MappingActivity.getLocation(MappingActivity.java:259)
A/art: art/runtime/check_jni.cc:64]   at info.dword1511.aoasensor.MappingActivity.access$000(MappingActivity.java:30)
A/art: art/runtime/check_jni.cc:64]   at info.dword1511.aoasensor.MappingActivity$1.run(MappingActivity.java:48)
A/art: art/runtime/check_jni.cc:64]   at android.os.Handler.handleCallback(Handler.java:733)
A/art: art/runtime/check_jni.cc:64]   at android.os.Handler.dispatchMessage(Handler.java:95)
A/art: art/runtime/check_jni.cc:64]   at android.os.Looper.loop(Looper.java:136)
A/art: art/runtime/check_jni.cc:64]   at android.os.HandlerThread.run(HandlerThread.java:61)
A/art: art/runtime/check_jni.cc:64] 
A/art: art/runtime/runtime.cc:203] Runtime aborting...
...
A/libc: Fatal signal 6 (SIGABRT) at 0x000039b7 (code=-6), thread 14960 (LTSensorAct)

重现错误的简档代码发布在github gist

1 个答案:

答案 0 :(得分:0)

可能是poller在连接Tango之前轮询数据吗?您只能在this调用完成后查询数据,还要注意它在runnable中,因此您的轮询函数可能会在连接行执行之前运行。