Skip to content
Open
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
38 changes: 19 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
- The branch construction
- main
- Documents for the latest stable version of s2e-core
- The Current version supports [s2e-core v8.0.0](https://github.com/ut-issl/s2e-core/releases/tag/v8.0.0)
- The Current version supports [s2e-core v9.0.0](https://github.com/ut-issl/s2e-core/releases/tag/v9.0.0)
- If there are several patch update versions, please use the latest one to avoid bugs.
- The old versions are managed with `release/tag/v.*.*.*`
- The `major` version number is compatible with s2e-core's `major` version number.
Expand Down Expand Up @@ -401,24 +401,6 @@

</details>

1. <details><summary> Simulation Sample </summary>

- `simulation_sample` directory manages example source codes for user-defined simulation scenarios. Users can copy and modify this directory to make user-defined simulation scenarios.

1. Case
1. [Sample Case](./Specifications/Simulation/Spec_SampleCase.md)

1. Ground Station
1. [Sample Ground Station](./Specifications/Simulation/Spec_SampleGroundStation.md)
1. [Sample Ground Station Components](./Specifications/Simulation/Spec_SampleGroundStationComponents.md)

1. Spacecraft
1. [Sample Spacecraft](./Specifications/Simulation/Spec_SampleSpacecraft.md)
1. [Sample Components](./Specifications/Simulation/Spec_SampleSpacecraftComponents.md)
1. SamplePortConfiguration: TBW

</details>

1. <details><summary> Utilities </summary>

1. Endian: TBW
Expand All @@ -430,4 +412,22 @@

</details>

1. <details><summary> Example </summary>

- `example` directory manages example source codes for user-defined simulation scenarios. Users can copy and modify this directory to make user-defined simulation scenarios.

1. Case
1. [Sample Case](./Specifications/Example/Spec_SampleCase.md)

1. Ground Station
1. [Sample Ground Station](./Specifications/Example/Spec_SampleGroundStation.md)
1. [Sample Ground Station Components](./Specifications/Example/Spec_SampleGroundStationComponents.md)

1. Spacecraft
1. [Sample Spacecraft](./Specifications/Example/Spec_SampleSpacecraft.md)
1. [Sample Components](./Specifications/Example/Spec_SampleSpacecraftComponents.md)
1. SamplePortConfiguration: TBW

</details>

1. [Troubleshooting](./General/Troubleshooting.md)
193 changes: 86 additions & 107 deletions Tutorials/HowToMakeNewSimulationScenario.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,113 +2,92 @@

## 1. Overview

- In the [Getting Started](./GettingStarted.md) 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](https://github.com/ut-issl/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` function.
- Source codes for `simulation scenario`.
- Source codes for `components` if the target spacecraft has components, which strongly depends on your project.
- `Setting files` to define detailed parameters for simulation settings.
- `Compile setting` files as [CMake files](https://cmake.org/), [Visual Studio Solution files](https://visualstudio.microsoft.com/downloads/), or others.
- 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.


## 2. Structure of S2E-USER directory
- We provides a sample of a s2e-user repository as [s2e-user-example](https://github.com/ut-issl/s2e-user-example).
- The repository is constructed as follows.
- The repository includes `s2e-core` by using `git submodule` feature.
- The `ExtLibraries` for the user side repository should be generated by using the `CMake` files in the `s2e-core`.

```
└─ s2e-user-example
└─ src
└─ s2e-core (git submodule)
└─ ExtLibraries (generated by the following procedure)
└─ settings
└─ logs
└─ other files
```
- In the [Getting Started](./GettingStarted.md) tutorial, we directly build and execute `s2e-core`. However, for **source code sharing** and practical usage of S2E, we **strongly recommend managing the s2e-core and s2e-user repositories separately**.
- The [s2e-core](https://github.com/ut-issl/s2e-core) repository is shared with other users. It contains most of the source files and is used as a library by the `s2e-user` repository.
- The `s2e-user` repository is an independent repository for **each spacecraft project or research project**. It includes:
- Source code for the `main` function.
- Source code for the simulation scenario.
- Source code for project-specific components.
- Initialization files that define simulation settings.
- Build configuration files such as [CMake files](https://cmake.org/).
- This tutorial explains how to set up and execute an example `s2e-user` repository.
- This document supports [s2e-core v9.0.0](https://github.com/ut-issl/s2e-core/releases/tag/v9.0.0).


## 2. Structure of the S2E-USER directory

- [s2e-user-example v9.0.0](https://github.com/ut-issl/s2e-user-example/tree/v9.0.0) is a sample `s2e-user` repository for this tutorial.
- The repository includes `s2e-core` as a Git submodule.
- The setup scripts use the CMake files in `s2e-core` to install external libraries into `ExtLibraries` and environment data into `settings/environment`.

```text
s2e-user-example
|-- CMakeLists.txt
|-- CMakePresets.json
|-- scripts
| |-- setup.sh
| `-- setup.ps1
|-- src
|-- s2e-core (Git submodule)
|-- settings
|-- logs
|-- ExtLibraries (generated by the setup script)
`-- build (generated by the setup script)
```

## 3. Setup s2e-user-example

1. Clone [s2e-user-example](https://github.com/ut-issl/s2e-user-example) repository in a working directory.
- Because the repository includes [s2e-core](https://github.com/ut-issl/s2e-core) with the `git submodule`, please use the following commands to construct the directory.
```
$ git clone git@github.com:ut-issl/s2e-user-example.git
$ cd s2e-user-example/
$ git submodule init
$ git submodule update
```
Or use the following command to clone the repository.
```
$ git clone --recursive git@github.com:ut-issl/s2e-user-example.git
```

2. Download mandatory `ExtLibraries` (CSPICE and NRLMSISE-00).
- Users need to use the `CMakeList.txt` in the `s2e-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.
- Please carefully check the `EXT_LIB_DIR` and `SETTINGS_DIR` and change the path if needed.
- Please check the following directories and files are made.
```
└─ s2e-user-example
└─ src
└─ s2e-core (git submodule)
└─ ExtLibraries
└─ CMakeLists.txt (Use this file in this step)
└─ ExtLibraries (This directory is generated by this step)
└─ cspice
└─ nrlmsise00
└─ settings
└─ environment
└─ cspice
└─ generic_kernels (This directory is generated by this step)
└─ space_weather
└─ SpaceWeather-v1.2.txt (This file is generated by this step)
└─ logs
```

3. According to the `How To Build` document, use the `s2e-user-example/CMakeList.txt` and build the s2e-user.

4. Execute and check the `s2e-user-example/logs`.

5. Similar to [Getting Started](./GettingStarted.md), you can edit initialize files in `s2e-user-example/settings` 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.


## 4. Overview of S2E-USER-EXAMPLE

- This chapter explains the overview of the `main` branch of the `s2e-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
└─ settings
└─ 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)
1. Clone [s2e-user-example v9.0.0](https://github.com/ut-issl/s2e-user-example/tree/v9.0.0), including its submodules.

```sh
git clone --branch v9.0.0 --recursive https://github.com/ut-issl/s2e-user-example.git
cd s2e-user-example
```

2. Follow the [Development environment setup](https://github.com/ut-issl/s2e-user-example/tree/v9.0.0#development-environment-setup) in the repository README to install the external libraries and build `S2E_USER_EXAMPLE`.

3. Execute the simulator and check the generated CSV file in `s2e-user-example/logs`. As in [Getting Started](./GettingStarted.md), you can edit the initialization files in `s2e-user-example/settings` and rerun the simulator without rebuilding.

**Note:** You can replace `user` with a project-specific name in a practical case. For example, the EQUULEUS spacecraft project could use `s2e_equuleus`.


## 4. Overview of S2E-USER-EXAMPLE

- This section describes [s2e-user-example v9.0.0](https://github.com/ut-issl/s2e-user-example/tree/v9.0.0).
- The main files and directories are as follows:
```text
s2e-user-example
|-- CMakeLists.txt
|-- CMakePresets.json
|-- scripts
| |-- setup.sh
| `-- setup.ps1
|-- settings
|-- 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)
```

1. `CMakeLists.txt` and `CMakeSetting.json`
- `CMakeLists.txt` is a [CMake file](https://cmake.org/) 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.
1. `CMakeLists.txt` and `CMakePresets.json`
- `CMakeLists.txt` defines the S2E user executable and its dependencies.
- New `.cpp` files under `src` are automatically included in the build target. Add files to the exclusion filter in `CMakeLists.txt` when they should not be compiled.
- `CMakePresets.json` provides shared configuration and build presets for Linux, macOS, and Visual Studio 2022. It replaces the former Visual Studio-specific `CMakeSettings.json`.

2. `scripts`
- `setup.sh` sets up and builds the project on Linux and macOS.
- `setup.ps1` sets up and builds the project on Windows.

2. `settings` and `logs`
3. `settings` and `logs`
- In the `settings` directory, there are several setting files to define the simulation parameters.
- The most important setting file is `user_simulation_base.ini`.
- Other setting files are defined in this base setting file. So you need to edit the file names in the base file when you modify the name of other setting files.
Expand All @@ -118,17 +97,17 @@
- `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.

3. `src/s2e_user.cpp`
4. `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 the `SimulationCase` class named `UserCase` is created and initialized. And finally, the main routine of the class is executed.

4. `src/simulation/case/user_case.cpp, .hpp`
5. `src/simulation/case/user_case.cpp, .hpp`
- `UserCase` class is defined here. `UserCase` class inherits the `SimulationCase` base class in the `s2e-core`. The `SimulationCase` class has a `SimulationConfiguration` and `GlobalEnvironment` class. The `UserCase` class has an instance of the `spacecraft` class named as `UserSatellite`.

5. `src/simulation/spacecraft/user_satellite.cpp, .hpp`
6. `src/simulation/spacecraft/user_satellite.cpp, .hpp`
- `UserSatellite` class is defined here. `UserSatellite` class inherits the `Spacecraft` class in the `s2e-core`. The `Spacecraft` base class has instances of `Dynamics`, `LocalEnvironment`, `Disturbance`, and `Structure`. And the `UserSatellite` class has an instance of `UserComponents`.

6. `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.
7. `src/simulation/spacecraft/user_components.cpp, .hpp`
- The `UserComponents` class is defined here. Most users edit this code to customize S2E for their spacecraft 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.
- You can add source files under `s2e-user/src/components` when implementing project-specific components.
1 change: 0 additions & 1 deletion book.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
[book]
language = "en"
multilingual = false

authors = ["sksat"]

Expand Down
Loading