Nuitrackhelper.jar library implementation

I was wanting to find out how you implemented the nuitrackhelper.jar file in unity that allows development in c# and obtain tracking data when exporting to android. I am trying to integrate Nuitrack into the Godot game engine and I am struggling to find out how the nuitrackhelper.jar file works. There is not much documentation on this either. I have looked on these forms and tried to understand whats happening in the Nuitrack unity files to no avail. Please help!

Hi UomoCaffeLatte,

NuitrackHelper.jar library allows developer’s Android app to initialize Nuitrack installed as separate APK and load all dependent libraries. Please specify in more details what issue you encounter during integration Nuitrack to Godot Engine? Thank you.

I am creating a C++ module to interact with the Nuitrack API for the Godot Engine so that I can create projects for android. Therefore, I would have to call the NuitrackHelper init method through Java Native Interface. Then use the native nuitrack library as normal?

Thanks for helping out! I am not that experienced when dealing with android development.

Dear UomoCaffeLatte,

did you take a look at native sample for Android in Nuitrack SDK: Examples\nuitrack_gl_sample\android? Please refer to src\com\tdv\nuitrack\sdk\samples\NuitrackGLSampleActivity.java source file (Nuitrack.init method is called there).
Btw there is a tutorial for creating an Android Studio Native C++ project using Nuitrack SDK.

HI there, I can now successful call the init method from the nuitrackhelper.jar file and it returns onSucess within the android application. However, when I then go to run tdv::nuitrack::Nuitrack::init(); inside my C++ file it crashes the program.

This is the exception on which the app crashes. I cant really see whats the problem.

D/_NuitrackService_( 2036): Create Nuitrack Manager Service
D/_NuitrackService_( 2036): getChecker()
D/_NuitrackService_( 2036): onBind
D/_NuitrackService_( 2036): Check Updates
D/Nuitrack( 4471): Sucesss ---------------------------------------------------------------------
D/_NuitrackService_( 2036): onUnbind
D/_NuitrackService_( 2036): Destroy Nuitrack Manager Service
I/DEBUG   (  151): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
I/DEBUG   (  151): Build fingerprint: 'Android/rk3288_box/rk3288_box:5.1.1/LMY47V/root01172220:userdebug/test-keys'
I/DEBUG   (  151): Revision: '0'
I/DEBUG   (  151): ABI: 'arm'
I/DEBUG   (  151): pid: 4471, tid: 4491, name: GLThread 345  >>> org.godotengine.godotnuitrack <<<
I/DEBUG   (  151): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0
I/DEBUG   (  151):     r0 a132f278  r1 b9fbb2a0  r2 00000006  r3 00000000
I/DEBUG   (  151):     r4 00000000  r5 a132f1e8  r6 b9fbb2a0  r7 a132f2ac
I/DEBUG   (  151):     r8 b9fbb2a0  r9 a132f278  sl b9fb9db4  fp a132f358
I/DEBUG   (  151):     ip 00000074  sp a132f1e0  lr 9ca6bd71  pc 9ca6b998  cpsr 20070030
I/DEBUG   (  151): 
I/DEBUG   (  151): backtrace:
I/DEBUG   (  151):     #00 pc 00048998  /data/app/org.godotengine.godotnuitrack-1/lib/arm/libmiddleware.so (tdv::nuitrack::middleware::android::AndroidApp::attachCurrentThread()+19)
I/DEBUG   (  151):     #01 pc 00048d6d  /data/app/org.godotengine.godotnuitrack-1/lib/arm/libmiddleware.so (tdv::nuitrack::middleware::android::NuitrackManager::callMethod(std::string const&, std::string&)+60)
I/DEBUG   (  151):     #02 pc 000499a7  /data/app/org.godotengine.godotnuitrack-1/lib/arm/libmiddleware.so (tdv::nuitrack::middleware::android::NuitrackManager::getDataPath()+126)
I/DEBUG   (  151):     #03 pc 0001ad55  /data/app/org.godotengine.godotnuitrack-1/lib/arm/libnuitrack.so (tdv::nuitrack::Nuitrack::init(std::string const&)+80)
I/DEBUG   (  151):     #04 pc 00033f57  /data/app/org.godotengine.godotnuitrack-1/lib/arm/libnuitrack.so (nuitrack_InitializeFromConfig+18)
I/DEBUG   (  151):     #05 pc 000f84ac  /data/app/org.godotengine.godotnuitrack-1/lib/arm/libgdnuitrack.so (tdv::nuitrack::Nuitrack::init(std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > const&)+24)
I/DEBUG   (  151):     #06 pc 000f82f0  /data/app/org.godotengine.godotnuitrack-1/lib/arm/libgdnuitrack.so (godot::GDNuitrack::_init()+40)
I/DEBUG   (  151):     #07 pc 000fa0e0  /data/app/org.godotengine.godotnuitrack-1/lib/arm/libgdnuitrack.so (void* godot::_godot_class_instance_func<godot::GDNuitrack>(void*, void*)+112)
I/DEBUG   (  151):     #08 pc 00292bac  /data/app/org.godotengine.godotnuitrack-1/lib/arm/libgodot_android.so
I/DEBUG   (  151):     #09 pc 00291540  /data/app/org.godotengine.godotnuitrack-1/lib/arm/libgodot_android.so
I/DEBUG   (  151):     #10 pc 0029d61c  /data/app/org.godotengine.godotnuitrack-1/lib/arm/libgodot_android.so
I/DEBUG   (  151):     #11 pc 0160bfe4  /data/app/org.godotengine.godotnuitrack-1/lib/arm/libgodot_android.so
I/DEBUG   (  151):     #12 pc 016b6dcc  /data/app/org.godotengine.godotnuitrack-1/lib/arm/libgodot_android.so
I/DEBUG   (  151):     #13 pc 002fa6ec  /data/app/org.godotengine.godotnuitrack-1/lib/arm/libgodot_android.so
I/DEBUG   (  151):     #14 pc 002c1118  /data/app/org.godotengine.godotnuitrack-1/lib/arm/libgodot_android.so
I/DEBUG   (  151):     #15 pc 002c1158  /data/app/org.godotengine.godotnuitrack-1/lib/arm/libgodot_android.so
I/DEBUG   (  151):     #16 pc 007cacdc  /data/app/org.godotengine.godotnuitrack-1/lib/arm/libgodot_android.so
I/DEBUG   (  151):     #17 pc 00bbc8dc  /data/app/org.godotengine.godotnuitrack-1/lib/arm/libgodot_android.so
I/DEBUG   (  151):     #18 pc 01609014  /data/app/org.godotengine.godotnuitrack-1/lib/arm/libgodot_android.so
I/DEBUG   (  151):     #19 pc 007cc53c  /data/app/org.godotengine.godotnuitrack-1/lib/arm/libgodot_android.so
I/DEBUG   (  151):     #20 pc 007cc4f4  /data/app/org.godotengine.godotnuitrack-1/lib/arm/libgodot_android.so
I/DEBUG   (  151):     #21 pc 007d19c4  /data/app/org.godotengine.godotnuitrack-1/lib/arm/libgodot_android.so
I/DEBUG   (  151):     #22 pc 007fb958  /data/app/org.godotengine.godotnuitrack-1/lib/arm/libgodot_android.so
I/DEBUG   (  151):     #23 pc 0008f318  /data/app/org.godotengine.godotnuitrack-1/lib/arm/libgodot_android.so (Java_org_godotengine_godot_GodotLib_step+96)
I/DEBUG   (  151):     #24 pc 0009b8b5  /data/dalvik-cache/arm/data@app@org.godotengine.godotnuitrack-1@base.apk@classes.dex
E/TopPackage Name( 1720): org.godotengine.godotnuitrack
V/=========( 1720):  cPackageName=org.godotengine.godotnuitrack  mLastPackageName=org.godotengine.godotnuitrack
V/com.orbbec.service.ActivityController( 1720):  startcursor org.godotengine.godotnuitrack   org.godotengine.godotnuitrack
D/        (  157): cputemp = 26,26
D/        (  157):   cpuinfo=1416000
W/ActivityManager(  443):   Force finishing activity 1 org.godotengine.godotnuitrack/com.godot.game.GodotApp

Nvm, I forgot the link the libOpenNi.so for the native classes. This compiles now and runs. I’m going to build on this to obtain skeleton tracking data. I will share this project once I have the core done for anyone else. I think its the only implementation of accessing nuitrack api from Godots own gdscript for android.

1 Like

For anyone interested, here is my github repo for Nuitrack implementation in Godot: https://github.com/UomoCaffeLatte/godot-nuitrack

This currently only works for Android builds from Linux systems. You can find the working module and plugins to access nuitrack on Android. Skeleton data wrapper for Godot is still in the works!

1 Like