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 » Fri Jan 07, 2011 4: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
Last edited by falafel on Thu Feb 24, 2011 10:37 pm, edited 1 time in total.
falafel
 
Posts: 73
Joined: Mon Nov 09, 2009 11:42 am
Callsign: falafel
Version: 2
OS: Linux

Re: Headtrack

Postby Zan » Fri Jan 07, 2011 5: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?
Zan
 
Posts: 123
Joined: Tue Oct 20, 2009 11:28 am

Re: Headtrack

Postby falafel » Fri Jan 07, 2011 5: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 10:43 pm, edited 1 time in total.
falafel
 
Posts: 73
Joined: Mon Nov 09, 2009 11:42 am
Callsign: falafel
Version: 2
OS: Linux

Re: Headtrack

Postby falafel » Wed Feb 02, 2011 9:46 pm

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

Re: Headtrack

Postby Johan G » Wed Feb 02, 2011 9: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)
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: Headtrack

Postby falafel » Wed Feb 02, 2011 10:19 pm

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

Re: Headtrack

Postby falafel » Fri Feb 04, 2011 1:42 am

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

Re: Headtrack

Postby falafel » Sat Feb 05, 2011 10:53 pm

New version with x,y,z offsets.

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


falafel
 
Posts: 73
Joined: Mon Nov 09, 2009 11:42 am
Callsign: falafel
Version: 2
OS: Linux

Re: Headtrack

Postby falafel » Sun Feb 06, 2011 3:19 am

headtrack + 3d

falafel
 
Posts: 73
Joined: Mon Nov 09, 2009 11:42 am
Callsign: falafel
Version: 2
OS: Linux

Re: Headtrack

Postby falafel » Sun Feb 06, 2011 8:58 pm

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

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

Re: Headtrack

Postby longfly » Sat Feb 26, 2011 7: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
longfly
 
Posts: 228
Joined: Tue Dec 07, 2010 5:41 pm
Location: EDDM (Germany)
Version: always new

Re: Headtrack

Postby falafel » Sat Feb 26, 2011 9: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,
falafel
 
Posts: 73
Joined: Mon Nov 09, 2009 11:42 am
Callsign: falafel
Version: 2
OS: Linux

Re: Headtrack

Postby jack » Sun Feb 27, 2011 2: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.
jack
Retired
 
Posts: 1432
Joined: Wed Mar 03, 2010 12:26 am
Location: KLVK
Callsign: Alpha-J, Rescue1
Version: GIT
OS: Mac OS X

Re: Headtrack

Postby gluon » Wed Mar 02, 2011 6: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.
gluon
 
Posts: 68
Joined: Tue Aug 18, 2009 8:43 am

Re: Headtrack

Postby hvengel » Thu Mar 03, 2011 9:12 pm

gluon wrote in Wed Mar 02, 2011 6: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?
hvengel
Retired
 
Posts: 1127
Joined: Sun Dec 24, 2006 5:35 am
Location: Minden Nevada

Next

Return to New features

Who is online

Users browsing this forum: No registered users and 6 guests