Board index FlightGear Development New features

Headtrack

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

Headtrack

Postby falafel on Fri Jan 07, 2011 3:48 pm

Hi list,
I came across with this project, after some small changes it now works with fgfs
https://github.com/ralph-glass/headtrack
Watch on Youtube
Last edited by falafel on Thu Feb 24, 2011 9:37 pm, edited 1 time in total.
 
Posts: 45
Joined: Mon Nov 09, 2009 10:42 am
Callsign: falafel
Version: 2
OS: Linux

Re: Headtrack

Postby Zan on Fri Jan 07, 2011 4:18 pm

I've tried headtracking (though it was with a custom "helmet" with led markers on it, not as intuitive as pure head tracking) and came to the conclusion that using it to track head panning could be nice add-on, but tracking rotation is highly unrealistic.

There has been some work on the same subject before, which might be worth checking out: http://www.mail-archive.com/flightgear-devel@lists.sourceforge.net/msg04861.html and http://www.gidenstam.org/FlightGear/HeadTracking/

What kind of modifications did you make, would it be hard to integrate that to FlightGear so we all could try it out?
 
Posts: 114
Joined: Tue Oct 20, 2009 10:28 am

Re: Headtrack

Postby falafel on Fri Jan 07, 2011 4:28 pm

This post is outdated:
The modifications are already commited in the code.

you start ./headtrack
start fgfs
alt-tab to headtrack
press m this will send events to the mouse.
alt-tab back to fgfs and right click twice to get the <-> and move your head.

you need sudo modprobe uinput
and chmod a+rw /dev/uinput
before starting headtrack.


Now you just need to launch headtrack
copy the headtrack protocol file to $FG_ROOT/Protocols/
and start fgfs with the following parameters:
--generic=socket,in,100,,3254,udp,headtrack
--prop:/sim/headtracking/enabled=1
Last edited by falafel on Thu Feb 24, 2011 9:43 pm, edited 1 time in total.
 
Posts: 45
Joined: Mon Nov 09, 2009 10:42 am
Callsign: falafel
Version: 2
OS: Linux

Re: Headtrack

Postby falafel on Wed Feb 02, 2011 8:46 pm

New code, uses network protocol and is much better than the mouseemu
Watch on Youtube
Last edited by falafel on Thu Feb 24, 2011 9:36 pm, edited 1 time in total.
 
Posts: 45
Joined: Mon Nov 09, 2009 10:42 am
Callsign: falafel
Version: 2
OS: Linux

Re: Headtrack

Postby Johan G on Wed Feb 02, 2011 8:55 pm

Looks good, and leaves the mouse for the ones flying by mouse. :D
Low-level flying — It's all fun and games till someone looses an engine. (Paraphrased from a YouTube Video)
 
Posts: 1771
Joined: Fri Aug 06, 2010 5:33 pm
Location: Sweden
Callsign: SE-JG
IRC name: Johan_G
Version: 2.4.0
OS: Windows 7

Re: Headtrack

Postby falafel on Wed Feb 02, 2011 9:19 pm

yes indeed.
 
Posts: 45
Joined: Mon Nov 09, 2009 10:42 am
Callsign: falafel
Version: 2
OS: Linux

Re: Headtrack

Postby falafel on Fri Feb 04, 2011 12:42 am

Another teaser for what we are developing.
Watch on Youtube
Last edited by falafel on Thu Feb 24, 2011 9:37 pm, edited 1 time in total.
 
Posts: 45
Joined: Mon Nov 09, 2009 10:42 am
Callsign: falafel
Version: 2
OS: Linux

Re: Headtrack

Postby falafel on Sat Feb 05, 2011 9:53 pm

New version with x,y,z offsets.

get it at :
http://gitorious.org/headtrack


Watch on Youtube
 
Posts: 45
Joined: Mon Nov 09, 2009 10:42 am
Callsign: falafel
Version: 2
OS: Linux

Re: Headtrack

Postby falafel on Sun Feb 06, 2011 2:19 am

headtrack + 3d

Watch on Youtube
 
Posts: 45
Joined: Mon Nov 09, 2009 10:42 am
Callsign: falafel
Version: 2
OS: Linux

Re: Headtrack

Postby falafel on Sun Feb 06, 2011 7:58 pm

We added a menu option to modify presets and to enable/disable EasyHeadTrack.

Image
 
Posts: 45
Joined: Mon Nov 09, 2009 10:42 am
Callsign: falafel
Version: 2
OS: Linux

Re: Headtrack

Postby longfly on Sat Feb 26, 2011 6:55 pm

Hi and really good work!!! :D What is the status of the project?

BTW: I have problems compiling it (I think it is only for Linux, isn't it?) :( (And my webcam is really bad :lol: )
Couldn't you just make a few files that you would only copy in the FG-folder?

Nevertheless, many thanks for your great work!!!! :P

Longfly
User avatar
 
Posts: 227
Joined: Tue Dec 07, 2010 4:41 pm
Location: EDDM (Germany)
Version: GIT
OS: always newest Ubuntu

Re: Headtrack

Postby falafel on Sat Feb 26, 2011 8:50 pm

Sorry for the lack of documentation.
Yes it works in Linux. I do not know about other OS.
We will post more info in the near future.
The code is stable and in the last three weeks we didn't see any reason to change it.
But for sure that more documentation would be benefitial.
Till then,
 
Posts: 45
Joined: Mon Nov 09, 2009 10:42 am
Callsign: falafel
Version: 2
OS: Linux

Re: Headtrack

Postby jack on Sun Feb 27, 2011 1:29 am

Hopefully we can have this on mac! That would be great for filming.
For Military Aircraft, Scenery, and more, visit http://alphashangar.co.nr/

'Retired' from FlightGear as of July 2011. You can contact me via my website if you'd like to pick up any old projects.
User avatar
Retired
 
Posts: 1440
Joined: Tue Mar 02, 2010 11:26 pm
Location: KLVK
Callsign: Alpha-J, Rescue1
Version: GIT
OS: Mac OS X

Re: Headtrack

Postby gluon on Wed Mar 02, 2011 5:41 pm

Hi,

I tried to compile the latest Snapshot from Git on OpenSuse 11.2 but to no avail.
First the Installation-Instructions are incomplete - you also depend on gtk2 devel. OK, that was figured out quite fast.

However I think the opencv version (2.2.0) supplied with my (old) OpenSuse version isn't up to date (yeah, I know i should upgrade :). This is what I get:
Code: Select all
headtrack.c: In function ‘main’:
headtrack.c:210: error: too few arguments to function ‘cvHaarDetectObjects’
headtrack.c:221: error: too few arguments to function ‘cvHaarDetectObjects’
headtrack.c:229: error: too few arguments to function ‘cvHaarDetectObjects’

But the function looks fine according to the docs I found on the net.
So, which version of opencv do you use (please also name the specific version you depend on in the Installation file)?

Hope this helps.
 
Posts: 56
Joined: Tue Aug 18, 2009 7:43 am

Re: Headtrack

Postby hvengel on Thu Mar 03, 2011 8:12 pm

gluon wrote on Wed Mar 02, 2011 5:41 pm:Hi,

I tried to compile the latest Snapshot from Git on OpenSuse 11.2 but to no avail.
First the Installation-Instructions are incomplete - you also depend on gtk2 devel. OK, that was figured out quite fast.

However I think the opencv version (2.2.0) supplied with my (old) OpenSuse version isn't up to date (yeah, I know i should upgrade :). This is what I get:
Code: Select all
headtrack.c: In function ‘main’:
headtrack.c:210: error: too few arguments to function ‘cvHaarDetectObjects’
headtrack.c:221: error: too few arguments to function ‘cvHaarDetectObjects’
headtrack.c:229: error: too few arguments to function ‘cvHaarDetectObjects’

But the function looks fine according to the docs I found on the net.
So, which version of opencv do you use (please also name the specific version you depend on in the Installation file)?

Hope this helps.


No the problem is that 2.2.0, which is the current opencv release, is too new. I got the same errors when I tried to build against 2.2.0 but downgrading to opencv 2.1.0 headtrack builds. The head tracker code should probably be updated to build against either 2.1 or 2.2.

However when I try to run it I get:

Code: Select all
$ ./headtrack
headtrack.c: Created socket. Destination = 127.0.0.1:49405!
Xlib:  extension "RANDR" missing on display ":0".
Sorry, cannot open camera.
OpenCV Error: Null pointer (NULL array pointer is passed) in cvGetMat, file /var/tmp/portage/media-libs/opencv-2.1.0/work/OpenCV-2.1.0/src/cxcore/cxarray.cpp, line 2376
terminate called after throwing an instance of 'cv::Exception'
  what():  /var/tmp/portage/media-libs/opencv-2.1.0/work/OpenCV-2.1.0/src/cxcore/cxarray.cpp:2376: error: (-27) NULL array pointer is passed in function cvGetMat

Aborted


So it can't find my web cam. The web cam is working and I confirmed this by running guvcview. Is there something else that needs to be setup for this to work?
Moderator
 
Posts: 429
Joined: Sun Dec 24, 2006 4:35 am

Next