Skip to content

Ta709/42_NASA_Exp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

🛸 ISS_Mission — NASA 42 Scenario

A real-data ISS orbit scenario for the NASA 42 Spacecraft Simulator, configured to mimic the actual travel of the International Space Station using live orbital elements from n2yo.com.

Built and tested on Windows MSYS64 UCRT64.


📁 Folder Structure

After setup, your 42/ directory should look like this:

~/NASA_Builds/42/
    42.exe
    Demo/           ← original demo files, leave untouched
    InOut/          ← default 42 input folder, leave untouched
    ISS_Mission/    ← this scenario ✅

The ISS_Mission/ folder sits at the same level as InOut/ and Demo/do not put it inside InOut/.


🛠️ Installation (MSYS64 UCRT64)

If you haven't built 42 yet, clone and build it first:

git clone https://github.com/nasa/42.git ~/NASA_Builds/42
cd ~/NASA_Builds/42
make

Make sure you have gcc, make, and the required OpenGL/GLUT libraries installed in your UCRT64 environment.


🚀 Setting Up ISS_Mission

1. Copy InOut/ as your scenario base:

cp -r ~/NASA_Builds/42/InOut ~/NASA_Builds/42/ISS_Mission

2. Copy the ISS files from Demo into your new scenario folder:

cp ~/NASA_Builds/42/Demo/Orb_ISS.txt ~/NASA_Builds/42/ISS_Mission/
cp ~/NASA_Builds/42/Demo/SC_ISS.txt ~/NASA_Builds/42/ISS_Mission/

3. Update Orb_ISS.txt with live orbital data (see section below).

4. Update Inp_Sim.txt to point to the ISS files:

cat > ~/NASA_Builds/42/ISS_Mission/Inp_Sim.txt << 'EOF'
# ... (see Inp_Sim.txt in this repo)
EOF

The two critical lines to change in Inp_Sim.txt are:

TRUE   Orb_ISS.txt       !  Input file name for Orb 0
TRUE 0 SC_ISS.txt        !  Existence, RefOrb, Input file for SC 0

🛰️ Getting Live ISS Orbital Data (n2yo.com)

To simulate the ISS at its current real-world position, grab live Keplerian elements from n2yo:

  1. Go to: https://www.n2yo.com/satellite/?s=25544

  2. Note the following values:

    • Perigee (km)
    • Apogee (km)
    • Inclination (°)
    • RAAN — listed as Right Ascension of Ascending Node in the TLE
    • Argument of Perigee — from the TLE (field 6, line 2)
    • True Anomaly — from the TLE (field 7, line 2)
  3. Plug them into Orb_ISS.txt under the CENTRAL / KEP / PA section:

421.5 431.5     !  Periapsis & Apoapsis Altitude, km
51.6305         !  Inclination (deg)
149.5338        !  Right Ascension of Ascending Node (deg)
27.3797         !  Argument of Periapsis (deg)
332.7579        !  True Anomaly (deg)

The values above were captured on May 5, 2026 from the n2yo TLE for NORAD ID 25544.


▶️ Running the Scenario

cd ~/NASA_Builds/42
./42.exe ISS_Mission

42 will read all input files from ISS_Mission/ and launch the simulation with the ISS orbital parameters.


🔄 Switching Between Scenarios

Since each scenario is its own self-contained folder, switching is just a matter of passing a different folder name:

./42.exe ISS_Mission   # run ISS scenario
./42.exe InOut         # run default 42 scenario

Your Demo/ folder always stays untouched as a reference backup.


📡 ISS Orbital Parameters Used

Parameter Value
Perigee 421.5 km
Apogee 431.5 km
Inclination 51.6305°
RAAN 149.5338°
Arg of Perigee 27.3797°
True Anomaly 332.7579°
Period ~93.0 min
Semi-major axis 6797 km
NORAD ID 25544
TLE Source n2yo.com / Caltech

📝 Notes

  • Orbital elements change over time due to atmospheric drag and station reboosts. Re-grab from n2yo periodically for accuracy.
  • The SC_ISS.txt spacecraft file is sourced directly from the NASA 42 Demo folder.
  • Tested on Windows 11 with MSYS64 UCRT64.

🔗 References

About

My sample and experiences of using Nasa's 42, thanks to: https://github.com/ericstoneking/42

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors