Go Down

Topic: Creating a head tracker for my head mounted display (Read 635 times) previous topic - next topic

Echte_Eule

Apr 29, 2013, 08:10 pm Last Edit: Apr 29, 2013, 08:12 pm by Echte_Eule Reason: 1
I built this. Works as advertised. But my goal is to create a head tracker for my head mounted display, so I want to read the values from the device into my computer via the usb cable as fast as possible. Currently it only transmits it with about 12 values per second while the sensor's output is 100 Hz!

How do I have to change the code?

The creator of the project said, I needed to optimize it for this purpose.


  • Fill a buffer with data

  • Check if UART-buffer is free

  • If it's free, fill the buffer with next char



But being a beginner with arduino that tells me nothing. How do I have to change the code or what do I have to write when I start from the beginning? I coded a lot in c# in the past but I have no idea how c++ works.

PeterH

#1
Apr 29, 2013, 09:06 pm Last Edit: Apr 29, 2013, 09:11 pm by PeterH Reason: 1
I'd have thought the most likely approach would be to use inertial sensing for short reaction times and video processing based head detection to eliminate drift. If your subject is wearing a head-mounted display then you're ideally set up for marker-based object detection, and the open source AR solutions make that quite easy to achieve now.

In terms of the UART output your main priorities will be to minimise end-to-end latency which means keeping the serial buffers empty - you should crank the serial port speed up as high as it will (reliably) go, go for a concise data format, aim to transmit at slightly less than the maximum rate supported by the serial channel, and also ensure that the receiving side has minimal latency processing input from the channel. In my view that implies that you should explicitly schedule the transmissions so that the serial link is never fully occupied.
I only provide help via the forum - please do not contact me for private consultancy.

Echte_Eule

#2
Apr 29, 2013, 09:14 pm Last Edit: Apr 29, 2013, 09:17 pm by Echte_Eule Reason: 1
I asked for clear, feasible instructions I as a beginner can follow or code samples.

PeterH


I asked for clear, feasible instructions I as a beginner can follow or code samples.


If it's step-by-step instructions you're after:
Understand what the software does.
Review the code until you understand how it does it.
Decide how you want the behaviour to change.
Decide the simplest way to change the design to achieve that behaviour.
Implement and test the change.
Repeat as necessary.

If you can code in C# then you will probably find it quite easy to follow what the C++ code is doing since these two languages have a lot in common.
I only provide help via the forum - please do not contact me for private consultancy.

Go Up