Add a LoadPlanet
method to FGFDMExec
#913
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Following an idea from @seanmcleod (see #908 (comment)), this PR introduces a new method
FGFDMExec::LoadPlanet()
which can be used to load a planet definition such astests/moon.xml
:jsbsim/tests/moon.xml
Lines 1 to 7 in 8c13fd6
As Sean explained, this feature allows to manage independently the aircraft model and the planet definition file on which the simulation should take place.
The programs
JSBSim.exe
andJSBSim.py
have been updated accordingly. A script such asball_chute.xml
can therefore be run on the Moon using the following command line:> JSBSim --script=scripts/ball_chute.xml --planet=tests/moon.xml
The ball needs 107.8 sec to fall from an height of 10000 ft on Earth and 329.6 sec to fall from the same height on the Moon. One might notice that the ratio of these 2 duration is not equal to$\sqrt{6}$ but the script deploys a parachute at an height of 5000 ft and we currently cannot force the Moon atmosphere to be the vacuum 😉