Board index FlightGear Development New features

Introducing Specific Lag

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

Introducing Specific Lag

Postby lloydm6 » Wed Nov 24, 2010 4:31 pm

I am a student looking to do some research. What I want to do is simulate a UAV being landed on the other side of the world. I would be looking to simulate a UAV similar to the american predator series and then I would want to introduce a specific amount of lag.

I would be interested in introducing control lag (the time is takes for the control signal to bounce off the satellite) and display lag (the time it takes for the forward looking camera display signal to get back via satellite).

Any ideas? I'm very weak with computers, so any help is greatly appreciated.
lloydm6
 
Posts: 2
Joined: Wed Nov 24, 2010 4:19 pm

Re: Introducing Specific Lag

Postby Hooray » Wed Nov 24, 2010 6:29 pm

#1 is fairly easy to do by using a Nasal script and adding a delay before you apply control forces.

#2 .....well, I am actually not so sure about ... especially not without doing any C++ modifications.

display lag is not that easy to simulate in a simulator that is trying hard to be as "realtime" as possible ;-)

One very simple thing to do would be abusing the replay system for this: you would need to keep replaying the flight with a fixed time offset ...
I am not sure how flexible the replay system really is, but this might require some (fairly minor) additions to the C++ source code, so that you can
control the replay.

If I were to do something like this without wanting to touch the C++ code, I would try something like this:

- create a scripted AI traffic object (predator 3D model, fake FDM using a Nasal script) - so that the object can be moved in a scripted fashion using Nasal
- add a scripted joystick handler that writes the control input to the AI models using a configurable delay
- create a custom aircraft view by copying the properties from the AI object to the main view property node
- apply a time offset (based on groundspeed) to the current lat/lon in the view, to sort of "move back in time"

That should actually work, if I am not totally wrong ....
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: Introducing Specific Lag

Postby kyokoyama » Thu Nov 25, 2010 12:47 am

...but if you just change the model drawing times, or offset the controls and actual response timings, I think a "satellite lag" is possible?
Look for "B-BIRD" "N127KY" or "AVA0004" -that's me.

Despite having over 1700 posts here, I am not even close to being the most skilled guy here... I'm just words and bad drawing, not experience. :P
kyokoyama
 
Posts: 1981
Joined: Sun May 03, 2009 3:16 am
Location: Earth
Callsign: B-BIRD, N127KY
Version: 2.12.1
OS: Windows Vista

Re: Introducing Specific Lag

Postby skyop » Thu Nov 25, 2010 2:49 am

Control lag could be done using an autopilot controller that "lags" the user's input. Not sure about view lag...
Aircraft: [ CRJ700-family | DC-10-30 ] Scenery: [ KBFL ]
skyop
 
Posts: 3040
Joined: Mon Jun 14, 2010 1:40 am
Location: Austin, Texas, USA
IRC name: skyop
Version: next
OS: Fedora 23/Windows 10

Re: Introducing Specific Lag

Postby Tuxklok » Thu Nov 25, 2010 3:10 am

To lag the view you could run a slaved computer over the network through a proxy program that "buffers" the packets for a predetermined time before sending them on to the slave. Shouldn't be terribly difficult to do, the proxy program itself can likely be written in a few dozens lines of python...or ruby..or whatever you poison. There may well be a smarter, more elegant way to do it, but it's and idea at least. :)

cheers!
The Austria Scenery Project - more info
fg-scenery-tools - gitorious | videos
fgcomgui - Open source, cross platform, gui front end for fgcom. more info

More random musings and doings can be found on my personal site. (work in progress)
User avatar
Tuxklok
 
Posts: 1320
Joined: Tue Apr 21, 2009 7:04 pm
Location: Orlando, FL
Callsign: Tuxklok / N1292P
OS: GNU/Linux

Re: Introducing Specific Lag

Postby someguy » Thu Nov 25, 2010 6:05 am

Can't you simply lag the control input twice as long to simulate view lag? Am I missing something here?
User avatar
someguy
 
Posts: 1650
Joined: Tue Nov 25, 2008 6:54 am
Location: USA
Version: 2019.1.1
OS: Mac OS X 10.11.6

Re: Introducing Specific Lag

Postby i4dnf » Thu Nov 25, 2010 9:19 am

That's what i was thinking too.
Now, if there were a secondary display showing "realtime" action,(for reference, or instructional purposes) then yes there might be some complications to solve.
i4dnf
Retired
 
Posts: 743
Joined: Wed Sep 09, 2009 8:17 am
Location: LRBS
Callsign: YR-I4D
Version: GIT
OS: Gentoo Linux ~amd64

Re: Introducing Specific Lag

Postby Hooray » Thu Nov 25, 2010 9:52 am

Some pretty interesting ideas, that I didn't even think about :-)

If you want to use multiple computers running fgfs, you could just as well abuse the MP protocol and fgms (multiplayer) server for this setup.
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: Introducing Specific Lag

Postby lloydm6 » Thu Nov 25, 2010 2:23 pm

Thanks for all of the quick feedback. I'm still in the preliminary stages and probably won't start testing until sometime in January. Right now I'm just trying to figure out which simulation software will be able to do what I need. I'll let you know how things go once I start, but if you have any more ideas in the mean time, I'm all ears.
lloydm6
 
Posts: 2
Joined: Wed Nov 24, 2010 4:19 pm


Return to New features

Who is online

Users browsing this forum: No registered users and 7 guests