How to use SmoothTrack with Flightgear (Head Tracking for less than a tenner)

30 Dec 2020 09:52 #49369 by Avionyx
Hi All,

A quick and, hopefully, easy guide on how to get SmoothTrack up and running with FlightGear. Giving pretty decent head tracking for under £10 and only a few minutes of setup.

3 bits of kit you'll need:

1)A mobile phone running Android or iOS, with a camera.
2)SmoothTrack - available from your phone's app store (It was £3 when I got it, seems to be £9.99 now)
3) OpenTrack ( sourceforge.net/projects/opentrack.mirror/ )

Starting with OpenTrack get that installed (or built from your OS repositories) and fire it up. You'll Need to set the "Input" field to UDP over network
The output should be set to flightgear, You might need to run FG with it open to get it to detect it but mine was just there in the list.

You'll then need your PC's internal network IP address. You should be able to get that from your network software, your router or by typing a command like ip route list. It will depend on your OS as to the best method for this.

The start SmoothTrack on your phone. Put your IP address you've got from the step above in the IP field and click the button where it says "Paused", this should switch to running. If you have a front facing camera you should see your handsome mug staring back at you. I shouldn't need to say this but if it's a rear facing camera please turn the phone around....

Go back to OpenTrack and hit "start" under the tracking area in the bottom right. You should now be able to see the octopus moving around as you move your head.

We now need to tell FG how to interpret this so using Enrogue's provided file from this thread create a file called opentrack.xml and paste this into it:
<?xml version="1.0" encoding="UTF-8"?>
<PropertyList>
   <comment>
<![CDATA[
  Usage:

  fgfs --generic=socket,in,52,,5542,udp,opentrack
]]>
   </comment>
   <generic>
      <input>
         <binary_mode>true</binary_mode>
         <byte_order>host</byte_order>
         <chunk>
            <type>double</type>
            <node>/sim/current-view/tx</node>
         </chunk>
         <chunk>
            <type>double</type>
            <node>/sim/current-view/ty</node>
         </chunk>
         <chunk>
            <type>double</type>
            <node>/sim/current-view/tz</node>
         </chunk>
         <chunk>
            <type>double</type>
            <node>/sim/current-view/heading-offset-deg</node>
         </chunk>
         <chunk>
            <type>double</type>
            <node>/sim/current-view/pitch-offset-deg</node>
         </chunk>
         <chunk>
            <type>double</type>
            <node>/sim/current-view/roll-offset-deg</node>
         </chunk>
         <chunk>
            <type>int</type>
            <node>/sim/current-view/status</node>
         </chunk>
      </input>
   </generic>
</PropertyList>

Then save that file inside your "[FGDATA]/Protocol" folder.

In your FG Launcher, or via command line depending on how you start FG you need to tell it to expect the tracking information.

You can do this by adding the following as an option in the options area of your launch method:
--generic=socket,in,25,127.0.0.1,5542,udp,opentrack

Now start FG, move your head about and you should see it tracking nicely.

Undoubtedly some tweaking will be needed but this should get you started with basic up down left right.
After a bit of playing I actually really like it. It's a simple solution and the above only took less than 5 mins including the downloading and file creation.

Got to be worth a go?

Please Log in or Create an account to join the conversation.

30 Dec 2020 10:05 #49370 by Avionyx
In case it's of use:
Attachments:
The following user(s) said Thank You: StuartC, enrogue

Please Log in or Create an account to join the conversation.

30 Dec 2020 15:43 #49373 by enrogue
Thanks for this Alex - I had been using Smoothtrack with the linux joystick device (evdev), but it doesn't do view offsets - I'll give his a go :)

Please Log in or Create an account to join the conversation.

Time to create page: 0.401 seconds
Powered by Kunena Forum

Latest Forum Posts

PM Notifications

You are not logged in.

PM Mailbox

You are not logged in.

Latest updated downloads