Board index FlightGear Support Interfacing

telnet/UDP camera controls

Connecting two computers, using generic protocol, connecting with Matlab?

telnet/UDP camera controls

Postby drinkdhmo » Fri Mar 24, 2017 4:06 am

How can I remotely control the cockpit camera position and orientation? Basically, I am using Dlib and openCV to do create a poor man's head tracker. I want to connect this to FlightGear and be able to look around the cockpit by moving my head. It looks like telnet is the easiest method, but I can't find where the camera controls are in the property tree. Are they even in the property tree? Would a UDP connection be better? Any help would be greatly appreciated!
drinkdhmo
 
Posts: 3
Joined: Fri Mar 24, 2017 3:55 am

Re: telnet/UDP camera controls

Postby Parnikkapore » Fri Mar 24, 2017 5:42 am

UDP is recommended for stuff that updates really fast like this.

The camera controls are in the property tree under something like
/sim/current-view/pitch|heading-offset-deg

Prefix "goal-" if you want some smoothening.
There are free alternatives to every program you encounter. You just have to find them.
Parnikkapore
 
Posts: 818
Joined: Thu Oct 29, 2015 10:16 am
Callsign: HS-FGS
Version: next [PPA]
OS: Mint 18

Re: telnet/UDP camera controls

Postby Johan G » Fri Mar 24, 2017 8:55 am

It might be a bit of help to try read through $FG_ROOT/Nasal/view.nas, where $FG_ROOT is the "data" directory in your FlightGear installation. view.nas is where the view panning and a lot of the view control lives. It is not an all easy read, though it is relatively well commented.
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: 5535
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: telnet/UDP camera controls

Postby drinkdhmo » Sat Mar 25, 2017 4:02 am

Thank you very much for your help! I got a barebones version working over both Telnet and UDP. Parnikkapore, you were right. UDP is the way to go. Telnet is much too slow.

If anyone is interested, I will post my code here when I'm done.
drinkdhmo
 
Posts: 3
Joined: Fri Mar 24, 2017 3:55 am

Re: telnet/UDP camera controls

Postby Isaak » Sat Mar 25, 2017 10:56 am

Please, do so! Very interested in your solution :-)
Isaak
 
Posts: 468
Joined: Sat Jun 04, 2011 2:52 pm
Location: Leuven, Belgium
Callsign: OO-ISA
Version: 2019.1.1
OS: Windows 10

Re: telnet/UDP camera controls

Postby drinkdhmo » Tue Apr 18, 2017 4:02 am

I finally have the app in a state where I can share some results. A video is available here:
https://youtu.be/mEfyYAOAv4Y
I'll be posting the code to github sometime in the next few weeks for those interested.
One thing to note is that I have a very poor webcam that only gets about 5 fps in normal indoor lighting. The performance is significantly better with a higher frame rate.
drinkdhmo
 
Posts: 3
Joined: Fri Mar 24, 2017 3:55 am

Re: telnet/UDP camera controls

Postby Johan G » Thu Apr 20, 2017 7:36 pm

Looks like a very nice start. :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)
Johan G
Moderator
 
Posts: 5535
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: telnet/UDP camera controls

Postby K1650369 » Fri May 24, 2019 9:06 pm

Did you upload this to git hub? I'd also like to control the view azimuth and elevation (heading and pitch) via UDP from simulink and im very, very stuck. Im trying to "hack" the UDP protocol used by FacetrackNoIR, but im struggling with constructing the message. FlightGear also doesnt like FacetrackNoIR over a network (even though it provides the option) as it only works on when all on local host.
K1650369
 
Posts: 1
Joined: Thu May 23, 2019 3:11 pm


Return to Interfacing

Who is online

Users browsing this forum: No registered users and 2 guests