Board index FlightGear Development New features

linux-track and FlightGear

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

linux-track and FlightGear

Postby aledin » Sun Mar 13, 2011 10:19 pm

Hello.

Another headtracking solution that now works with FG on linux is linux-track. I've just created a "bridge" that allows to connect linux-track with FlightGear. Source code is available at:

http://www.evpatoria.com.ua/ltr/

It requires svn version of linux-track available at:

http://code.google.com/p/linux-track/

The approach used to connect linux-track with FlightGear is the same as used in headtrack spoken of in the neighbour thread. That means that in the future we may probably use a unified comunication approach with both those head tracking solutions. Help and suggestions are welcomed.
Last edited by aledin on Sat Mar 26, 2011 10:39 am, edited 1 time in total.
aledin
 
Posts: 9
Joined: Sun Mar 13, 2011 7:33 pm
Version: git
OS: GNU/Linux

Re: linux-track and FlighGear

Postby falafel » Mon Mar 21, 2011 10:31 am

Hi Aledin,
Cheers for the project. I think that we should work on setting a common api with fgfs and letting the user decide which headtracking driver to use.
This is equivalent to usage of joystick, where we have the user not involved with picking the right joystick setup.
* We should use a generic path. Something like /sim/headtracking/...
* The user will just set the prop of which driver to use: easy-headtrack/linux-track/...
* According to the prop fgfs will load the proper nas file and if necessary a different protocol xml file.

The general rule should be to make the solutions generic.

What are the features given by linux-track and how do they compare to other existing solutions?

For instance, Linux-track could be one answer for users using 32bit OS, but at this point according to your wiki, it doesn't fill the bill for 64 bit OS.

On our headtrack solution we also have different understanding of how to use the raw data. For that purpose we created variables that can support multiple usage. (Mirror var)

Thanks,
Falafel
falafel
 
Posts: 72
Joined: Mon Nov 09, 2009 10:42 am
Callsign: falafel
Version: 2
OS: Linux

Re: linux-track and FlighGear

Postby Johan G » Mon Mar 21, 2011 11:06 am

falafel wrote in Mon Mar 21, 2011 10:31 am:This is equivalent to usage of joystick, where we have the user not involved with picking the right joystick setup.
* We should use a generic path. Something like /sim/headtracking/...
* The user will just set the prop of which driver to use: easy-headtrack/linux-track/...
* According to the prop fgfs will load the proper nas file and if necessary a different protocol xml file.

I'm a noob when it comes to peripherals other then joysticks and keyboards, and I'm sorry if I just repeat what you said, but in other words. :wink:

Maybe, like for the joysticks, there could be $FGROOT/data/input/headtrack directory with xml configuration files, making the head tracking software or hardware (almost?) plug and play. As various head trackers usually use 6 well defined axis of freedom or less, the xml configuration files could, like for the joysticks, map input to the properties in the property tree (there are obviously already properties relating to the viewpoint and view angles there).

For now there seems to be already be three free head tracking solutions mentioned in these forums. :D (Two for Linux and one for Windows, but none for Mac?) It would be nice if FlightGear could use commercial head trackers to, but I'm not sure that it is always possible (i.e licence fees and/or requiring acceptance of a non-disclosure agreement before getting a software development kit). :|

EDIT: Just a clarification to avoid misunderstandings, I have not tried any head tracking solution (yet), but I have seen some great videos of them and read a little bit about them.
Last edited by Johan G on Mon Mar 21, 2011 6:56 pm, edited 1 time in total.
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)
Johan G
Moderator
 
Posts: 5198
Joined: Fri Aug 06, 2010 5:33 pm
Location: Sweden
Callsign: SE-JG
IRC name: Johan_G
Version: 3.0.0
OS: Windows 7, 32 bit

Re: linux-track and FlighGear

Postby Groucho » Mon Mar 21, 2011 1:49 pm

Forgive this head tracking noob question but I have a hard time getting the point of a HT solution in FlightGear.
It is clear that moving the head will influence what is shown on the screen by panning in the corresponding direction but if I move my head I am turning it away from the screen so it would be pretty useless as I am watching walls then.

Could someone please shift me in the right direction?

Thanks.
_____________________________________
Callsign: D-HARP
Flight locations: TNCM, TKPK, EDNY, LOWI
Aircrafts
Helis: EC130, Bo105, UH-1, R22
Twins/Jets: Aerostar, CRJ-200
User avatar
Groucho
 
Posts: 1216
Joined: Sun Jun 17, 2007 10:28 am
Location: Airborne Lake Constance/Germany
Callsign: D-HARP
Version: GIT
OS: Kubuntu

Re: linux-track and FlighGear

Postby someguy » Mon Mar 21, 2011 2:40 pm

I've been wondering the same thing. Also, there are a lot of fg users with reasonably modern iMacs, all of which have built-in cameras that work the same way. It seems to me that a Mac version would offer this feature to the most users with the least development work. One of our Mac programmers needs to step up!
User avatar
someguy
 
Posts: 1652
Joined: Tue Nov 25, 2008 5:54 am
Location: USA
Version: 2016.2.1
OS: Mac OS X 10.11

Re: linux-track and FlighGear

Postby shogimoto » Mon Mar 21, 2011 2:41 pm

@groucho
That is why I use my settings. Think of the screen as a virtual window to the world outside the airplane. That way you always look at the screen through the virtual window. When you move your head to the right, you see more of whats behind the left edge of the window.
shogimoto
 
Posts: 21
Joined: Tue Feb 22, 2011 11:30 pm
Version: GIT
OS: GNU

Re: linux-track and FlighGear

Postby falafel » Mon Mar 21, 2011 6:42 pm

With the code that Shogimoto wrote and I helped to interface with fgsfs, it is possible to influence the image rendered while looking at the screen as the headtrack solution also reads your body position.
So if you are in front of a big screen, lets say 52 inch screen and you are flying a cessna, if you sit facing the screen but not centered, then the headtrack solution will place you on the correct spot.

If you look at the video I posted

I am facing the screen all the time.
falafel
 
Posts: 72
Joined: Mon Nov 09, 2009 10:42 am
Callsign: falafel
Version: 2
OS: Linux

Re: linux-track and FlighGear

Postby uglyDwarf » Tue Mar 22, 2011 7:33 am

Hello guys,
just to address few questions - the point of linuxtrack is to bring headtracking to both linux and Mac, both 32 and 64bit.
Supported devices are the following - for linux it is webcam (v4l2 compatible), wiimote and TrackIR 4/5.
For Mac currently there is a support for wiimote and TrackIR4/5 (webcam is being worked on right now).

In contrast to headtrack, it uses LEDs to track your head movements - which results in lower load to the system, higher robustness,
6DOF and higher framerate (up to 120 Hz using TrackIR or wiimote).

So if any of previous headtracking solutions works for you, there is no need to bother with linuxtrack...
If you hate LEDs on your head, linuxtrack is not for you either...
But if there is no suitable headtracking solution for your platform or favorite device (TrackIR...), then linuxtrack might help you.
Kind regards,

Michal
uglyDwarf
 
Posts: 5
Joined: Wed Dec 08, 2010 12:19 pm

Re: linux-track and FlighGear

Postby Groucho » Tue Mar 22, 2011 8:22 am

falafel wrote in Mon Mar 21, 2011 6:42 pm:With the code that Shogimoto wrote and I helped to interface with fgsfs, it is possible to influence the image rendered while looking at the screen as the headtrack solution also reads your body position.
So if you are in front of a big screen, lets say 52 inch screen and you are flying a cessna, if you sit facing the screen but not centered, then the headtrack solution will place you on the correct spot.

If you look at the video I posted
...
I am facing the screen all the time.


Ah, that explains it. Especially closing in was something I did not had in mind. Though I am not sure if panning right and left comes in conveniently as I have to change my position relative to the screen and therefore my focus point changes- which I wanted to prevent for comfort reasons.
This probably is something which has to be tried out to fully get the feeling.

Thanks for the explanation.
_____________________________________
Callsign: D-HARP
Flight locations: TNCM, TKPK, EDNY, LOWI
Aircrafts
Helis: EC130, Bo105, UH-1, R22
Twins/Jets: Aerostar, CRJ-200
User avatar
Groucho
 
Posts: 1216
Joined: Sun Jun 17, 2007 10:28 am
Location: Airborne Lake Constance/Germany
Callsign: D-HARP
Version: GIT
OS: Kubuntu

Re: linux-track and FlighGear

Postby aledin » Wed Mar 23, 2011 12:37 am

Hello, Falafel!

falafel wrote in Mon Mar 21, 2011 10:31 am:I think that we should work on setting a common api with fgfs and letting the user decide which headtracking driver to use.
This is equivalent to usage of joystick, where we have the user not involved with picking the right joystick setup.
* We should use a generic path. Something like /sim/headtracking/...
* The user will just set the prop of which driver to use: easy-headtrack/linux-track/...
* According to the prop fgfs will load the proper nas file and if necessary a different protocol xml file.

The general rule should be to make the solutions generic.


Good thoughts, I'm agree with you. I don't see any reasons for it to be not generic. I've tried to use slightly modified linux-track.xml protocol file, compatible with easy-headtrack nasal script, and it works fine.

falafel wrote in Mon Mar 21, 2011 10:31 am:What are the features given by linux-track and how do they compare to other existing solutions?

For instance, Linux-track could be one answer for users using 32bit OS, but at this point according to your wiki, it doesn't fill the bill for 64 bit OS.


As Michal has already told, linux-track uses LEDs. For instance, I usualy fly at a dark evening time and in almost completely dark room. So easy-headtrack is probably not a solution for me at that time. But sometimes (on weekends) I fly at a day. And as I haven't removed IR filter from my camera, so my camera works unreliable with LEDs at a day-time. That's time for easy-headtracker :)

Features of linux-track:
* GUI. It's pretty helpfull for configuring and testing.
* Profiles. One can create many different profiles for different setups.
* It's a library with easy API. You can easily create addons for other software.
* Targeted to run on Linux and Mac.

And yes, I run it on a 64bit OS.

So both solutions will find their users. And a generic approach would be a great plus.

EDIT: Currently ltr_fgfs uses its Nasal script for two reasons: to smoothe movements and to enable/disable processing of X, Y, Z. Easy-headtrack's Nasal script interacts with your FlightGear headtracking dialog settings. As you've advanced more in your Nasal sctipt I don't see any reasons to complicate linux-track script. I'm just going to add an option to ltr_fgfs to send data in easy-headtrack format. Hoping that format isn't going to change in the future. That would be the most easy way for users to use easy-headtrack achievements also with linux-track.

And I'm going to change ltr_fgfs name to ltr_pipe as it becomes not only FlightGear specific, and now it also can send data to IL-2 Shturmovik. Hoping soon, when I'll do some Mac specific adjustments, Michal would give his OK for including ltr_pipe to the linux-track repository trunk.

Thanks.
aledin
 
Posts: 9
Joined: Sun Mar 13, 2011 7:33 pm
Version: git
OS: GNU/Linux

Re: linux-track and FlighGear

Postby aledin » Sat Apr 30, 2011 12:02 pm

aledin wrote:And I'm going to change ltr_fgfs name to ltr_pipe as it becomes not only FlightGear specific, and now it also can send data to IL-2 Shturmovik. Hoping soon, when I'll do some Mac specific adjustments, Michal would give his OK for including ltr_pipe to the linux-track repository trunk.


Now ltr_pipe is a part of linux-track project. Tested to work with FlightGear versions 1.9.1, 2.0 and from GIT. Works on Linux and Mac.
aledin
 
Posts: 9
Joined: Sun Mar 13, 2011 7:33 pm
Version: git
OS: GNU/Linux

Re: linux-track and FlightGear

Postby jentron » Fri Aug 26, 2011 12:25 am

Is there some documentation about how to set all this up somewhere? I've got the wii remote and bluetooth working. But ltr_gui seems to always crash wii_server
Code: Select all
[Thu 2011-08-25 18:11:47 MDT] Starting server in the active mode!
[Thu 2011-08-25 18:11:47 MDT] Preferences read OK!
[Thu 2011-08-25 18:11:47 MDT] Setting up Cap
[Thu 2011-08-25 18:11:47 MDT] Initializing model!
[Thu 2011-08-25 18:11:47 MDT] Initializing axes!
[Thu 2011-08-25 18:11:47 MDT] Tracking initialized!
[Thu 2011-08-25 18:11:47 MDT] Device Type: Wiimote
[Thu 2011-08-25 18:11:47 MDT] Changing state to INITIALIZING!
[Thu 2011-08-25 18:11:47 MDT] Loading library 'libmacwii'
[Thu 2011-08-25 18:11:47 MDT] Running!
[Thu 2011-08-25 18:11:47 MDT] Changing state to INITIALIZING!
[Thu 2011-08-25 18:11:47 MDT] Initializing Wii!
[Thu 2011-08-25 18:11:47 MDT] Can't lock - server runs already!
[Thu 2011-08-25 18:11:47 MDT] Wii com initialized @ /home/jentron/.linuxtrack/.linuxtrack_wii!
[Thu 2011-08-25 18:11:47 MDT] Indication: 69
[Thu 2011-08-25 18:11:47 MDT] Wii com WAKEUP!
[Thu 2011-08-25 18:11:47 MDT] Init done!
[Thu 2011-08-25 18:11:47 MDT] Changing state to RUNNING!
[Thu 2011-08-25 18:11:52 MDT] Error getting frame! (rv = -1)
[Thu 2011-08-25 18:11:52 MDT] Changing state to ERROR!
[Thu 2011-08-25 18:11:52 MDT] Wii com Closed!
[Thu 2011-08-25 18:11:52 MDT] Changing state to STOPPED!
[Thu 2011-08-25 18:12:05 MDT] No response for too long, exiting...
[Thu 2011-08-25 18:12:05 MDT] Calling shutdown without initializing first!
[Thu 2011-08-25 18:12:05 MDT] Closing axes!
[Thu 2011-08-25 18:12:05 MDT] Just left the main loop!
[Thu 2011-08-25 18:12:05 MDT] Finishing server!


ltr_pipe seems to want to launch something else:
Code: Select all
 $ ./src/ltr_pipe --output-stdout
ltr_pipe: Initializing ltr_pipe
ltr_pipe: Initializing LinuxTrack library
execv: No such file or directory

ltr_pipe: LinuxTrack library timeout
ltr_pipe: Exiting
ltr_pipe: Bye.
 
Aircraft: F-4E, Cessna 182RG, Fi-156 Storch, Diamond DA20 Katana and Eclipse, Ercoupe, LZ-129, Gossamer Albatross
Airports: CYKF, CNC4, KHIF, 42U, KOXB, 4MD1
jentron
 
Posts: 453
Joined: Thu Jul 26, 2007 2:41 am
Version: custom
OS: Linux

Re: linux-track and FlightGear

Postby aledin » Fri Aug 26, 2011 9:21 am

Hello, jentron.
jentron wrote in Fri Aug 26, 2011 12:25 am:ltr_pipe seems to want to launch something else:
Code: Select all
 $ ./src/ltr_pipe --output-stdout
 

It looks like you're trying to run ltr_pipe without installing linuxtrack somewhere. ltr_pipe depends on linuxtrack library. Just install linuxtrack somewhere on your home directory (no root privileges are required). For example do the following (assuming source code is in linux-track-read-only directory):
Code: Select all
cd linux-track-read-only
./configure --prefix=$HOME/soft/ltr
make
make install

Then run ltr_gui to create and save some configuration:
Code: Select all
$HOME/soft/ltr/bin/ltr_gui

And only after that try
Code: Select all
$HOME/soft/ltr/bin/ltr_pipe --output-stdout

ltr_pipe documentation is in linux-track-read-only/doc/README.ltr_pipe file.
linuxtrack documentation (a little bit outdated) is at http://code.google.com/p/linux-track/w/list.
aledin
 
Posts: 9
Joined: Sun Mar 13, 2011 7:33 pm
Version: git
OS: GNU/Linux

Re: linux-track and FlightGear

Postby jentron » Sun Aug 28, 2011 6:29 pm

aledin wrote in Fri Aug 26, 2011 9:21 am:It looks like you're trying to run ltr_pipe without installing linuxtrack somewhere. ltr_pipe depends on linuxtrack library. Just install linuxtrack somewhere on your home directory (no root privileges are required). For example do the following (assuming source code is in linux-track-read-only directory):


I went ahead and installed it to /usr/local, installing in a random folder under $HOME wasn't working for me.

aledin wrote in Fri Aug 26, 2011 9:21 am:And only after that try
Code: Select all
$HOME/soft/ltr/bin/ltr_pipe --output-stdout

ltr_pipe documentation is in linux-track-read-only/doc/README.ltr_pipe file.


Thanks,
I got another wiimote, and this one seems to try to load ir, but doesn't see my targets. Perhaps I need a new bluetooth dongle.
aledin wrote in Fri Aug 26, 2011 9:21 am:linuxtrack documentation (a little bit outdated) is at http://code.google.com/p/linux-track/w/list.

I looked here, but it seems to be a rather disjointed mess. :(
Aircraft: F-4E, Cessna 182RG, Fi-156 Storch, Diamond DA20 Katana and Eclipse, Ercoupe, LZ-129, Gossamer Albatross
Airports: CYKF, CNC4, KHIF, 42U, KOXB, 4MD1
jentron
 
Posts: 453
Joined: Thu Jul 26, 2007 2:41 am
Version: custom
OS: Linux

linuxtrack

Postby santosdumont » Tue Apr 16, 2013 8:14 pm

Ubuntu 11.10 64 bit, FGFS 2.6.0, linuxtrack_0.0_130324_64, Toshiba laptop

I've downloaded & unzipped linuxtrack into Downloads & can open setup GUI from applications, get as far as
Last thing to set before first test is the path to the cascade used to track the face. OpenCV Haar and LBP cascades are supported - just browse to the cascade of your choice
.I've downloaded 4 versions of haarcascade_frontalface into Downloads but there's no option in linuxtrack to point it at the cascade file, what to do?
The camera image in linuxtrack Tracking Window is very grainy B&W, perhaps the onboard webcam isn't up to the job? Tried adjusting in guvcview, no difference.
Anyone have a walk-through for this or will it become yet another application I'll give up on because it's taking too much time? linuxtrack website wiki doesn't cut it .
Thx
santosdumont
 
Posts: 159
Joined: Mon Nov 03, 2008 9:20 pm

Next

Return to New features

Who is online

Users browsing this forum: No registered users and 1 guest