- In the Getting Started tutorial, we can directly build and execute
s2e-core
, but for source code sharing and practical usage of S2E, we strongly recommend managing s2e-core and s2e-user repository separately.- s2e-core repository is shared with other users. Most of the source files are in this core repository. The codes are used as a library by the
s2e-user
repository. s2e-user
repository is an independent repository for each spacecraft project or research project. This repository includes the following parts:- Source codes for the
main
- Source codes for
simulation scenario
- Source codes for
components
if the target spacecraft has components, which strongly depends on your project. Initialize files
Compile setting
files as CMake files, Visual Studio Solution files, or others.
- Source codes for the
- s2e-core repository is shared with other users. Most of the source files are in this core repository. The codes are used as a library by the
- This tutorial explains an example of how to make
s2e-user
repository and execute it. - The supported version of this document
- Please confirm that the version of the documents and
s2e-core
is compatible.
- Please confirm that the version of the documents and
-
We provides a sample of a s2e-user repository as s2e-user-example.
-
The repository is constructed as follows.
- The repository includes
s2e-core
by usinggit submodule
feature. - The
ExtLibraries
for the user side repository should be generated by using theCMake
files in thes2e-core
.
└─ s2e-user-example └─ src └─ data └─ s2e-core (git submodule) └─ ExtLibraries (generated by the following procedure) └─ other files
- The repository includes
-
Clone s2e-user-example repository in a working directory.
- Because the repository includes s2e-core with the
git submodule
, please use the following commands to construct the directory.Or use the following command to clone the repository.$ git clone [email protected]:ut-issl/s2e-user-example.git $ cd s2e-user-example/ $ git submodule init $ git submodule update
$ git clone --recursive [email protected]:ut-issl/s2e-user-example.git
- Because the repository includes s2e-core with the
-
Download mandatory
ExtLibraries
(CSPICE and NRLMSISE-00).- Users need to use the
CMakeList.txt
in thes2e-user-example/s2e-core/ExtLibraries
to download the mandatory external libraries. - The construction procedure is same with the s2e-core. Please see a
How To Build
document suit with your platform.└─ s2e-user-example └─ src └─ data └─ s2e-core (git submodule) └─ ExtLibraries └─ CMakeLists.txt (Use this file in this step) └─ ExtLibraries (This directory is generated by this step) └─ cspice └─ GeoPotential └─ nrlmsise00
- Users need to use the
-
According to the
How To Build
document, use thes2e-user-example/CMakeList.txt
and build the s2e-user. -
Execute and check the
s2e-user/data/logs
. -
Similar to Getting Started, you can edit initialize files in
s2e-user-example/data/initialize_files
and check the log file.
Note: Users can use other characters instead of user
for a practical case. For example, you can name it s2e_equuleus
to indicate the EQUULEUS spacecraft project.
- This chapter explains the overview of the
main
branch of thes2e-user-example
. - The files in the directory are as follows. From here, the detail of each file is described.
└─ s2e-user-example └─ CMakeLists.txt └─ CMakeSetting.json └─ data └─ initialize_files └─ logs └─ src └─ simulation └─ case └─ user_case.cpp └─ user_case.hpp └─ Spacecraft └─ user_components.cpp └─ user_components.hpp └─ user_satellite.cpp └─ user_satellite.hpp └─ s2e_user.cpp └─ s2e-core (git submodule)
-
CMakeLists.txt
andCMakeSetting.json
CMakeLists.txt
is a CMake file for a compile setting.- Details of description rules for CMake files can be searched on the internet, so please refer to them.
- When you add new source files, the new files is automatically included as the build target. If you do not include them, please add them to excluding list in the
CMakeList.txt
.
CMakeSetting.json
is a compile setting file for Visual Studio.
-
data/initialize_files
anddata/logs
- In the
initialize_files
directory, there are several initialize files.- The most important initialize file is
user_simulation_base.ini
. - Other initialize files are defined in this base initialize file. So you need to edit the file names in the base file when you modify the name of other initialize files.
- When you change the name of the base file, you have to edit
s2e_user.cpp
.
- When you change the name of the base file, you have to edit
- Details of the initialize files are described in
Specifications
.- Basic files are described in Getting Started.
- The most important initialize file is
logs
- CSV log files will be outputted here. The output directory is also defined in
user_simulation_base.ini
, so that you can change it.
- CSV log files will be outputted here. The output directory is also defined in
- In the
-
src/s2e_user.cpp
- This is the main file of this program.
- In this code,
user_simulation_base.ini
is defined as the base file for the simulation, and an instance of theSimulationCase
class namedUserCase
is created and initialized. And finally, the main routine of the class is executed.
-
src/simulation/case/user_case.cpp, .hpp
UserCase
class is defined here.UserCase
class inherits theSimulationCase
base class in thes2e-core
. TheSimulationCase
class has aSimulationConfiguration
andGlobalEnvironment
class. TheUserCase
class has an instance of thespacecraft
class named asUserSatellite
.
-
src/simulation/spacecraft/user_satellite.cpp, .hpp
UserSatellite
class is defined here.UserSatellite
class inherits theSpacecraft
class in thes2e-core
. TheSpacecraft
base class has instances ofDynamics
,LocalEnvironment
,Disturbance
, andStructure
. And theUserSatellite
class has an instance ofUserComponents
.
-
src/simulation/spacecraft/user_components.cpp, .hpp
- The
UserComponents
class is defined here. Most users edit this code to custom the S2E for their satellite projects. - Users select components they want to use from the
s2e-core/src/components
. - You can add new source codes in the
s2e-user/components
directory if you want to make original components.
- The