Pages: [1]   Go Down
Author Topic: Creating a head tracker for my head mounted display  (Read 552 times)
0 Members and 1 Guest are viewing this topic.
Germany, Leverkusen
Offline Offline
Newbie
*
Karma: 0
Posts: 4
Fenchel-Anis-Kümmel
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
« Last Edit: April 29, 2013, 01:12:21 pm by Echte_Eule » Logged

UK
Offline Offline
Shannon Member
****
Karma: 223
Posts: 12568
-
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
« Last Edit: April 29, 2013, 02:11:38 pm by PeterH » Logged

I only provide help via the forum - please do not contact me for private consultancy.

Germany, Leverkusen
Offline Offline
Newbie
*
Karma: 0
Posts: 4
Fenchel-Anis-Kümmel
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I asked for clear, feasible instructions I as a beginner can follow or code samples.
« Last Edit: April 29, 2013, 02:17:11 pm by Echte_Eule » Logged

UK
Offline Offline
Shannon Member
****
Karma: 223
Posts: 12568
-
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

I only provide help via the forum - please do not contact me for private consultancy.

Pages: [1]   Go Up
Jump to: