Head tracking Unity3D/other integration

This is for discussion and development of non-commercial open source VR/AR projects (e.g. Kickstarter applicable, etc). Contact MTBS admins at customerservice@mtbs3d.com if you are unsure if your efforts qualify.
Post Reply
MemeBox
Two Eyed Hopeful
Posts: 55
Joined: Sat Sep 01, 2012 9:23 am

Head tracking Unity3D/other integration

Post by MemeBox »

I've been working on optical tracking system
(http://www.youtube.com/watch?feature=pl ... BRGOyzjMfA),

I would like to expose the tracking information from this app to anything that might be interested, for example Unity3D.

Absolute position, orientation information...

Does anyone know how to do this?
RoadKillGrill
Cross Eyed!
Posts: 119
Joined: Tue Oct 09, 2012 2:36 pm
Location: Ohio
Contact:

Re: Head tracking Unity3D/other integration

Post by RoadKillGrill »

The easiest way is to make a tcp socket and stream the data over that. Other option is to make more of a dll or plugin to put into unity
User avatar
brantlew
Petrif-Eyed
Posts: 2221
Joined: Sat Sep 17, 2011 9:23 pm
Location: Menlo Park, CA

Re: Head tracking Unity3D/other integration

Post by brantlew »

MemeBox wrote:I've been working on optical tracking system
(http://www.youtube.com/watch?feature=pl ... BRGOyzjMfA),

I would like to expose the tracking information from this app to anything that might be interested, for example Unity3D.

Absolute position, orientation information...

Does anyone know how to do this?

I'm working on a low level IPC dll for doing exactly this - transmitting high speed tracker data between two separate processes. Should be done by the end of the week if you want the library.

But this is a custom solution. If you want something more generalized you could also look at VRPN. It's a bit of an overkill solution but it's the only thing close to a standard that I am aware of.
druidsbane
Binocular Vision CONFIRMED!
Posts: 237
Joined: Thu Jun 07, 2012 8:40 am
Location: New York
Contact:

Re: Head tracking Unity3D/other integration

Post by druidsbane »

RoadKillGrill wrote:The easiest way is to make a tcp socket and stream the data over that. Other option is to make more of a dll or plugin to put into unity
Or better yet UDP as you probably don't need the overhead of TCP and will throw out old missing packets anyways, no need to retry.
Ibex 3D VR Desktop for the Oculus Rift: http://hwahba.com/ibex - https://bitbucket.org/druidsbane/ibex
RoadKillGrill
Cross Eyed!
Posts: 119
Joined: Tue Oct 09, 2012 2:36 pm
Location: Ohio
Contact:

Re: Head tracking Unity3D/other integration

Post by RoadKillGrill »

druidsbane wrote: Or better yet UDP as you probably don't need the overhead of TCP and will throw out old missing packets anyways, no need to retry.
I forgot the /ip part, tcp/ip sockets could refer to either a udp or tcp socket, I wasn't too worried about protocol specifics.

When I used Unity before was using python script to make a loopback to stream orientation data from the sensor into Unity. If i did it again I would like try to get it working in C# as working examples in C# are often requested.
Cromfel
Two Eyed Hopeful
Posts: 59
Joined: Wed Aug 08, 2012 8:19 am

Re: Head tracking Unity3D/other integration

Post by Cromfel »

If you want others to use your tracking or whatever devices the defacto is VRPN

http://www.cs.unc.edu/Research/vrpn/

It is very very well documented and widely used "baseline" of all VR communication between devices.
MemeBox
Two Eyed Hopeful
Posts: 55
Joined: Sat Sep 01, 2012 9:23 am

Re: Head tracking Unity3D/other integration

Post by MemeBox »

VRPN looks like it is the way to go, thanks for the knowledge. Once I have my hands on the Oculus, it won't be long before I have a simple model loaded into my lounge space. I will be able to move around it, look at it from different angles. For me that is cool enough.
But the next/real issue is how do you turn that into a game?
Food for thought...
User avatar
brantlew
Petrif-Eyed
Posts: 2221
Joined: Sat Sep 17, 2011 9:23 pm
Location: Menlo Park, CA

Re: Head tracking Unity3D/other integration

Post by brantlew »

I finished my IPC head tracker interface if you want it. It's a custom/Windows-only solution instead of a generic interface like VRPN, but it's really fast and simple to use.
MemeBox
Two Eyed Hopeful
Posts: 55
Joined: Sat Sep 01, 2012 9:23 am

Re: Head tracking Unity3D/other integration

Post by MemeBox »

@brantlew

I'm not really sure of what I need to do at the moment. I'm a bit confused about how this could fit together, or indeed where I need to pipe the data to.

I remember trying to do IPC with shared memory, the experience was quite unpleasant. I'm a bit hesitant to put you to the trouble of sharing the code when I'm not entirely sure where I will need to be using it.

If I could get back to you later when I'm nearer to requiring it, that would be great, thank you.
Cromfel
Two Eyed Hopeful
Posts: 59
Joined: Wed Aug 08, 2012 8:19 am

Re: Head tracking Unity3D/other integration

Post by Cromfel »

Just to link also here a nice tutorial for the VRPN by MiddleVR author Sébastien Kuntz:

http://www.vrgeeks.org/vrpn/tutorial---use-vrpn
User avatar
brantlew
Petrif-Eyed
Posts: 2221
Joined: Sat Sep 17, 2011 9:23 pm
Location: Menlo Park, CA

Re: Head tracking Unity3D/other integration

Post by brantlew »

Cromfel wrote:Just to link also here a nice tutorial for the VRPN by MiddleVR author Sébastien Kuntz:

http://www.vrgeeks.org/vrpn/tutorial---use-vrpn
I took a look at the VRPN source code the other day. They have some easy samples and if you are just doing basic integration like connecting to a head tracker then it's pretty easy to use. Just a half dozen lines of code or so on the server and client side. The internal implementation of VRPN uses UDP sockets.
Post Reply

Return to “VR/AR Research & Development”