NatNet - Android data streaming

NatNet, VRPN, TrackD, and Plugins
johny3212
Posts: 10
Joined: Wed Oct 02, 2013 3:39 am

NatNet - Android data streaming

Post by johny3212 »

Hello,
my name is Jan. I am working with OptiTrack system. I developed easy client application based on OpenGL and C++ in Eclipse. This app can connect to NatNet server running in Motive software and shows Rigid Body position in 3D. It was easy maybe 2 days.
Next I need developed some similarity client for Android system. Android is new for me because I am C++ developer. So I don't know how to link NatNet c++ libs with Java in Android. Is it possible to create some wrapper for NatNet or I will have to create myself wrapper packet client without NatNet libs in Android? For future I want to use Unity3D with Android and create client.
How is best way to connect running NatNet server in Motive from Android? It is very important for me. Than you for your response.
0xflarion
Posts: 1
Joined: Tue Nov 19, 2013 5:50 am

Re: NatNet - Android data streaming

Post by 0xflarion »

Hi Johny3212,

have you been able to solve this issue? I'm currently working on a similiar problem: I want to stream tracking data to an Android client. Hence, i would really appreciate it, if you could post your solution or give me some information about it :)

Thanks,
Flarion
NaturalPoint-Dustin
Posts: 609
Joined: Tue Mar 19, 2013 5:03 pm

Re: NatNet - Android data streaming

Post by NaturalPoint-Dustin »

Hi there,

The NatNet SDK contains a direct depacketization sample (PacketClient.cpp), that shows how to decode NatNet UDP packets directly without needing NatNet lib. If you updated your plugin to use this approach, you could then recompile for Unix (Linux/android/etc).

Alternatively, you could use the script only path from my earlier post. This script may need to be updated to be compatible with the current Motive 1.5 bitstream syntax. Again, the PacketClient.cpp sample in the latest NatNet SDK shows how to decode the UDP packets directly and correctly.

Hope this helps,
Dustin
Technical Support Engineer
OptiTrack | TrackIR | SmartNav
ml-7
Posts: 5
Joined: Wed Apr 27, 2016 6:30 am

Re: NatNet - Android data streaming

Post by ml-7 »

Hallo,
I am trying to communicate with Motive:Tracker 1.9 from Java application.
Could someone please share the code for some basic functionality?

I tried NetNatML.dll using JNI (Java Native Interface) but no functions could be found.
I also failed with porting some depacketization methods from PacketClient.cpp.
steven.andrews
NaturalPoint Employee
NaturalPoint Employee
Posts: 737
Joined: Mon Jan 19, 2015 11:52 am

Re: NatNet - Android data streaming

Post by steven.andrews »

Hello ml-7,

Thank you for reaching out to the community regarding your work.

Unfortunately, we do not have a version of the NatNet libraries that is directly compatible with Java, so using direct depacketization will be the required method.

It sounds like you have struggled with the direct depacketization. If you copied the code directly from the PacketClient sample, there may be additional formatting that is needed in order to make the code Java compatible. Unfortunately, I am not able to provide assistance with this conversion since we do not work with Java.

I hope you are able to work this out. If I come across any other resources that might help, I will let you know.

Best regards,
Steven
--
Steven Andrews
OptiTrack | Senior Customer Support Engineer
Shown
Posts: 3
Joined: Sat Apr 17, 2021 12:28 am
Location: https://gbapps.net/gbwhatsapp-apk-1/

Re: NatNet - Android data streaming

Post by Shown »

johny3212 wrote: Mon Nov 04, 2013 2:31 am Hello,
my name is Jan. I am working with OptiTrack system. I developed easy client application based on OpenGL and C++ in Eclipse. This app can connect to NatNet server running in Motive software and shows Rigid Body position in 3D. It was easy maybe 2 days.
Next I need developed some similarity client for Android system. Android is new for me because I am C++ developer. So I don't know how to link NatNet c++ libs with Java in Android. Is it possible to create some wrapper for NatNet or I will have to create myself wrapper packet client without NatNet libs in Android? For future I want to use Unity3D with Android and create client.
How is best way to connect running NatNet server in Motive from Android? It is very important for me. Than you for your response.
Hi there I am newbie here.

You need to write an Java Native Interface(JNI) to be able to call the native(c/c++) libraries from Android Java code.
The hierarchy is like:

+++++++++++++++++++++++++++++++++++
| Android Application |
+++++++++++++++++++++++++++++++++++


+++++++++++++++++++++++++++++++++++
| Android Application Framework |
+++++++++++++++++++++++++++++++++++


+++++++++++++++++++++++++++++++++++
| Java Native Interface |
+++++++++++++++++++++++++++++++++++


+++++++++++++++++++++++++++++++++++
| C/C++ Native Libraries |
+++++++++++++++++++++++++++++++++++
its john
Posts: 1
Joined: Tue Oct 26, 2021 7:21 pm

Re: NatNet - Android data streaming

Post by its john »

0xflarion wrote: Tue Nov 19, 2013 6:04 am Hi Johny3212,

have you been able to solve this issue? I'm currently working on a similiar problem: I want to stream tracking data to an Android client. Hence i would really appreciate it, if you could post your solution or give me some information about it :)

Thanks,
Flarion
yes, one solution is to download data.
Last edited by jillian.smythe on Tue Sep 05, 2023 9:17 am, edited 1 time in total.
Reason: Removing hidden link
miya
Posts: 1
Joined: Fri Nov 12, 2021 1:15 am

Re: NatNet - Android data streaming

Post by miya »

Well, I think that NatNet clients can discover what data objects a server application is currently streaming out of band or ahead of time using the
DataSetDescriptions structure. NatNet clients receive actual data from a server using the FrameOfMocapData structure. Both of
these packets are delivered to the client via the DataHandler callback.

According to me, connect running NatNet server in Motive from Android can be tricky.
All the best John!
whatsapp mod
muzmalik98
Posts: 1
Joined: Mon Jan 03, 2022 6:49 am

Re: NatNet - Android data streaming

Post by muzmalik98 »

Hi Johny3212,

have you been able to solve this issue? I'm currently working on a similar problem.I want to stream tracking data to an Android client. Hence i would really appreciate it, if you could post your solution or give me some information about it :)

Thanks,
Andrew125
Posts: 1
Joined: Thu Jan 13, 2022 5:34 am
Contact:

Re: NatNet - Android data streaming

Post by Andrew125 »

johny3212 wrote: Mon Nov 04, 2013 2:31 am Hello,
my name is Jan. I am working with OptiTrack system. I developed easy client application based on OpenGL and C++ in Eclipse. This app can connect to NatNet server running in Motive software and shows Rigid Body position in 3D. It was easy maybe 2 days.
Next I need developed some similarity client for Android system. Android is new for me because I am C++ developer. So I don't know how to link NatNet c++ libs with Java in Android. Is it possible to create some wrapper for NatNet or I will have to create myself wrapper packet client without NatNet libs in Android? For future I want to use Unity3D with Android and create client.
How is best way to connect running NatNet server in Motive from Android? FM Whatsapp 2023It is very important for me. Than you for your response.
Is this system assosiated with IOS by any mean??, cause I am apple user here. And you can connect Natnet server by using PacketClient.cpp.
Thank you.
Last edited by Andrew125 on Sat Dec 03, 2022 3:51 am, edited 1 time in total.
Post Reply