Board index FlightGear Development New features

head tracking on Linux but also Windows

Discussion and requests for new features. Please note that FlightGear developers are volunteers and may or may not be able to consider these requests.

head tracking on Linux but also Windows

Postby sthalik » Tue Oct 08, 2013 11:06 pm

Hey guys,

It seems as if Linux head tracking support is neglected by software developers. There are few apps, existing glue code uses senseless stuff like Nasal scripts, instead of tying the protocol member variable to the view directly...

Some months ago, ported the FaceTrackNoIR codebase to Linux, along with several tracking sources working out-of-the-box. My patches were rejected and had to fork the project as the result.

Disclaimer: no compensation direct or indirect from the project is received by me. I'm happy for every user I get, it helps testing too, but I have no material interest in posting this here.

Feel free to compile the sources located at <http://github.com/opentrack/opentrack>, fly with FlightGear or perhaps other sims. If you find bugs, or need support, feel free to contact me! I'll try to monitor the thread unless it gets deleted or something.

http://www.youtube.com/watch?v=pLEVBRkjdMI

cheers,
Stanislaw Halik <sthalik@misaki.pl>
sthalik
 
Posts: 9
Joined: Tue Oct 08, 2013 10:57 pm

Re: head tracking on Linux but also Windows

Postby Hooray » Wed Oct 09, 2013 8:48 am

Hi & welcome,

this looks interesting - like you say, ideally, your patches would be included upstream by the original project - the other option would be including your sources in FG and adding them as a custom I/O protocol option - we have dozens of such protocols, this would provide built-in support without any external dependencies. See $FG_SRC:

https://gitorious.org/fg/flightgear/sou ... :src/Input
https://gitorious.org/fg/flightgear/sou ... rc/Network

To add a custom I/O protocol, you would need to be able to build the FG sources: http://wiki.flightgear.org/Building_FlightGear
http://wiki.flightgear.org/Howto:Start_core_development

Also, please feel free to add your project to the upcoming FlightGear newsletter, you can also embed youtube videos there: http://wiki.flightgear.org/Next_newsletter
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: head tracking on Linux but also Windows

Postby sthalik » Wed Oct 09, 2013 9:02 am

Hey,

Ideally I'd remove the 'status' member variable, too! It's not necessary.

Thank you, I'll add to newsletter. It's very gracious of you to raise awareness of our projects symbiotically :)

--

http://wiki.flightgear.org/index.php?ti ... ldid=63242

--

I'll consider adding a protocol instead of using UDP, but James is already behind on my push queue :(

--

There's this portable (aside from OS X-untested) code I wrote some time ago, maybe it can be adapted?

https://github.com/opentrack/opentrack/ ... ter/compat

--

http://wiki.flightgear.org/index.php?ti ... ldid=63238

Can someone accept the revision? :)

--

As for building from git, it's easy as pie except that OSG plugins require a shared built. I like rice-cooker -flto builds, but the plugins won't load even if themselves are dynamically linked... I haven't tried -rdynamic yet though!

cheers
Last edited by sthalik on Wed Oct 09, 2013 9:51 am, edited 1 time in total.
opentrack :: open-source head tracking software
contact :: <sthalik@misaki.pl>
sthalik
 
Posts: 9
Joined: Tue Oct 08, 2013 10:57 pm

Re: head tracking on Linux but also Windows

Postby Hooray » Wed Oct 09, 2013 9:49 am

http://wiki.flightgear.org/FlightGear_N ... tober_2013

As you can see, your changes were accepted automatically - we invite all contributors to add FG related news to the newsletter, and only really review/clean up things at the end of each month - so don't worry :D
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: head tracking on Linux but also Windows

Postby Johan G » Wed Oct 09, 2013 11:02 am

Hmm, noticed you mentioned Oculus Rift in the readme. There seem to have been a little interest in this before. Unfortunately my current budget wont allow me to get a dev kit, but others may be interested at some point (or maybe me later on).

Also there have been other ideas for either moving around the view a bit more when looking around with or without head tracking.
Low-level flying — It's all fun and games till someone looses an engine. (Paraphrased from a YouTube video)
Improving the Dassault Mirage F1 (Wiki, Forum, GitLab. Work in slow progress)
Some YouTube videos
Johan G
Moderator
 
Posts: 6629
Joined: Fri Aug 06, 2010 6:33 pm
Location: Sweden
Callsign: SE-JG
IRC name: Johan_G
Version: 2020.3.4
OS: Windows 10, 64 bit

Re: head tracking on Linux but also Windows

Postby sthalik » Wed Oct 09, 2013 11:37 am

Unfortunately mm0zct is busy with PhD so no Oculus *testing* on Linux. :(

But it can and will work, if only someone gets it to build, possibly changing some conditionals in our CMakeLists.txt.

Patches welcome! It's already *known* to work on Windows.

Razer Hydra is another controller, but only for Windows. It has superior drift compensation.

I'm considering switching official build service to mingw-w64 for easy cross without either Wine or qemu, feedback welcome.

--

Fixed conditionals, awaiting libOVR testers!!!
opentrack :: open-source head tracking software
contact :: <sthalik@misaki.pl>
sthalik
 
Posts: 9
Joined: Tue Oct 08, 2013 10:57 pm

Re: head tracking on Linux but also Windows

Postby Hooray » Thu Oct 10, 2013 9:56 am

I'll consider adding a protocol instead of using UDP, but James is already behind on my push queue

don't worry, 2.12 has only just been released, so there's plenty of time until 3.0 will be out (~6 months) - for details, see: http://wiki.flightgear.org/index.php?title=Release_plan

To add your sources to FG, they would need to be GPL compatible obviously, and anything platform-specific, would need to be added to the cmake build system accordingly: http://wiki.flightgear.org/Developing_using_CMake

To add a custom I/O protocol, see the existing examples in $FG_SRC/Network

Most protocols use SimGear's SGIOChannel: http://docs.freeflightsim.org/simgear/c ... annel.html
http://simgear.sourceforge.net/doxygen/ ... annel.html
You can also derive from FGProtocol which simply wraps SGIOChannel: https://gitorious.org/fg/flightgear/sou ... otocol.cxx

You can find various implementation examples by grepping through $FG_SRC/Network and looking for "SGIOChannel" or "FGProtocol".

Joystick related examples are in $FG_SRC/Input and in $FG_SRC/Network (native_ctrls, jsclient etc)
Make sure to also check out the "utils" directory, which contains additional examples - includinig a joystick server: https://gitorious.org/fg/flightgear/sou ... server.cxx


sthalik wrote in Wed Oct 09, 2013 11:37 am:I'm considering switching official build service to mingw-w64 for easy cross without either Wine or qemu, feedback welcome.


As previously mentioned, if you are on Linux and want to cross-compile for Windows, you may want to give mxe a try - but I *think* it needs to statically link everything, including OSG plugins.

If your sources are GPL compatible, it might be possible to simply absorb them into the FG/SG source trees (to reduce the number of external dependencies) - or optionally support your library by detecting it during cmake configuration.
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: head tracking on Linux but also Windows

Postby sthalik » Thu Oct 10, 2013 10:26 pm

Sorry, but can't read all links ATM... Barely flushed windows down the drain and fixed booting, due to 20 GB free space on lone ext4 partition...

> You can also derive from FGProtocol which simply wraps SGIOChannel: https://gitorious.org/fg/flightgear/sou ... otocol.cxx

Here's my protocol wrapper for SHM:

https://github.com/opentrack/opentrack/ ... ter/compat

Please note that errors are unchecked for syscalls, but the sequence doesn't cause either leaks or crashes. There's nothing to do anyway, we don't wanna cause exceptions or other breakage...

There's also FreeTrack protocol, on which C headers one Wim Vriend slapped a GPL3. Don't look unless you want to be contaminated...

If you keep my sources under ISC as they were when making improvements, I'd be much obliged, such-that they can be introduced back to opentrack in better form!

If/when we want to make a SHM data struct for all operating systems,. I recommend getting the 'freetrack' struct and mutex names. This will make us compatible with all open-source trackers ever made... Including linux-track and so on.

We can coordinate with cameni of outerra, as well as perhaps uglyDwarf of linux-track.

> Joystick related examples are in $FG_SRC/Input and in $FG_SRC/Network (native_ctrls, jsclient etc)

There's in fact already libevdev support in opentrack, with 6DOF joystick and one fake button to make udev happily assign 644.

> As previously mentioned, if you are on Linux and want to cross-compile for Windows, you may want to give mxe a try - but I *think* it needs to statically link everything, including OSG plugins.

Thanks, but I'm fine with my cmake toolchain definitions :)

> If your sources are GPL compatible, it might be possible to simply absorb them into the FG/SG source trees (to reduce the number of external dependencies) - or optionally support your library by detecting it during cmake configuration.

Yes, of course. Please browse the tree but stay clear of anything with 'copyright Wim Vriend/Ron Hendriks' on it, due to GPL3 only stuff. The guy even slapped GPL on top of stuff I wrote and he barely modified...

Wrote this on developer forum:

Please rescind restrictive license from:
https://github.com/opentrack/opentrack/ ... /fttypes.h
This stuff isn't yours to begin with, it's derivative of freetrack project. Same for freetrackclient which is a straightforward translation... Not to mention the intent to link it into proprietary games, for which GPL3 makes no sense.


-sh
sthalik
 
Posts: 9
Joined: Tue Oct 08, 2013 10:57 pm

Re: head tracking on Linux but also Windows

Postby sthalik » Fri Oct 11, 2013 12:01 pm

Sorry for bump but the original post is already heavy with stuff...

We got the copyright stuff clarified. Fortunately, v4friend isn't as obstructionary as I pessimistically thought... No offence to him.

https://github.com/opentrack/opentrack/ ... 39461d4382
https://sourceforge.net/p/facetracknoir ... 998d/tree/

I recommend using FreeTrack bindings, already included in Outerra and Arma [23]! We can easily adapt them to linux.

Is that acceptable?

-sh
opentrack :: open-source head tracking software
contact :: <sthalik@misaki.pl>
sthalik
 
Posts: 9
Joined: Tue Oct 08, 2013 10:57 pm

Re: head tracking on Linux but also Windows

Postby adrian » Fri Oct 11, 2013 2:22 pm

Your work is very much appreciated. I'll take a look myself into the source code when I find some free time. Thanks for offering Flightgear support.
adrian
 
Posts: 362
Joined: Wed Sep 15, 2010 3:15 pm

Re: head tracking on Linux but also Windows

Postby pommesschranke » Sat Jan 11, 2014 2:22 pm

I'd like to try head tracking with flightgear.

first I looked at "headtrack" by Ralph Glass,Meir Michanie but it needs OpenCV <=2.1

now I try building opentrack. I did:

cd opentrack-master
cmake .

Code: Select all
 cmake .
CMake Error at CMakeLists.txt:123 (find_package):
  Could not find module FindQt5.cmake or a configuration file for package
  Qt5.

  Adjust CMAKE_MODULE_PATH to find FindQt5.cmake or set Qt5_DIR to the
  directory containing a CMake configuration file for Qt5.  The file will
  have one of the following names:

    Qt5Config.cmake
    qt5-config.cmake



CMake Error at CMakeLists.txt:124 (cmake_policy):
  Policy "CMP0020" is not known to this version of CMake.


CMake Error at CMakeLists.txt:203 (QT5_WRAP_UI):
  Unknown CMake command "QT5_WRAP_UI".
Call Stack (most recent call first):
  CMakeLists.txt:227 (opentrack_module)
 cmake .
CMake Error at CMakeLists.txt:123 (find_package):
  Could not find module FindQt5.cmake or a configuration file for package
  Qt5.

  Adjust CMAKE_MODULE_PATH to find FindQt5.cmake or set Qt5_DIR to the
  directory containing a CMake configuration file for Qt5.  The file will
  have one of the following names:

    Qt5Config.cmake
    qt5-config.cmake



CMake Error at CMakeLists.txt:124 (cmake_policy):
  Policy "CMP0020" is not known to this version of CMake.


CMake Error at CMakeLists.txt:203 (QT5_WRAP_UI):
  Unknown CMake command "QT5_WRAP_UI".
Call Stack (most recent call first):
  CMakeLists.txt:227 (opentrack_module)


-- Configuring incomplete, errors occurred!


-- Configuring incomplete, errors occurred!



I cannot find any Qt5 for Linux Mint 13
do I have to build Qt5 from source ?
pommesschranke
 
Posts: 1117
Joined: Sat Apr 27, 2013 8:58 pm
Location: EDLM & LJCE
Callsign: d-laser
IRC name: laserman
Version: git
OS: Linux Kubuntu 22.04

Re: head tracking on Linux but also Windows

Postby santosdumont » Mon Jan 13, 2014 10:20 pm

Am also tying to install opentrack for FGFS 2.12.1 on Mint15, first had to install cmake, cmake gui, opencv, and QT5 (don't know & don't really care what exactly these do as long as they just do it), when I use cmake gui to try & build opentrack I also get error message
Add the installation prefix of "Qt5" to CMAKE_PREFIX_PATH or set "Qt5_DIR"
to a directory containing one of the above files. If "Qt5" provides a
separate development package or SDK, be sure it has been installed.


Never had any luck installing any headtracking prog in FGFS as either the installation instructions are virtually non-existent (opentrack) or when they are thorough (linuxtrack) something doesn't work anyway. If someone smarter than me could explain in plain English what the above message means & how to correct it I would be forever grateful, until then it's hat-switch for me!
santosdumont
 
Posts: 168
Joined: Mon Nov 03, 2008 10:20 pm

Re: head tracking on Linux but also Windows

Postby sthalik » Tue Jun 10, 2014 1:08 am

CMake cache variables need to be initialized as apparently your Qt5 is installed in a non-standard prefix.

It's assumed that Linux users know how to compile stuff. There are no binaries available due to GNU libc lack of forward compatibility and resources already spread thin.

-sh
opentrack :: open-source head tracking software
contact :: <sthalik@misaki.pl>
sthalik
 
Posts: 9
Joined: Tue Oct 08, 2013 10:57 pm

Re: head tracking on Linux but also Windows

Postby gsagostinho » Sat Jun 20, 2015 4:02 am

Sorry for bumping this, but what is the status of this project?
User avatar
gsagostinho
 
Posts: 1806
Joined: Thu Jan 15, 2015 7:27 pm
Location: London, UK

Re: head tracking on Linux but also Windows

Postby NicoBee » Fri Feb 19, 2016 9:49 pm

Hey Pilots!

I like the idea to watch around by moving my head (for example during the traffic circuit). So I tried to install LINUX-TRACK as well as OPENTRACK but I did not manage it to get one of them working under Ubuntu 14.04.

Is there anybody who knows how to get one of these headtrackers working (especially with FlightGear)? I would be very very thankful if you take the time to explain how to do this.

Regarding OPENTRACK I managed it to eliminate the build errors (cmake v3 vs. v2, qt5 dependencies and so on) but the GUI neither shows a picture from my webcam nor gives the option to select my (selfmade) 3 point IR clip to choose (only selections are FreePIE, Hatire Arduino and UDP sender).

Thank you very much in advance!

Nico.
NicoBee
 
Posts: 9
Joined: Sat Jan 09, 2016 6:33 pm

Next

Return to New features

Who is online

Users browsing this forum: No registered users and 2 guests