Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions ExternalSimulation/42/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# 42 Simulation

In order to use the 42 external simulation, you must clone the [42 repository]() to the same directory you've cloned the simulated subsystems repository in. You must then compile 42 from source by `cd`ing into the 42 directory and running `make`. Ig it complains about being unable to find libglut or something similar, you must install it through either your package manager or from
Empty file.
66 changes: 66 additions & 0 deletions ExternalSimulation/42/ex3/Dyn00.42
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
Dynamics Check for SC[0]

Nb: 1 Ng: 0
Mass: 1.000000
cm: 0.000000 0.000000 0.000000
I : 2.000000 -0.000000 -0.000000
-0.000000 3.000000 -0.000000
-0.000000 -0.000000 1.200000
PosR: 2.655596 -2.241894 -2.869493
VelR: 0.002785 0.001926 -0.002128

Dyn Structure
-------------
Nu: 6 Nx: 7 Nf: 0
u[00]: 0.000000
u[01]: 0.001745
u[02]: 0.000000
u[03]: 0.000000
u[04]: 0.000000
u[05]: 0.000000

x[00]: 0.000000
x[01]: 0.000000
x[02]: 0.000000
x[03]: 1.000000
x[04]: 0.000000
x[05]: 0.000000
x[06]: 0.000000



Body Structure [00]
-------------------
Mass: 1.000000
cm: 0.000000 0.000000 0.000000
c: 0.000000 0.000000 0.000000
I: 2.000000 -0.000000 -0.000000
-0.000000 3.000000 -0.000000
-0.000000 -0.000000 1.200000
wn: 0.000000 0.001745 0.000000
qn: 0.000000 0.000000 0.000000 1.000000
vn: 0.000000 0.000000 0.000000
pn: 0.000000 0.000000 0.000000

CN:
1.000000 0.000000 0.000000
0.000000 1.000000 0.000000
0.000000 0.000000 1.000000
Nf: 0 f0: 0
Mf:

Kf:

Cf:

Pf:




Hf:





Empty file.
64 changes: 64 additions & 0 deletions ExternalSimulation/42/ex3/Flex_Simple.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<<<<<<<<<<<<<< Flexible Body Inputs for 42 >>>>>>>>>>>>>>>>>>>
Simple Flex Model ! Description
2 ! Number of Flex Modes
****************** Initial Modal States x, u ******************
1.0E-6 0.0 ! Mode 0 x, u
1.0E-6 0.0 ! Mode 1 x, u
****************** Joint Node Mode Shapes *********************
******* Non-zero Translation Mode Shape (PSI) Elements ********
0 ! Number of non-zero elements
******* Non-zero Rotation Mode Shape (THETA) Elements ********
0 ! Number of non-zero elements
**************** Analysis Node Mode Shapes *********************
******* Non-zero Translation Mode Shape (PSI) Elements ********
12 ! Number of non-zero elements
0 0 0 0.1 ! [Mode] [Node] [Axis] Value
0 0 1 0.1 ! [Mode] [Node] [Axis] Value
0 0 2 0.1 ! [Mode] [Node] [Axis] Value
0 1 0 -0.1 ! [Mode] [Node] [Axis] Value
0 1 1 -0.1 ! [Mode] [Node] [Axis] Value
0 1 2 -0.1 ! [Mode] [Node] [Axis] Value
1 0 0 0.1 ! [Mode] [Node] [Axis] Value
1 0 1 0.1 ! [Mode] [Node] [Axis] Value
1 0 2 0.1 ! [Mode] [Node] [Axis] Value
1 1 0 0.1 ! [Mode] [Node] [Axis] Value
1 1 1 0.1 ! [Mode] [Node] [Axis] Value
1 1 2 0.1 ! [Mode] [Node] [Axis] Value
******* Non-zero Rotation Mode Shape (THETA) Elements ********
12 ! Number of non-zero elements
0 0 0 0.1 ! [Mode] [Node] [Axis] Value
0 0 1 0.0707 ! [Mode] [Node] [Axis] Value
0 0 2 0.057735 ! [Mode] [Node] [Axis] Value
0 1 0 -0.1 ! [Mode] [Node] [Axis] Value
0 1 1 -0.0707 ! [Mode] [Node] [Axis] Value
0 1 2 -0.057735 ! [Mode] [Node] [Axis] Value
1 0 0 0.1 ! [Mode] [Node] [Axis] Value
1 0 1 0.0707 ! [Mode] [Node] [Axis] Value
1 0 2 0.057735 ! [Mode] [Node] [Axis] Value
1 1 0 0.1 ! [Mode] [Node] [Axis] Value
1 1 1 0.0707 ! [Mode] [Node] [Axis] Value
1 1 2 0.057735 ! [Mode] [Node] [Axis] Value
**************** Non-zero Mass Matrix Elements ******************
2 ! Number of non-zero elements
0 0 1.0 ! [Row] [Col] Value
1 1 1.0 ! [Row] [Col] Value
************* Non-zero Stiffness Matrix Elements ****************
2 ! Number of non-zero elements
0 0 39.478 ! [Row] [Col] Value (1 Hz)
1 1 3947.8 ! [Row] [Col] Value (10 Hz)
************* Non-zero Damping Matrix Elements ****************
2 ! Number of non-zero elements
0 0 0.012566 ! [Row] [Col] Value (0.1%)
1 1 0.12566 ! [Row] [Col] Value (0.1%)
********* Linear Momentum Modal Integral, Pf, 3 x Nf *********
0.0 0.0 0.0 ! Mode 0, [x y z]
0.0 0.0 0.0 ! Mode 1, [x y z]
******** Angular Momentum Modal Integral, Hf, 3 x Nf *********
0.0 0.0 0.0 ! Mode 0, [x y z]
0.0 0.0 0.0 ! Mode 1, [x y z]
********** Linear Modal Integral, L, 3 x 3 x Nf **************
0 ! Number of non-zero elements
********* Angular Modal Integral, N, 3 x 3 x Nf x Nf *********
0 ! Number of non-zero elements
[EOF]

Empty file.
Empty file.
Empty file.
84 changes: 84 additions & 0 deletions ExternalSimulation/42/ex3/Inp_Cmd.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
<<<<<<<<<<<<<<<<< 42: Command Script File >>>>>>>>>>>>>>>>>
0.0 SC[0] qrn = [0.0 0.0 0.0 1.0]
1000.0 SC[0] qrl = [0.0 1.0 0.0 0.0]
2000.0 Point SC[0].B[0] Primary Vector [0.0 0.0 1.0] at VELOCITY
2000.0 Point SC[0].B[0] Secondary Vector [1.0 0.0 0.0] at SUN


EOF

##############################################################
# All lines after EOF are ignored
# Comment lines begin with #, %, or //
# Blank lines are permitted

# Here are recognized command formats.
# %lf means that a floating-point number is expected
# %ld means that an integer is expected
# %s means that a string is expected
# %c means that a character is expected
# Look in functions SimCmdInterpreter, GuiCmdInterpreter,
# and FswCmdInterpreter for strings and characters that
# are meaningful in a particular context
# The first %lf is always the SimTime of command execution.

# Sim-related commands
%lf DTSIM = %lf
%lf SC[%ld].DynMethod %s
%lf SC[%ld].G[%ld].RotLocked[%ld] %s
%lf SC[%ld].G[%ld].TrnLocked[%ld] %s
%lf Impart Impulsive Delta-V of [%lf %lf %lf] m/s in Frame %c to Orb[%ld]
%c can be N or L
%lf SC[%ld].LoopGain = %lf
%lf SC[%ld].LoopDelay = %lf
%lf SC[%ld].GainAndDelayActive = %s

# GUI-related commands
%lf POV.Host.SC %ld
%lf CaptureCam %s
%lf CamSnap %s
%lf MapSnap %s
%lf Banner = "Banner in Quotes"
%lf GL Output Step = %lf
%lf POV CmdRange = %lf
%lf POV CmdSeq = %ld
%lf POV CmdAngle = [%lf %lf %lf] deg
%lf POV CmdPermute = [%lf %lf %lf; %lf %lf %lf; %lf %lf %lf]
%lf POV TimeToGo = %lf
%lf POV Frame = %c
%lf ShowHUD %s
%lf ShowWatermark %s
%lf ShowShadows %s
%lf ShowProxOps %s
%lf ShowFOV %s
%lf FOV[%ld].NearExists = %s
%lf FOV[%ld].FarExists = %s

# FSW-related commands
%lf SC[%ld] FswTag = %s
# %s is PASSIVE_FSW, PROTOTYPE_FSW, etc.
%lf SC[%ld] qrn = [%lf %lf %lf %lf]
%lf SC[%ld] qrl = [%lf %lf %lf %lf]
%lf SC[%ld] Cmd Angles = [%lf %lf %lf] deg, Seq = %ld wrt %c Frame
# %c is either N or L
%lf SC[%ld].G[%ld] Cmd Angles = [%lf %lf %lf] deg
# In the following, the (first) %s is either "Primary" or "Secondary"
%lf Point SC[%ld].B[%ld] %s Vector [%lf %lf %lf] at RA = %lf deg, Dec = %lf deg
%lf Point SC[%ld].B[%ld] %s Vector [%lf %lf %lf] at World[%ld] Lng = %lf deg, Lat = %lf deg, Alt = %lf km
%lf Point SC[%ld].B[%ld] %s Vector [%lf %lf %lf] at World[%ld]
%lf Point SC[%ld].B[%ld] %s Vector [%lf %lf %lf] at GroundStation[%ld]
%lf Point SC[%ld].B[%ld] %s Vector [%lf %lf %lf] at %s
# Last %s is SUN, MOON, any planet, VELOCITY, or MAGFIELD
%lf Point SC[%ld].B[%ld] %s Vector [%lf %lf %lf] at SC[%ld]
%lf Point SC[%ld].B[%ld] %s Vector [%lf %lf %lf] at SC[%ld].B[%ld] point [%lf %lf %lf]
%lf Align SC[%ld].B[%ld] %s Vector [%lf %lf %lf] with %c-frame Vector [%lf %lf %lf]
# %c-frame can be H, N, or L
%lf Align SC[%ld].B[%ld] %s Vector [%lf %lf %lf] with SC[%ld].B[%ld] vector [%lf %lf %lf]
Event Eclipse Entry SC[%ld] qrl = [%lf %lf %lf %lf]
Event Eclipse Exit SC[%ld] qrl = [%lf %lf %lf %lf]
Event Eclipse Entry SC[%ld] Cmd Angles = [%lf %lf %lf] deg, Seq = %ld wrt %c Frame
# %c is either N or L
Event Eclipse Exit SC[%ld] Cmd Angles = [%lf %lf %lf] deg, Seq = %ld wrt %c Frame
# %c is either N or L
%lf Set SC[%ld] RampCoastGlide wc = %lf Hz, amax = %lf, vmax = %lf
%lf Spin SC[%ld] about Primary Vector at %lf deg/sec
46 changes: 46 additions & 0 deletions ExternalSimulation/42/ex3/Inp_FOV.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
************************* Fields of View ***************************
4 ! Number of FOVs
--------------------------------------------------------------------
"SOLID" ! Label
4 4.0 ! Number of Sides, Length [m]
8.0 4.0 ! H Width, V Height [deg]
0.0 1.0 0.0 0.5 ! Color RGB+Alpha
SOLID ! WIREFRAME, SOLID, VECTOR, or PLANE
TRUE TRUE ! Draw Near Field, Draw Far Field
0 0 ! SC, Body
0.0 0.0 1.0 ! Position in Body [m]
0.0 0.0 0.0 321 ! Euler Angles [deg], Sequence
Z_AXIS ! Boresight Axis X_AXIS, Y_AXIS, or Z_AXIS
--------------------------------------------------------------------
"WIRE" ! Label
24 4.0 ! Number of Sides, Length [m]
10.0 5.0 ! H Width, V Height [deg]
0.7 0.7 0.0 1.0 ! Color RGB+Alpha
WIREFRAME ! WIREFRAME, SOLID, VECTOR, or PLANE
TRUE TRUE ! Draw Near Field, Draw Far Field
0 0 ! SC, Body
1.0 0.0 0.0 ! Position in Body [m]
0.0 0.0 0.0 213 ! Euler Angles [deg], Sequence
X_AXIS ! Boresight Axis X_AXIS, Y_AXIS, or Z_AXIS
--------------------------------------------------------------------
"VECTOR" ! Label
0 4.0 ! Number of Sides, Length [m]
0.0 0.0 ! H Width, V Height [deg]
0.0 1.0 1.0 1.0 ! Color RGB+Alpha
VECTOR ! WIREFRAME, SOLID, VECTOR, or PLANE
TRUE TRUE ! Draw Near Field, Draw Far Field
0 0 ! SC, Body
1.0 0.0 0.0 ! Position in Body [m]
135.0 0.0 0.0 213 ! Euler Angles [deg], Sequence
Z_AXIS ! Boresight Axis X_AXIS, Y_AXIS, or Z_AXIS
--------------------------------------------------------------------
"PLANE" ! Label
24 8.0 ! Number of Sides, Length [m]
0.0 0.0 ! H Width, V Height [deg]
1.0 1.0 1.0 0.3 ! Color RGB+Alpha
PLANE ! WIREFRAME, SOLID, VECTOR, or PLANE
TRUE TRUE ! Draw Near Field, Draw Far Field
0 0 ! SC, Body
0.0 0.0 0.0 ! Position in Body [m]
-45.0 0.0 0.0 213 ! Euler Angles [deg], Sequence
Z_AXIS ! Boresight Axis X_AXIS, Y_AXIS, or Z_AXIS
55 changes: 55 additions & 0 deletions ExternalSimulation/42/ex3/Inp_Graphics.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<<<<<<<<<<<<<<<< 42 Graphics Configuration File >>>>>>>>>>>>>>>>>>>
0.01 ! GL Output Interval [sec]
Skymap09.txt ! Star Catalog File Name
TRUE ! Map Window Exists
TRUE ! Orrery Window Exists
TRUE ! Unit Sphere Window Exists
******************************* POV *********************************
FALSE ! Pause at Startup
TRACK_HOST ! POV Mode (TRACK_HOST, TRACK_TARGET, FIXED_IN_HOST)
SC ! Host Type (WORLD, REFORB, FRM, SC, BODY)
0 0 L ! Initial Host SC, Body, POV Frame
SC ! Target Type (WORLD, REFORB, FRM, SC, BODY)
0 0 L ! Initial Target SC, Body, POV Frame
POS_X ! Boresight Axis
NEG_Z ! Up Axis
3.0 ! Initial POV Range from Target [m]
30.0 ! POV Angle (Vertical) [deg]
0.0 0.0 0.0 ! POV Position in Host [m]
FRONT ! Initial POV View (FRONT, FRONT_RIGHT, etc)
******************************* CAM *********************************
"42 Cam" ! Cam Title [delimited by "]
800 800 ! Width, Height [pixels]
5.0E-5 ! Mouse Scale Factor
1.8 ! Display's Gamma Exponent (1.8-4.0)
************************** CAM Show Menu ****************************
FALSE "N Axes" ! Show N Axes
FALSE "L Axes" ! Show L Axes
FALSE "F Axes" ! Show F Axes
FALSE "B Axes" ! Show B Axes
FALSE "N Grid" ! Show N Grid
FALSE "L Grid" ! Show L Grid
FALSE "F Grid" ! Show F Grid
FALSE "B Grid" ! Show B Grid
FALSE "Gal Grid" ! Show B Grid
FALSE "FOVs" ! Show Fields of View
FALSE "Prox Ops" ! Show Prox Ops
FALSE "TDRS" ! Show TDRS Satellites
TRUE "Shadows" ! Show Shadows
FALSE "Astro Labels" ! Show Astro Labels
FALSE "Truth Vectors" ! Show Truth Vectors
FALSE "FSW Vectors" ! Show FSW Vectors
TRUE "Milky Way" ! Show Milky Way
FALSE "Fermi Sky" ! Show Fermi Sky
******************************* MAP *********************************
"42 Map" ! Map Title [delimited by "]
512 256 ! Width, Height [pixels]
************************** MAP Show Menu ****************************
TRUE "Clock" ! Show Clock
TRUE "Tlm Clock" ! Show Clock
FALSE "Credits" ! Show Credits
TRUE "Night" ! Show Night
********************* Unit Sphere Show Menu *************************
TRUE ! Show Major Constellations
TRUE ! Show Zodiac Constellations
FALSE ! Show Minor Constellations
44 changes: 44 additions & 0 deletions ExternalSimulation/42/ex3/Inp_IPC.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<<<<<<<<<<<<<<< 42: InterProcess Comm Configuration File >>>>>>>>>>>>>>>>
1 ! Number of Sockets
********************************** IPC 0 *****************************
TXRX ! IPC Mode (OFF,TX,RX,TXRX,ACS,WRITEFILE,READFILE)
0 ! AC.ID for ACS mode
"State00.42" ! File name for WRITE or READ
SERVER ! Socket Role (SERVER,CLIENT,GMSEC_CLIENT)
localhost 10001 ! Server Host Name, Port
FALSE ! Allow Blocking (i.e. wait on RX)
FALSE ! Echo to stdout
3 ! Number of TX prefixes
"SC" ! Prefix 0
"Orb" ! Prefix 1
"World" ! Prefix 2
********************************** IPC 1 *****************************
RX ! IPC Mode (OFF,TX,RX,TXRX,ACS,WRITEFILE,READFILE)
0 ! AC.ID for ACS mode
"State01.42" ! File name for WRITE or READ
CLIENT ! Socket Role (SERVER,CLIENT,GMSEC_CLIENT)
localhost 10002 ! Server Host Name, Port
FALSE ! Allow Blocking (i.e. wait on RX)
FALSE ! Echo to stdout
1 ! Number of TX prefixes
"SC[0].AC" ! Prefix 0
********************************** IPC 2 *****************************
OFF ! IPC Mode (OFF,TX,RX,TXRX,ACS,WRITEFILE,READFILE)
1 ! AC.ID for ACS mode
"State02.42" ! File name for WRITE or READ
CLIENT ! Socket Role (SERVER,CLIENT,GMSEC_CLIENT)
localhost 10003 ! Server Host Name, Port
TRUE ! Allow Blocking (i.e. wait on RX)
FALSE ! Echo to stdout
1 ! Number of TX prefixes
"SC[1].AC" ! Prefix 0
********************************** IPC 3 *****************************
OFF ! IPC Mode (OFF,TX,RX,TXRX,ACS,WRITEFILE,READFILE)
0 ! AC.ID for ACS mode
"State03.42" ! File name for WRITE or READ
CLIENT ! Socket Role (SERVER,CLIENT,GMSEC_CLIENT)
localhost 10004 ! Server Host Name, Port
TRUE ! Allow Blocking (i.e. wait on RX)
FALSE ! Echo to stdout
1 ! Number of TX prefixes
"SC[0].Tach[0]" ! Prefix 0
3 changes: 3 additions & 0 deletions ExternalSimulation/42/ex3/Inp_NOS3.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<<<<<<<<<<<<<<<< 42 NOS3 Time Configuration File >>>>>>>>>>>>>>>>>>>
command ! NOS3 Time Bus
tcp://127.0.0.1:12001 ! NOS3 Time Connection String
20 changes: 20 additions & 0 deletions ExternalSimulation/42/ex3/Inp_Region.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
******************** Regions for 42 *******************
2 ! Number of Regions
---------------------------------------------------------
TRUE ! Exists
"TAG" ! Name
MINORBODY_2 ! World
POSW ! POSW or LLA
2400.9966 -1074.41895 439.1271 ! Position in W, m
-24.120375966731 9.48979662 27.7155 ! Lng, Lat (deg), Alt (m)
1.0E6 1.0E4 0.1 ! Elasticity, Damping, Friction Coef
Rgn_TAG.obj ! Geometry File Name
---------------------------------------------------------
TRUE ! Exists
"LZ" ! Name
EARTH ! World
LLA ! POSW or LLA
0.0 0.0 0.0 ! Position in W, m
-80.53 28.46 1000.0 ! Lng, Lat (deg), Alt (m)
1.0E6 1.0E4 0.1 ! Elasticity, Damping, Friction Coef
Rgn_Terrain.obj ! Geometry File Name
Loading