Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add a LoadPlanet method to FGFDMExec #913

Merged
merged 2 commits into from
May 16, 2023

Conversation

bcoconni
Copy link
Member

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 as tests/moon.xml:

jsbsim/tests/moon.xml

Lines 1 to 7 in 8c13fd6

<planet name="Moon">
<equatorial_radius unit="KM">1738.1</equatorial_radius>
<polar_radius unit="KM">1736.0</polar_radius>
<rotation_rate unit="RAD/SEC">2.66167E-6</rotation_rate>
<GM unit="M3/SEC2">4.9E12</GM>
<J2>2.027E-4</J2>
</planet>

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 and JSBSim.py have been updated accordingly. A script such as ball_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 😉

@codecov
Copy link

codecov bot commented May 14, 2023

Codecov Report

Merging #913 (b91e792) into master (8c13fd6) will decrease coverage by 0.04%.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##           master     #913      +/-   ##
==========================================
- Coverage   23.14%   23.11%   -0.04%     
==========================================
  Files         167      167              
  Lines       19603    19631      +28     
==========================================
  Hits         4538     4538              
- Misses      15065    15093      +28     
Impacted Files Coverage Δ
src/FGFDMExec.cpp 39.78% <0.00%> (-1.54%) ⬇️
src/FGFDMExec.h 17.14% <ø> (ø)

@seanmcleod
Copy link
Member

Looks good.

@jonsberndt
Copy link
Contributor

jonsberndt commented May 15, 2023 via email

@agodemar agodemar merged commit 853334f into JSBSim-Team:master May 16, 2023
@bcoconni bcoconni deleted the LoadPlanet branch May 18, 2023 10:39
bcoconni added a commit to bcoconni/jsbsim that referenced this pull request Aug 26, 2023
* Add a new `LoadPlanet` method

* Fix the help messages.
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants