Board index FlightGear Development New features

Flying on other planets

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

Flying on other planets

Postby wil » Sun Feb 03, 2013 4:16 pm

I saw this article http://what-if.xkcd.com/30/ about using x plane to simulate flight on other planets. Is there a way to do this in flightgear. What configuration files would I have to change to achive this.

I don't know if this is the right location to post this in tell me if I should move it to another location.
wil
 
Posts: 22
Joined: Sat Dec 08, 2012 1:51 pm

Re: Flying on other planets

Postby Hooray » Sun Feb 03, 2013 8:41 pm

In general, that should be do-able - if you can get your hands on the required data, i.e. elevation data for Mars for example (which is freely available). You would then need to build new scenery using that data. Obviously, the other issue is changing the atmosphere parameters such that the FDM knows about the different atmosphere model.
That should also be doable, check the JSBSim tracker.

Finally, it should all be possible with a little FG experience - however the truth is, it's taken us many years to model flight on Earth, and there's still lots to do - also, we haven't had an updated scenery build for several years. So understandably, other planets are not a priority.

That said, it would be interesting see someone actually exploring this idea a little more - i.e. by experimenting a little, building new scenery tiles via TerraGear and adding another atmosphere model. If you are interested in this, I'd suggest to use the wiki to document your experiences.
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: 11267
Joined: Tue Mar 25, 2008 8:40 am

Re: Flying on other planets

Postby wil » Sun Feb 03, 2013 8:45 pm

I don't want scenery for other planets just a way to simulate the atmosphere and gravity. Were would I start to try to simulate the atmosphere on other planets
wil
 
Posts: 22
Joined: Sat Dec 08, 2012 1:51 pm

Re: Flying on other planets

Postby Thorsten » Mon Feb 04, 2013 7:31 am

I've always toyed with the idea of getting FG to explore the atmosphere of a gas giant - all clouds, and none of that nasty terrain :-)

You'd have to modify the atmosphere definition(s) - there appear to be several, for instance JSBSim brings its own atmosphere code, but then there is also a FG generic, and what model is used depends on the FDM. I'd look in the source code for any files containing 'atmosphere' in their name - that's probably a tell-tale... The same goes for the gravitational constant - presumably that's inside the FDM code.

The appearance of the atmosphere is computed inside the skydome shader - so the new parameters would have to be fed to that (I think the scaling altitude is hard-coded and not a parameter, but atmosphere density and density of Mie and Rayleigh scatterers can be modified runtime from the GUI, so it's not a problem making the atmosphere look much denser.

So it's really some not so extensive set of changes.
Thorsten
 
Posts: 10091
Joined: Mon Nov 02, 2009 8:33 am

Re: Flying on other planets

Postby Hooray » Mon Feb 04, 2013 8:32 am

The atmosphere model is currently hard-coded in C++, so any changes require being able to build FG from source.

Subject: A local weather system (v1.4 available)

Hooray wrote:
Thorsten wrote:The question is - what atmosphere physics is already implemented and available? For example, the density and pressure as a function of altitude must be available somewhere.


I don't really know for sure, but I did do some quick research on that and checked the source code and just browsed the git logs, apparently the atmosphere model was recently revised by a developer (in September 2009), apparently the model is now okay up to ~260,000 ft:

Merge branch 'topic/atmos-merge' into next

John Denker's atmosphere changes. Original commit message:
Two-parameter physics-based model of atmosphere up to 262,467 ft i.e.
the top of the mesosphere. Correctly exhibits the HALT phenomenon.


You can take a look at the source code for yourself: https://gitorious.org/fg/flightgear/blo ... sphere.cxx

The current model still seems simplistic from a functionality point of view, but there are apparently plans being discussed to change this.
Also, the current model is currently not yet exposed or used via any form of standardized interface to the rest of FlightGear according to the developer's website:

Structured Interface
There should be one module where most (or perhaps all) of the modeling of the atmosphere should be done.

Specifically, suppose somebody wants to obtain the pressure (for a given height), height (for a given pressure), density, altimeter setting for a particular locale, or the like. They should ask the atmosphere module to provide it. Similarly, if somebody wants to change something -- e.g. to cause a change in the local altimeter setting -- they should ask the atmosphere module to do it.

To say it the other way, it doesn't make much sense for the altimeter code to have one model of the atmosphere, and the ATIS code to have another model, and the gui to make changes based on its own model, et cetera. It doesn't make much sense to be exporting low-level properties such as sea-level-pressure via the native controls interface; such low-level properties should be private to the atmosphere model module, since they might not even mean anything, depending on implementation details.
http://www.av8n.com/fly/fgfs/README.altimetry.html
http://www.av8n.com/physics/altimetry.htm


But looking at the code, it seems pretty doable to provide such a "structured interface" and also make it available to Nasal scripts by adding some new functions to the Nasal API, if you think that should be useful.

Given that the developer of the new atmosphere model seems obviously interested in improving the atmosphere model and adding a structured interface on top of it, we might even be able to get some help implementing such requests ;-)


For reference:
http://www.mail-archive.com/flightgear- ... 32354.html
http://www.mail-archive.com/flightgear- ... 32738.html
http://www.mail-archive.com/flightgear- ... 32925.html

In other words, it woudl seem possible to generalize the concept of an "atmosphere" in FG and support different atmospheric models that could be selected at startup

Somewhere in the JSBSim tracker there should be another related feature request and discussion (couldn't find it yet) - but it could be possible that JSBSim is already more configurable here than FG.
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: 11267
Joined: Tue Mar 25, 2008 8:40 am

Re: Flying on other planets

Postby wil » Mon Feb 04, 2013 5:50 pm

Does flightgear simulate gravity and temperature in flightgear.
wil
 
Posts: 22
Joined: Sat Dec 08, 2012 1:51 pm

Re: Flying on other planets

Postby Thorsten » Mon Feb 04, 2013 6:13 pm

Planes fall down when the engine dies, no? Seems like gravity to me...
Thorsten
 
Posts: 10091
Joined: Mon Nov 02, 2009 8:33 am

Re: Flying on other planets

Postby wil » Mon Feb 04, 2013 7:16 pm

I mean is it easy to change the gravity.
wil
 
Posts: 22
Joined: Sat Dec 08, 2012 1:51 pm

Re: Flying on other planets

Postby Hooray » Mon Feb 04, 2013 11:12 pm

it really depends on your background, there are many ways to skin that cat - some of the things we mentioned would inevitably require building from source, which can be tricky in and of itself. So just tell us if that's an option or not - and we can tell you how "easy" this is going to be.

As you could see in my earlier response, changing the atmosphere parameters would seem possible actually - as long as you can rebuild fgfs.
For a more straightforward option, you could also get in touch with the jsbsim devel list and raise your question there, some of these things will probably be a bit simpler using just jsbsim.
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: 11267
Joined: Tue Mar 25, 2008 8:40 am

Re: Flying on other planets

Postby wil » Tue Feb 05, 2013 8:05 pm

I have downloaded the source code and have found the files responsible for atmosphere and gravity in the /src/Enviroment
the files are
gravity.cxx
gravity.hxx
atmosphere.cxx
atmosphere.hxx
wil
 
Posts: 22
Joined: Sat Dec 08, 2012 1:51 pm

Re: Flying on other planets

Postby Hooray » Tue Feb 05, 2013 10:25 pm

are you able to build FG from source ?
There's tons of info to be found in the wiki, being on Ubuntu it should be pretty straightforward for you using the the download and compile script: http://wiki.flightgear.org/Scripted_Com ... ian/Ubuntu
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: 11267
Joined: Tue Mar 25, 2008 8:40 am

Re: Flying on other planets

Postby wil » Tue Feb 05, 2013 10:32 pm

I am in the processof compiling right now.
I made a small wiki page documenting my progress
http://wiki.flightgear.org/Flying_on_other_planets
Last edited by Gijs on Tue Feb 05, 2013 10:40 pm, edited 1 time in total.
Reason: Please edit your post if you have more to add, shortly after posting.
wil
 
Posts: 22
Joined: Sat Dec 08, 2012 1:51 pm

Re: Flying on other planets

Postby Hooray » Tue Feb 05, 2013 10:40 pm

yes, and I started contributing to it already ;-)
note that it should be possible not just to simply edit the source code constants, but to make them variables that can be switched between during startup - so that a single binary would support multiple modes of operation.
In fact, it would even be possible to expose such constants to the property tree and make them configurable via preferences.xml
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: 11267
Joined: Tue Mar 25, 2008 8:40 am

Re: Flying on other planets

Postby Hooray » Thu Feb 07, 2013 1:29 am

The code successfully compiled. but I did not see a noticeable change in the time the Cessna tool to take off.


as was mentioned earlier, the FDM itself will probably have another atmosphere/gravity model for use by the FDM.
looks to me like you are currently overriding the FG side of things only.
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: 11267
Joined: Tue Mar 25, 2008 8:40 am

Re: Flying on other planets

Postby daveculp » Mon May 20, 2013 12:43 am

JSBSim has a Mars atmosphere option, but I've never used it. I don't think the piston engine will work on Mars, but the turbine might.
User avatar
daveculp
 
Posts: 503
Joined: Sun Feb 24, 2013 1:50 am
Location: Las Vegas, USA
Callsign: DCulp
Version: 2017.3.1
OS: Ubuntu 17.10

Next

Return to New features

Who is online

Users browsing this forum: No registered users and 5 guests