Flying on other planets: Difference between revisions

From FlightGear wiki
Jump to navigation Jump to search
No edit summary
 
(19 intermediate revisions by 8 users not shown)
Line 1: Line 1:
{{See also|Earthview}}
{{Infobox Software
{{Infobox Software
| title                  = Flying On Other PLanets
| title                  = Flying On Other Planets
| logo                  =  
| logo                  =  
| image                  =  
| image                  =  
Line 10: Line 11:
| os                    = Only tested on Linux
| os                    = Only tested on Linux
| platform              = Ubuntu 12.04lts
| platform              = Ubuntu 12.04lts
| developmentstatus      = Active
| developmentstatus      = Undeveloped
| type                  =  
| type                  =  
| license                =  
| license                =  
| website                =  
| website                =  
}}
}}
This Page is the documentation of trying to simulate flying on other planets in flightgear.
{{Spaceflight}}
I located the files responsible for atmosphere and gravity in the flightgear source code.<br>
 
This Page is the documentation of trying to simulate '''flying on other planets''' in [[FlightGear]].


== File Locations ==
== File Locations ==
The files are in /src/Enviroment<br>
I located the files responsible for atmosphere and gravity in the flightgear source code.<br>
The names are<br>
The files are in {{flightgear source|path=src/Environment|pre=$FG_SRC}}. The names are:
atmosphere.cxx<br>
* {{flightgear source|path=src/Environment/atmosphere.cxx|pre=$FG_SRC}}
atmosphere.hxx<br>
* {{flightgear source|path=src/Environment/atmosphere.hxx|pre=$FG_SRC}}
gravity.cxx<br>
* {{flightgear source|path=src/Environment/gravity.cxx|pre=$FG_SRC}}
gravity.hxx<br>
* {{flightgear source|path=src/Environment/gravity.hxx|pre=$FG_SRC}}


== Simulating gravity ==
== Simulating gravity ==
After looking at the source code in the atmosphere and gravity files I decided to start by adjusting the gravity to that of titan because that planet is most likely able to be flown upon.<br>
After looking at the source code in the atmosphere and gravity files I decided to start by adjusting the gravity to that of titan because that planet is most likely able to be flown upon.<br>
I changed lines 48-52 to <br>
I changed lines 48-52 to <br>
<code>
<syntaxhighlight lang="cpp">
// Geodetic Reference System 1980 parameter
// Geodetic Reference System 1980 parameter
#define A 6576.0 // equatorial radius of Titan
#define A 6576.0 // equatorial radius of Titan
Line 35: Line 37:
#define AGA (A*1.352) // A times normal gravity at equator
#define AGA (A*1.352) // A times normal gravity at equator
#define BGB (B*1.352) // B times normal gravity at pole
#define BGB (B*1.352) // B times normal gravity at pole
</code>
</syntaxhighlight>
<br>
 
from <br>
from
<code>
<syntaxhighlight lang="cpp">
// original code
#define A 6378137.0 // equatorial radius of earth
#define A 6378137.0 // equatorial radius of earth
#define B 6356752.3141 // semiminor axis
#define B 6356752.3141 // semiminor axis
#define AGA (A*9.7803267715) // A times normal gravity at equator
#define AGA (A*9.7803267715) // A times normal gravity at equator
#define BGB (B*9.8321863685) // B times normal gravity at pole
#define BGB (B*9.8321863685) // B times normal gravity at pole
</code>
</syntaxhighlight>
Now to compile ....<br>
Now to compile ....<br>
The code successfully compiled I am testing to see if there is a difference in the flight <br>  To do these modifications yourself download my modified gravity.cxx [http://ubuntuone.com/4jM9rDIYVegyYwZsNz4aIw file].  The you will have to compile flightgear from source replacing the default gravity.cxx with mine.  My file is for flightgear 2.8 so if you have a different version just make the changes I made above.  If you notice and changes in flight or don't or you get error's please post them on the forum located below.
== Test Flight ==
The code successfully compiled. but I did not see a noticeable change in the time the Cessna took to take off.
== Related Discussions ==
* http://forum.flightgear.org/viewtopic.php?f=6&t=18980&hilit=planets
[[Category:Development projects]]
== References ==
{{Appendix}}

Latest revision as of 14:01, 2 September 2017

Flying On Other Planets
Developed by Wil Neeley
Written in C++
OS Only tested on Linux
Platform Ubuntu 12.04lts
Development status Undeveloped

This Page is the documentation of trying to simulate flying on other planets in FlightGear.

File Locations

I located the files responsible for atmosphere and gravity in the flightgear source code.
The files are in $FG_SRC/src/Environment. The names are:

Simulating gravity

After looking at the source code in the atmosphere and gravity files I decided to start by adjusting the gravity to that of titan because that planet is most likely able to be flown upon.
I changed lines 48-52 to

// Geodetic Reference System 1980 parameter
#define A 6576.0 // equatorial radius of Titan
#define B 6576.0 // semiminor axis
#define AGA (A*1.352) // A times normal gravity at equator
#define BGB (B*1.352) // B times normal gravity at pole

from

// original code
#define A 6378137.0 // equatorial radius of earth
#define B 6356752.3141 // semiminor axis
#define AGA (A*9.7803267715) // A times normal gravity at equator
#define BGB (B*9.8321863685) // B times normal gravity at pole

Now to compile ....
The code successfully compiled I am testing to see if there is a difference in the flight
To do these modifications yourself download my modified gravity.cxx file. The you will have to compile flightgear from source replacing the default gravity.cxx with mine. My file is for flightgear 2.8 so if you have a different version just make the changes I made above. If you notice and changes in flight or don't or you get error's please post them on the forum located below.

Test Flight

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

Related Discussions

References

References