diff --git a/General/CodingConvention.md b/General/CodingConvention.md
index 466cfaa8..7423dbf8 100644
--- a/General/CodingConvention.md
+++ b/General/CodingConvention.md
@@ -7,26 +7,34 @@
## Naming Rules
-- Now discussing)*
- - The following rules are follows until the naming rule is decided.
+- Now discussing
+ - The following rules are follows until the new naming rule is decided.
+ - Several old files do not follow the rules.
+
+- File and directory Name
+ - `CamelCase`
- Macro (define)
- - All capital letters, connect between words with _
+ - Snake case with capital case
+ - `SNAKE_CASE`
- Name of the class
- CamelCase (capitalize only the beginning of words)
+ - `CamelCase`
- Variable name
- - All lowercase letters, connect between words with _
+ - Snake case with lower case
+ - `snake_case`
- Constant name (not a define but a constant)
- - Add k at the beginning and the rest is CamelCase
+ - Add k at the beginning and the rest is CamelCase
+ - `kCamelCase`
- Member variables in the class
- - Lowercase letters, connect between words with _, end with _
+ - Snake case with lower case end with `_`
+ - `snake_case_`
- Methods (functions) in the class
- - CamelCase
+ - `CamelCase`
## Documentation
@@ -38,4 +46,4 @@
## Initialization files (`.ini` files)
- Comments
- - Use //
\ No newline at end of file
+ - Use //
diff --git a/General/DocumentFormat.md b/General/DocumentFormat.md
index bdb3fc8f..58e31d8b 100644
--- a/General/DocumentFormat.md
+++ b/General/DocumentFormat.md
@@ -1,7 +1,7 @@
# Format to write specification documents
## 0. General rule
-- The file name should be "Spec_***.md" in the Specifications directory.
+- The file name should be `Spec_CamelCase.md` in the Specifications directory.
- Please use the markdown format.
- The markdown files are converted to a book with [mdBook](https://rust-lang.github.io/mdBook/) and published in Github Pages.
- The equations are rendered with [MathJax](https://www.mathjax.org/)
@@ -77,4 +77,4 @@
## 4. References
-1.
\ No newline at end of file
+1.
diff --git a/General/HowToCompileWithUbuntuInDocker.md b/General/HowToCompileWithUbuntuInDocker.md
index d93216ff..2ae6119c 100644
--- a/General/HowToCompileWithUbuntuInDocker.md
+++ b/General/HowToCompileWithUbuntuInDocker.md
@@ -4,17 +4,18 @@
- [Docker](https://www.docker.com/) is useful for the easy setup of the compile environment for S2E.
- *Both Windows and Mac* users can use the same environment and get the same result by using the docker container.
- We selected [Ubuntu](https://ubuntu.com/) as an OS in the docker image and [GCC/G++](https://gcc.gnu.org/) as a compiler for S2E.
- **Note**: Currently, we use a 32bit compiler for S2E since flight S/Ws are usually executed on a 32bit microcomputers.
+ **Note**: We currently use a 32bit compiler for S2E since flight S/Ws are usually executed on a 32bit microcomputers.
- We recommend using [Visual Studio Code](https://code.visualstudio.com/) as an editor for the environment.
- This document explains a setup sequence of the docker environment for S2E.
+- Note: For a detailed explanation of Docker and VSCode's Extensions, please see the latest and official information.
## 2. Install Required Application
### 2.1. Docker
-- Go [install web page of Docker](https://docs.docker.com/get-docker/)
+- Go to the [install web page of Docker](https://docs.docker.com/get-docker/).
- Install `Docker for Windows` or `Docker for Mac` to suit your platform.
### 2.2. Visual Studio Code (VS Code)
-- Go [install web page of VS Code](https://code.visualstudio.com/)
+- Go [install web page of VS Code](https://code.visualstudio.com/).
- Install `Visual Studio Code` to suit your platform.
- Install following extensions
- Remote-SSH
@@ -22,80 +23,80 @@
- CMake Tools
- C/C++
- Following extensions are also useful
- - Markdown+Math
- please change the delimiter setting to use the same math format with `Gitlab`.
- Code Spell Checker
### 2.3. **For Mac users**
-- Install `coreutils` to use `realpath` command in `setup_docker.sh`
-- Use the `brew install coreutils` command when you have `Homebrew`
+- Install the `coreutils` to use the `realpath` command in `setup_docker.sh`
+ - Use the `brew install coreutils` command when you have `Homebrew`
## 3. A Sequence of environment setting
### 3.1. Working directory setting
-- Create `work` directory as a working directory.
+- Create a `work` directory as a working directory.
- Clone [s2e-core](https://github.com/ut-issl/s2e-core) in the `work` directory.
- Add the `work` directory in the `file sharing` directory of Docker.
- **Note**: This setting does not exist in the latest Docker and WSL2 environments in Windows, so it is not necessary.
+ - **Note**: This setting does not exist in the latest Docker and WSL2 environments in Windows, so it is not necessary.
### 3.2. Make Docker image and container
- Launch `git bash` (for windows users) or `terminal` (for Mac users)
- Move `/s2e-core/scripts/Docker_Ubuntu` directory
- Edit `Dockerfile` or `setup_docker.sh` when you want to change the directory name, the user name of the container, and other settings.
- Execute `./setup_docker.sh build` to make images
-- Check created image (`issl` (and `ubuntu`))
- command: `docker images`
-- Execute `./setup_docker.sh run_core` to make a container
-- Check created container (`issl:latest`)
- command: `docker ps -a`
-- Check dashboard of Docker
-
-
-
+- Check created images (`issl` (and `ubuntu`))
+ - command: `docker images`
+- Execute `./setup_docker.sh run_core` to make the container
+- Check created container (`issl:latest`)
+ - command: `docker ps -a`
+- Check the dashboard of Docker as follows.
+
+
+
-### 3.3. SSH connect with VS Code
-- Launch `VS Code` and open new window
-- Click the `Remote Explorer` icon on the left side
- Note: the icon looks like a monitor
+### 3.3. SSH connects with VS Code
+- Launch `VS Code` and open a new window.
+- Click the `Remote Explorer` icon on the left side.
+ - Note: the icon looks like a monitor
- Click the `gear` icon of `SSH TARGETS` and select the config file you want to edit
- Default: `C:\Users\UserName\ssh\config` or `User/UserName/ssh/config`
+ - Default: `C:\Users\UserName\ssh\config` or `User/UserName/ssh/config`
- Edit the config file as follows
-```
-Host issl-1
- HostName localhost
- User s2e
- Port 2222
-```
+ ```
+ Host issl-1
+ HostName localhost
+ User s2e
+ Port 2222
+ ```
- Save the config file and check a new SSH target `issl-1` is made in the explorer
- Click `Connect to Host in New Window` icon on right side of `issl-1`
- Enter the password `s2e` when required
- See left bottom icon `SSH:issl-1` to confirm the connection
- Open the `work` directory in the container by using `Open folder`
-
-
-
+
+
+
-### 3.4. Setting of build environment
+### 3.4. Download External Libraries
**Note** : This sequence was integrated within the docker build process, so this is currently unnecessary.
- S2E has several script files to get external libraries.
- For this ubuntu/docker platform, users should use script files in `scripts/Common` directory and `scripts/Docker_Ubuntu` directory.
- Users can execute most of the script files with `git bash` or `terminal` in the outside of the container, but users should execute `scripts/Common/download_nrlmsise00_src_and_table.sh` inside the container to use the same compiler.
-- Click `Terminal > New terminal` in the menu bar of VS Code
-- Select `bash` terminal at the bottom window
-- execute `./s2e-core/scripts/Common/download_nrlmsise00_src_and_table.sh`
+- Click `Terminal > New terminal` in the menu bar of VS Code.
+- Select `bash` terminal at the bottom window.
+- Execute `./s2e-core/scripts/Common/download_nrlmsise00_src_and_table.sh`.
- See `ExtLibraries` to confirm the NRLMSISE library is generated.
### 3.5. Build S2E
-- Install following extensions in the `issl-1 SSH connection`
- Even if the extensions were already installed in local VS code, you also need to install them in the `SSH connection`
+- Install the following extensions in the `issl-1 SSH connection`
+ Even if the extensions were already installed in local VS code, you also need to install them in the `SSH connection`.
- C/C++
- CMake
- CMake Tools
-**Note** : You need to reload VS Code after installing new extensions
-- Edit setting of `CMake Tools` in `issl-1`
- `Cmake Build Directory: ${workspaceFolder}/s2e-core/build/Debug`
-- After `CMake` and `CMake Tools` are installed, VS Code requires you to configure the build environment with `CMakeList.txt`. Please select `yes`. But there is no `CMakeList.txt` file in the `work` directory, and VS Code requires you to locate `CMakeList.txt`, so please select the `CMakeList.txt` file in `s2e-core` directory.
+ **Note** : You need to reload VS Code after installing new extensions
+- Edit setting of `CMake Tools` in `issl-1`
+ ```
+ Cmake Build Directory: ${workspaceFolder}/s2e-core/build/Debug
+ ```
+- After `CMake` and `CMake Tools` are installed, VS Code requires you to configure the building environment with `CMakeList.txt`. Please select `yes`. However, there is no `CMakeList.txt` file in the `work` directory, and VS Code requires you to locate `CMakeList.txt`, so please select the `CMakeList.txt` file in `s2e-core` directory.
- This setting is written in `.vscode/settings.json`
- You can directly edit the `settings.json` as follows
```json
@@ -104,23 +105,25 @@ Host issl-1
"cmake.buildDirectory": "${workspaceFolder}/s2e-core/build/Debug"
}
```
-- Select `GCC 9.3.0` as a kit (compiler)
+- Select `GCC 11.2.0` as a kit (compiler)
+ - Note: Users can also choose other GCC versions.
- Select `CMake [Debug]` and check the configuration is successfully done.
- Build S2E
- - If you want clean up, please use `CMake: Clean` command
-- Move `build/Debug` directory with `Terminal` in VS Code
-- Execute `./S2E` or click `run` icon in bottom
-- Check `data/log` directory to confirm log file output
+ - If you want to clean up, please use `CMake: Clean` command.
+- Move to `build/Debug` directory with `Terminal` in VS Code.
+- Execute `./S2E` or click the `run` icon at the bottom.
+- Check the `data/log` directory to confirm log file output.
## 4. Debug with VS Code
- Select `Run > Start Debugging` in the menu bar.
- Select `C++(GDB/LLDB)` debugger
- `.vscode/launch.json` will be created.
-- Edit as follows
+ - If `C++(GDB/LLDB)` is not shown, please open a CPP file and select `Run > Start Debugging` again.
+ - `.vscode/launch.json` will be created.
+- Edit as follows.
```json
"program": "${workspaceFolder}/s2e-core/build/Debug/S2E",
"cwd": "${workspaceFolder}/s2e-core/build/Debug",
```
-- Select `Run > Start Debugging` again
-- Check `data/log` directory to confirm log file output
-- You can use break point in the VS Code editor
+- Select `Run > Start Debugging` again.
+- Check the `data/log` directory to confirm log file output.
+- You can use breakpoints in the VS Code editor.
diff --git a/General/HowToCompileWith_OSX.md b/General/HowToCompileWith_OSX.md
deleted file mode 100644
index 0dfe4485..00000000
--- a/General/HowToCompileWith_OSX.md
+++ /dev/null
@@ -1,67 +0,0 @@
-# How to compile with OSX Environment
-
-## 1. Overview
-
-1. Functions
-
- - CMake can support multi-platform compiling
-
-2. Related files
-
- - ./CmakeLists.txt
-
- - Base file for CMake
-
- - Other CMakeLists.txt in subdirectories
-
-3. CLION
- - CLION is a cross-platform C and C++ IDE for Linux, MAC OS, and Windows integrated with the CMake build system.
- - Could be downloaded from [here](https://www.jetbrains.com/ja-jp/clion/)
- - requires a toolbox subscription for normal users
- - Students and teacheres can get professional Jetbrain account for free
- - https://blog.jetbrains.com/jp/2019/08/22/2105
-
-
-## 2. Flow of compiling in CLION
-
-1. Launch CLION. Select "Open" and select the directory where S2E_CORE_OSS, ExtLibraries, (FlightSW), and S2E_(project name) is included.
-
-2. Open CMakeLists.txt you want to use in CLION. Load CMakeLists.txt file.
- - CMakeFiles could be reloaded by selecting reloading botton at left side of the CMake tab in the bottom window.
-
-3. Build the CMake file
-
- - Build/Build Project
- - Apple Clang compiler in Xcode will be choosed as the default compiler. If you want to use other compilers, edit the following file.
- ```
- S2E_(project name)/cmake-build-debug/out/S2E_CORE/CMakeCache.txt
- ```
- - Output files will be created in the following directory
- ```
- S2E_(project name)/cmake-build-debug/out
- ```
-
-4. Check errors
-
-5. Run the program (^R = control + R)
-
- - Users can use debug mode for debug. (Run/Debug or Control+Option+D)
-
-6. Check log files
-
-## 3. Note
-
-1. In current version of the software (2020/6/6), set your cspice directory name as "cspoice_unix" in apple environment. See "HowToDownloadCSPICElibrary.md" for details.
-2. Apple uses clang in XCode as the default compiler. If you want to use the latest clang compiler instead of XCode, you have to be aware of conflicts between XCode clang and your local clang. See [here](https://students-tech.blog/post/install-clang.html#%E3%83%91%E3%82%B9%E3%82%92%E9%80%9A%E3%81%99)
- - you can check your current default compiler for c++ by the following command.
-```
-C++ --version
-```
-
-## 4. Configured Environement
-Build and run test was conducted in the following environment.
-- OS: macOS Catalina Version 10.15.5
-- Compiler: Apple clang version 11.0.3 (clang-1103.0.32.62)
-- SourceCode:
- - S2E_CORE: e3e51448a3e6044fadb60ee6c6f63a81721f6533 ("OSXでのビルドが通る様に修正")
-- Date: 2020/6/6
\ No newline at end of file
diff --git a/General/HowToDownloadNRLMSISE00library.md b/General/HowToDownloadNRLMSISE00library.md
index 09d6c17f..24b81bfe 100644
--- a/General/HowToDownloadNRLMSISE00library.md
+++ b/General/HowToDownloadNRLMSISE00library.md
@@ -2,15 +2,18 @@
## 1. Overview
- [NRLMSISE00](https://agupubs.onlinelibrary.wiley.com/doi/full/10.1029/2002JA009430) is an atmosphere model to calculate an air density, considering the solar activity.
-- [C language version of NRLMSISE00](https://ccmc.gsfc.nasa.gov/pub/modelweb/atmospheric/msis/nrlmsise00/nrlmsis00_c_version/) is a mandatory library for S2E to calculate the atmosphere density around the Earth.
+- [C language version of NRLMSISE00](https://git.linta.de/?p=~brodo/nrlmsise-00.git;a=summary) is a mandatory library for S2E to calculate the atmosphere density around the Earth.
- How to use NRLMSISE00 is written in the [Specification of Atmosphere model](../Specifications/Environment/Spec_Atmosphere.md).
+- **Note** The [s2e-core v5.0.0](https://github.com/ut-issl/s2e-core/releases/tag/v5.0.0) provides the CMake file to download and install the external libraries, and we recommend to use it since it is simpler. So users do not need to execute the following process.
-## 2. How to set up NRLMSISE00 for S2E
+
+## 2. How to set up NRLMSISE00 for S2E [OLD Descriptions]
1. In any environment, run `s2e-core/scripts/Common/download_nrlmsise00_src_and_table.sh`
+ Source codes of NRLMISE00 and `SpaceWeather.txt` will be downloaded, and `libnrlmsise00.a` will be made for Linux and OSX.
+ Users have to compile the codes using the same compiler with S2E. After these codes are downloaded, you can directly compile them by using makefile in the `ExtLibraries\nrlmsise00\src`.
+ If you use Windows, a bash terminal for Windows (e.g. Git bash, WSL, MSYS) is needed to run this script, and you need to run an additional script. Proceed to Step 2.
+
2. For Windows Visual Studio users, run `s2e-core/scripts/VisualStudio/make_nrlmsise00_VS32bit.bat` after the process 1.
+ VS command prompt will be launched, then run `scripts/VisualStudio/make_libnrlmsise.bat` in VS command prompt.
+ `libnrlmise.lib`, which is the library for Windows Visual Studio will be made.
diff --git a/General/HowToDwnloadCSPCElibrary.md b/General/HowToDwnloadCSPCElibrary.md
index fbd8639e..60de783a 100644
--- a/General/HowToDwnloadCSPCElibrary.md
+++ b/General/HowToDwnloadCSPCElibrary.md
@@ -3,8 +3,10 @@
## 1. Overview
- [SPICE](https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/info/intrdctn.html) is a system to combine the most accurate space geometry and event data with space mission analysis, observation planning, or science data processing software developed by NASA.
- [CSPICE](https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/index.html) is the C language version of SPICE and mandatory library for S2E to get planet information.
+- **Note** The [s2e-core v5.0.0](https://github.com/ut-issl/s2e-core/releases/tag/v5.0.0) provides the CMake file to download and install the external libraries, and we recommend to use it since it is simpler. So users do not need to execute the following process.
-## 2. How to set up CSPICE Library for S2E
+
+## 2. How to set up CSPICE Library for S2E [OLD Descriptions]
**Note**: Users can use the script file to automatically set up the following process in the `s2e-core/script` directory. If the script does not work, please see the following process.
- Make directories as follow
diff --git a/Overview.md b/Overview.md
index 4a4a4b0e..ee6680cf 100644
--- a/Overview.md
+++ b/Overview.md
@@ -1,7 +1,14 @@
## Overview
- This repository summarizes documents of S2E (Spacecraft Simulation Environment) CORE.
-- The Documents should be
- - written in English
- - written as markdown format
- - updated ASAP when the source codes are modified
+- The branch construction
+ - main
+ - Documents for the latest stable version of s2e-core
+ - Current version supports [s2e-core v5.0.0](https://github.com/ut-issl/s2e-core/releases/tag/v5.0.0)
+ - The old versions are managed with `release/tag/v.*.*.*`
+ - The release version number is compatible with s2e-core's version number
+ - develop
+ - Documents for the latest `develop` branch of s2e-core
+ - This version is only for s2e-core developers
+ - feature/branch-name
+ - Writing documents before merge with the `develop`
diff --git a/README.md b/README.md
index 5f3fb015..a1c79659 100644
--- a/README.md
+++ b/README.md
@@ -2,11 +2,18 @@
## Overview
- This repository summarizes documents of [S2E (Spacecraft Simulation Environment)](https://github.com/ut-issl/s2e-core/).
+- The branch construction
+ - main
+ - Documents for the latest stable version of s2e-core
+ - Current version supports [s2e-core v5.0.0](https://github.com/ut-issl/s2e-core/releases/tag/v5.0.0)
+ - The old versions are managed with `release/tag/v.*.*.*`
+ - The release version number is compatible with s2e-core's version number
+ - develop
+ - Documents for the latest `develop` branch of s2e-core
+ - This version is only for s2e-core developers
+ - feature/branch-name
+ - Writing documents before merge with the `develop`
- You can read the documents in the [GitHub Pages of this repository](https://ut-issl.github.io/s2e-documents).
-- The Documents should be
- - written in English
- - written in markdown format
- - updated ASAP when the source codes are modified
- If you have any questions or comments for S2E, feel free to ask us on the [discussions page of s2e-core](https://github.com/ut-issl/s2e-core/discussions).
## Index
@@ -14,16 +21,17 @@
1. General Information
1. [Coding Convention](./General/CodingConvention.md)
2. [Format of Documents](./General/DocumentFormat.md)
- 3. Mandatory set up and How to Build the S2E
- 1. [How to download CSPICE Library](./General/HowToDwnloadCSPCElibrary.md)
+ 3. Mandatory set up and How to Build the S2E
+ 1. [How to build with Visual Studio](./General/HowToCompileWithVisualStudio.md)
+ 2. [How to build with Ubuntu in Docker](./General/HowToCompileWithUbuntuInDocker.md) for **both Windows and Mac** users
+ 3. How to build with other compilers will be written
+ 4. Set up of External Libraries
+ **NOTE**: Currenly, this setting sequence is included in the mandatory setups described above. So users don't need to see the following documents.
+ 1. [How to download CSPICE Library](./General/HowToDwnloadCSPCElibrary.md)
2. [How to download and make NRLMSISE00 Library](./General/HowToDownloadNRLMSISE00library.md)
- 3. [How to build with Visual Studio](./General/HowToCompileWithVisualStudio.md)
- 4. ~~[How to build with OSX](./General/HowToCompileWith_OSX.md)~~
- This configuration doesn't work now since the OSX doesn't support 32bit applications.
- Mac users can use Ubuntu in Docker.
- 5. [How to build with Ubuntu in Docker](./General/HowToCompileWithUbuntuInDocker.md) for **both Windows and Mac** users
- 6. How to build with other compilers will be written
-2. Tutorials
+
+2. Tutorials
+ - We strongly recommend to sequencially follow the all tutorials at first.
1. [Getting Started](./Tutorials/GettingStarted.md)
2. [How To Make New Simulation Scenario](./Tutorials/HowToMakeNewSimulationScenario.md)
3. [How To Add Components](./Tutorials/HowToAddComponents.md)
@@ -35,8 +43,10 @@
9. [How To Perform I2C HILS Test](./Tutorials/HowToPerformI2cHilsTest.md)
10. [How to simulate multiple satellites](./Tutorials/HowToSimulateMultipleSatellites.md)
11. TBW
+
3. Specifications
1. [Overall Structure](./Specifications/OverallStructure/OverallStructure.md)
+
1. Component
1. Abstract
1. [Component Base](./Specifications/Component/Abstract/Spec_ComponentBase.md)
@@ -54,6 +64,7 @@
7. Propulsion
1. [SimpleThruster](./Specifications/Component/Propulsion/Spec_SimpleThruster.md)
8. Thermal
+
2. Disturbance
1. [GeoPotential](./Specifications/Disturbance/Spec_GeoPotential.md)
2. [Gravity Gradient Torque](./Specifications/Disturbance/Spec_GGTorque.md)
@@ -62,6 +73,7 @@
1. [Air Drag](./Specifications/Disturbance/Spec_SurfaceForce_AirDrag.md)
2. [Solar Radiation Pressure](./Specifications/Disturbance/Spec_SurfaceForce_SolarRadiation.md)
5. [Third Body Gravity](./Specifications/Disturbance/Spec_ThirdBodyGravity.md)
+
3. Dynamics
1. Attitude
1. [Attitude Dynamics](./Specifications/Dynamics/Spec_AttitudeDynamics.md)
@@ -69,15 +81,20 @@
2. [Orbit](./Specifications/Dynamics/Spec_Orbit.md)
1. [Relative Orbit](./Specifications/Dynamics/Spec_RelativeOrbit.md)
3. Thermal
+
4. Environment
- 1. [SRP Environment](./Specifications/Environment/Spec_SRPEnvironment.md)
+ 1. [Solar Radiation Pressure Environment](./Specifications/Environment/Spec_SRPEnvironment.md)
2. [Atmosphere](./Specifications/Environment/Spec_Atmosphere.md)
3. [Magnetic Environment](./Specifications/Environment/Spec_MagEnvironment.md)
- 4. [Hipparcos Catalogue](./Specifications/Environment/Spec_HipparcosCatalogue_en.md) [(Japanese)](./Specifications/Environment/Spec_HipparcosCatalogue_ja.md)
- 5. [GNSS Satellites](./Specifications/Environment/Spec_GnssSatellites_en.md) [(Japanese)](./Specifications/Environment/Spec_GnssSatellites_ja.md)
+ 4. [Hipparcos Catalogue](./Specifications/Environment/Spec_HipparcosCatalogue_en.md), ([Japanese version](./Specifications/Environment/Spec_HipparcosCatalogue_ja.md))
+ 5. [GNSS Satellites](./Specifications/Environment/Spec_GnssSatellites_en.md), ([Japanese version](./Specifications/Environment/Spec_GnssSatellites_ja.md))
6. [Celestial Rotation](./Specifications/Environment/Spec_CelestialRotation.md)
+
5. Interface
1. [Power Port](./Specifications/Interface/Spec_PowerPort.md)
+
6. Library
+ - TBW
+
7. Simulation
1. [Monte Carlo Simulation](./Specifications/Simulation/Spec_MonteCarloSimulation.md)
diff --git a/Tutorials/GettingStarted.md b/Tutorials/GettingStarted.md
index 8687a115..9c003582 100644
--- a/Tutorials/GettingStarted.md
+++ b/Tutorials/GettingStarted.md
@@ -5,32 +5,31 @@
- This tutorial explains how to use the S2E simulator without any source code modification.
- Users can start this tutorial just after users clone the [s2e-core](https://github.com/ut-issl/s2e-core) repository.
- The supported version of this document
- - s2e-core: [v4.0](https://github.com/ut-issl/s2e-core/releases/tag/v4.0)
+ - Please confirm that the version of the documents and s2e-core is compatible.
+
## 2. Environment
-- This tutorial supports an execution environment with Visual Studio 2019 on a Windows PC.
+
+- This tutorial supports an execution environment with Visual Studio 2022 on a Windows PC.
- However, the basic features of S2E are executable for other environments with a small modification of the sequence.
- For example, users can find a document like [How to compile with Ubuntu](../General/HowToCompileWithUbuntuInDocker.md) in the General directory.
- The author hopes someone will write a new *Getting Started tutorial* for these environments.
-## 3. Clone & Compile
-1. Clone [s2e-core](https://github.com/ut-issl/s2e-core).
+
+## 3. Clone, Build, and Execute
+
+1. Clone [s2e-core](https://github.com/ut-issl/s2e-core).
2. Read `README.md` to check the overview of S2E.
-3. Execute `./scripts/VisualStudio/dowload_cspice_VS32bit.bat` to set up CSPICE library.
- - **Note:** The script is not completely automatic. Users need to input several simple words.
- - If you do not use Windows Visual Studio, or the script does not work well in your environment, please see [How to download CSPICE Library](../General/HowToDwnloadCSPCElibrary.md) and download the CSPICE files by yourself.
-4. Execute `./scripts/Common/download_nrlmsise00_src_and_table.sh` to download the atmosphere model table.
- - If you do not use Windows Visual Studio, or the script does not work well in your environment, please see [How to download and make NRLMSISE00 Library](../General/HowToDownloadNRLMSISE00library.md) and download the NRLMSISE00 files by yourself.
-4. Execute `./scripts/VisualStudio/make_nrlmsise00_VS32bit.bat` to generate library files for the atmosphere model.
-4. Build and execute the S2E_CORE by referring [How to compile with Visual Studio](../General/HowToCompileWithVisualStudio.md)
+3. Build and execute the `s2e-core` by referring [How to compile with Visual Studio](../General/HowToCompileWithVisualStudio.md)
+
## 4. Check log output
1. Check `./data/SampleSat/logs` to find CSV log output file
- The file name includes executed time as `YYMMDD_HHMMSS_default.csv`
-2. Open the CSV log file
-3. You can see the simulation output
-4. The meaning of each value is described in the first row
+2. Open the CSV log file
+3. You can see the simulation output
+4. The meaning of each value is described in the first row
- A general rule of the header descriptions
- `t` = true value
- `b` = body frame
@@ -40,63 +39,65 @@
## 5. Edit Simulation Conditions
-1. Move to `./data/SampleSat/ini` directory
-2. You can find the several **initialize** files. In these initialize files, simulation conditions are defined, and you can change the conditions without rebuild of S2E by editing the initialize files.
-3. Open `SampleSimBase.ini`, which is the base file of the initialize files.
- - In this base file, other initialize files are defined.
- - You can see simulation conditions as time definitions, randomize seed definitions, etc.
-4. Open `SampleSat.ini`, which is the file to set the spacecraft parameters.
-4. Edit the value of angular momentum `Omega_b(0-2)` in the `[Attitude]` section as you want.
-5. Rerun the S2E_CORE **without a rebuild**
-6. Check the new log file in `./data/SampleSat/logs` to confirm the initial angular velocity is changed as you want.
-7. Of course, you can change other values similarly.
+1. Move to `./data/SampleSat/ini` directory
+2. You can find the several **initialize** files (ini files). In these initialize files, simulation conditions are defined, and you can change the conditions without rebuild of S2E by editing the initialize files.
+3. Open `SampleSimBase.ini`, which is the base file of the initialize files.
+ - In this base file, other initialize files are defined.
+ - You can see simulation conditions as time definitions, randomize seed definitions, etc.
+4. Open `SampleSat.ini`, which is the file to set the spacecraft parameters.
+4. Edit the value of angular momentum `Omega_b(0-2)` in the `[Attitude]` section as you want.
+5. Rerun the `s2e-core` **without a rebuild**
+6. Check the new log file in `./data/SampleSat/logs` to confirm the initial angular velocity is changed as you want.
+7. Of course, you can change other values similarly.
## 6. Edit Simulation Conditions: Disturbances
-1. Move to `./data/SampleSat/ini` directory
-2. Open `SampleDisturbance.ini`, which defines conditions to calculate orbital disturbance torques and forces
- - Currently, S2E supports the following disturbances:
- - Gravity Gradient torque
- - Magnetic Disturbance torque
- - Air drag torque and force
- - Solar radiation pressure torque and force
- - Geo Potential acceleration
- - Third body gravity acceleration
-3. You can select `ENABLE` or `DISABLE` of calculation and log output for each disturbance
-4. Edit all `calculation` parameters of each disturbance as `calculation = DISABLE`
-5. Rerun the S2E_CORE **without a rebuild**
-6. Check the new log file in `./data/SampleSat/logs` to confirm the spacecraft is not affected by any disturbance torque and the angular velocity and quaternion are not changed.
-7. Edit `calculation` of MAG_DISTURBANCE as `calculation = ENABLE`
-8. Rerun the S2E_CORE **without a rebuild**
-9. Edit the value `rmm_const_b(0-2)` of MAG_DISTURBANCE as you want (e.g., 0.1)
-10. Rerun the S2E_CORE **without a rebuild**
-11. Compare the value of `mag_dist_torque_b(X),(Y),(Z)` in the latest log file and previous log file to confirm the magnetic disturbance acting on the spacecraft is changed.
-12. Of course, you can change other values similarly.
- - Detail description of initializing values are written in `Specifications`.
+1. Move to `./data/SampleSat/ini` directory again
+2. Open `SampleDisturbance.ini`, which defines conditions to calculate orbital disturbance torques and forces
+ - Currently, S2E supports the following disturbances:
+ - Gravity Gradient torque
+ - Magnetic Disturbance torque
+ - Air drag torque and force
+ - Solar radiation pressure torque and force
+ - Geo Potential acceleration
+ - Third body gravity acceleration
+3. You can select `ENABLE` or `DISABLE` of calculation and log output for each disturbance
+4. Edit all `calculation` parameters of each disturbance as `calculation = DISABLE`
+5. Rerun the `s2e-core` **without a rebuild**
+6. Check the new log file in `./data/SampleSat/logs` to confirm the spacecraft is not affected by any disturbance torque and the angular velocity and quaternion are not changed.
+7. Edit `calculation` of MAG_DISTURBANCE as `calculation = ENABLE`
+8. Rerun the S2E_CORE **without a rebuild**
+9. Edit the value `rmm_const_b(0-2)` of MAG_DISTURBANCE as you want (e.g., 0.1)
+10. Rerun the S2E_CORE **without a rebuild**
+11. Compare the value of `mag_dist_torque_b(X),(Y),(Z)` in the latest log file and previous log file to confirm the magnetic disturbance acting on the spacecraft is changed.
+12. Of course, you can change other values similarly.
+ - Detail description of initializing values are written in `Specifications`.
+
## 7. Edit Simulation Conditions: Orbit
-1. Move to `./data/SampleSat/ini` directory
-2. Open `SampleSat.ini` and see the `[Orbit]` section, which defines conditions to calculate orbit motion
- - Currently, S2E supports two types of orbit propagation:
- - SGP4 propagation with TLE
- - RK4 propagation with initial position and velocity
-3. The default setting is as follows:
- - `propagate_mode = 1`: SGP4 Propagator is selected
- - TLE: ISS orbit
-4. Change TLE as you want
-5. Rerun the S2E_CORE **without a rebuild**
-6. Check the new log file in `./data/SampleSat/logs` to confirm the spacecraft position in ECI frame `sat_position_i` and spacecraft position in ECEF frame `lat, lon, alt` are changed.
+1. Move to `./data/SampleSat/ini` directory
+2. Open `SampleSat.ini` and see the `[Orbit]` section, which defines conditions to calculate orbit motion
+ - Currently, S2E supports two types of orbit propagation:
+ - SGP4 propagation with TLE
+ - RK4 propagation with initial position and velocity
+3. The default setting is as follows:
+ - `propagate_mode = SGP4`: SGP4 Propagator is selected
+ - TLE: ISS orbit
+4. Change TLE as you want
+5. Rerun the `s2e-core` **without a rebuild**
+6. Check the new log file in `./data/SampleSat/logs` to confirm the spacecraft position in ECI frame `sat_position_i` and spacecraft position in ECEF frame `lat, lon, alt` are changed.
+
## 8. Edit Simulation Conditions: Environment
-1. Move to `./data/SampleSat/ini` directory
-2. Open `SampleLocalEnvironment.ini`, which defines conditions to calculate the environment around the spacecraft
- - Currently, S2E supports the following environment models:
- - Celestial information: CSPICE
- - Geomagnetic field model: IGRF with random variation
- - Solar power model: Considering solar distance and eclipse
- - Air density: NRLMSISE-00 model with random variation
-3. Edit values of `mag_rwdev, mag_rwlimit, mag_wnvar`
-4. Rerun the S2E_CORE **without a rebuild**
-5. Check the new log file in `./data/SampleSat/logs` to confirm the magnetic field at the spacecraft position in ECI frame `mag_i`, the magnetic field in body frame `mag_b`, and magnetic disturbance torque in body frame `mag_dist_torque_b` are changed.
+1. Move to `./data/SampleSat/ini` directory
+2. Open `SampleLocalEnvironment.ini`, which defines conditions to calculate the environment around the spacecraft
+ - Currently, S2E supports the following environment models:
+ - Celestial information: CSPICE
+ - Geomagnetic field model: IGRF with random variation
+ - Solar power model: Considering solar distance and eclipse
+ - Air density: NRLMSISE-00 model with random variation
+3. Edit values of `mag_rwdev, mag_rwlimit, mag_wnvar`
+4. Rerun the `s2e-core` **without a rebuild**
+5. Check the new log file in `./data/SampleSat/logs` to confirm the magnetic field at the spacecraft position in ECI frame `mag_i`, the magnetic field in body frame `mag_b`, and magnetic disturbance torque in body frame `mag_dist_torque_b` are changed.
diff --git a/Tutorials/HowToAddComponents.md b/Tutorials/HowToAddComponents.md
index 18d5f657..131f447d 100644
--- a/Tutorials/HowToAddComponents.md
+++ b/Tutorials/HowToAddComponents.md
@@ -2,75 +2,66 @@
## 1. Overview
-- In the [How To Make New Simulation Scenario](./HowToMakeNewSimulationScenario.md) tutorial, we have made an `S2E_USER` directory for our simulation scenario.
+- In the [How To Make New Simulation Scenario](./HowToMakeNewSimulationScenario.md) tutorial, we have made an `s2e-user` directory for our simulation scenario.
- This tutorial explains how to add components to your scenario.
-- A similar procedure is available for other components in the `S2E_CORE`.
-- The Supported version of this document
- - s2e-core: [v4.0](https://github.com/ut-issl/s2e-core/releases/tag/v4.0)
+- A similar procedure is available for other components in the `s2e-core`.
+- The supported version of this document
+ - Please confirm that the version of the documents and s2e-core is compatible.
-## 2. Add a Gyro sensor
-
-- This chapter explains how to add a gyro component to your `S2E_USER` simulation case.
-
-1. Open `User_Components.h`
-
-2. Add the following descriptions at the one line below of `#include "OBC.h"`
-
- ```c++
- #include "Gyro.h"
- ```
-
-3. Add the following descriptions at the one line below of `OBC* obc_;`
-
- ```c++
- Gyro* gyro_;
- ```
-
-4. Open `User_Components.cpp`
-
-5. Edit the constructor function as follows to create an instance of the GYRO class
-
- ``` c++
- {
- IniAccess iniAccess = IniAccess(config->sat_file_[0]);
- double compo_step_sec = glo_env_->GetSimTime().GetCompoStepSec();
-
- obc_ = new OBC(clock_gen);
- std::string gyro_ini_path = iniAccess.ReadString("COMPONENTS_FILE", "gyro_file");
- gyro_ = new Gyro(InitGyro(clock_gen, 1, gyro_ini_path, compo_step_sec, dynamics));
- }
- ```
-6. Add the following descriptions at the one line up of `delete obc_;` in the destructor.
-
- ```c++
- delete gyro_;
- ```
+## 2. Add a Gyro sensor
-7. Edit the `CompoLogSetUp` function as follows to register log output
-
- ``` c++
- void UserComponents::CompoLogSetUp(Logger & logger)
- {
- logger.AddLoggable(gyro_);
- }
- ```
+- This chapter explains how to add a gyro component to your `s2e-user` simulation case.
+
+1. Open & edit `UserComponents.hpp`
+ - Add the following descriptions at the one line below of `#include "OBC.h"`
+ ```c++
+ #include "InitGyro.hpp"
+ ```
+ - Add the following descriptions at the one line below of `OBC* obc_;`
+ ```c++
+ Gyro* gyro_;
+ ```
+
+4. Open and edit `UserComponents.cpp`
+ - Edit the constructor function as follows to create an instance of the `GYRO` class at the one line below of `obc_ = new OBC(clock_gen);`.
+ ``` c++
+ // Initialize of GYRO class
+ IniAccess iniAccess = IniAccess(config->sat_file_[0]);
+ const double compo_step_sec = glo_env_->GetSimTime().GetCompoStepSec();
+ std::string gyro_ini_path = iniAccess.ReadString("COMPONENTS_FILE", "gyro_file");
+ gyro_ = new Gyro(InitGyro(clock_gen, 1, gyro_ini_path, compo_step_sec, dynamics));
+ ```
+
+ - Add the following descriptions at the one line up of `delete obc_;` in the destructor.
+ ```c++
+ delete gyro_;
+ ```
+
+ - Edit the `CompoLogSetUp` function as follows to register log output
+ ``` c++
+ void UserComponents::LogSetup(Logger & logger)
+ {
+ logger.AddLoggable(gyro_);
+ }
+ ```
8. Open `UserSat.ini` and edit `omega_b` to add initial angular velocity.
+ - Users can select any value.
9. Add the following descriptions at the bottom line of `[COMPONENTS_FILE]` to set the initialize file for the gyro sensor.
```c++
- gyro_file = ../../data/ini/components/Gyro_xxx.ini
+ gyro_file = ../../data/ini/components/GyroXxx.ini
```
-10. Compile the `S2E_USER` and execute it
+10. Build the `s2e-user` and execute it
11. Check the log output file to find `gyro_omega1_c`, the gyro sensor's output angular velocity value in the component frame.
- Since the default initializing file is described as that the sensor has no noise, the value of `gyro_omega1_c` and `omega_t_b` is completely the same.
-12. Edit the `data/ini/components/Gyro_xxx.ini` file to add several noises, and rerun the `S2E_USER`
+12. Edit the `data/ini/components/GyroXxx.ini` file to add several noises, and rerun the `s2e-user`
13. Check the log output file to find `gyro_omega1_c`. Now the sensor output has several errors you set in the initialize file like the following figure.
@@ -80,9 +71,9 @@
## 3. Add another Gyro sensor
-- You can add multiple components in your `S2E_USER` simulation case similar to the above sequence.
+- You can add multiple components in your `s2e-user` simulation case similar to the above sequence.
-1. Open `User_Components.h`
+1. Open `UserComponents.hpp`
2. Add the following descriptions at the one line below of `GYRO* gyro_;`
@@ -90,23 +81,14 @@
Gyro* gyro2_;
```
-3. Open `User_Components.cpp`
-
-4. Edit the constructor function as follows to create an instance of the GYRO class
+3. Open `UserComponents.cpp`
- ``` c++
- {
- IniAccess iniAccess = IniAccess(config->sat_file_[0]);
- double compo_step_sec = glo_env_->GetSimTime().GetCompoStepSec();
+4. Edit the constructor function to add the following description to create the second instance of the GYRO class
- obc_ = new OBC(clock_gen);
- std::string gyro_ini_path = iniAccess.ReadString("COMPONENTS_FILE", "gyro_file");
- gyro_ = new Gyro(InitGyro(clock_gen, 1, gyro_ini_path, compo_step_sec, dynamics));
-
- std::string gyro_ini_path_2 = iniAccess.ReadString("COMPONENTS_FILE", "gyro_file_2");
- gyro2_ = new Gyro(InitGyro(clock_gen, 2, gyro_ini_path_2, compo_step_sec, dynamics));
- }
- ```
+ ``` c++
+ std::string gyro_ini_path_2 = iniAccess.ReadString("COMPONENTS_FILE", "gyro_file_2");
+ gyro2_ = new Gyro(InitGyro(clock_gen, 2, gyro_ini_path_2, compo_step_sec, dynamics));
+ ```
5. Add the following descriptions at the one line below of `delete gyro_;` in the destructor
@@ -129,13 +111,13 @@
8. Add the following descriptions at the bottom line of `[COMPONENTS_FILE]` to set the initialize file for the gyro sensor
```c++
- gyro_file_2 = ../../data/ini/components/Gyro_yyy.ini
+ gyro_file_2 = ../../data/ini/components/GyroYyy.ini
```
-9. Copy the `data/ini/components/Gyro_xxx.ini` file and rename it as `Gyro_yyy.ini`
+9. Copy the `data/ini/components/GyroXxx.ini` file and rename it as `GyroYyy.ini`
-10. Edit `Gyro_yyy.ini` to custom the noise performance of the second gyro sensor
+10. Edit `GyroYyy.ini` to custom the noise performance of the second gyro sensor
-11. Compile the `S2E_USER` and execute it
+11. Build the `s2e-user` and execute it
12. Check the log output file to find `gyro_omega2_c`, the second gyro sensor's output angular velocity value in the component frame.
diff --git a/Tutorials/HowToAddControlAlgorithms.md b/Tutorials/HowToAddControlAlgorithms.md
index 0da7bee7..35a1c50a 100644
--- a/Tutorials/HowToAddControlAlgorithms.md
+++ b/Tutorials/HowToAddControlAlgorithms.md
@@ -12,19 +12,18 @@
- For engineering researches and preliminary analysis for satellite projects
- FlightSW: Control using sensors and actuators with flight S/W framework
- For actual satellite projects
-- The Supported version of this document
- - s2e-core: [v4.0](https://github.com/ut-issl/s2e-core/releases/tag/v4.0)
+- The supported version of this document
+ - Please confirm that the version of the documents and s2e-core is compatible.
## 2. Direct method
- This chapter introduces the simplest way to add a control algorithm without sensors and actuators.
- This method directly measures the satellite's physical quantity and generates torque and force acting on the satellite.
- To do that, users need to edit the `Update` function in the `UserSat.cpp`.
+ - A sample code is in `./Tutorials/SampleCodes/ControlAlgorithm/DirectMethod/UserSat.cpp`
- The `UserSat` class already has satellite attitude, orbit, and local environment information since it inherits the `Spacecraft` base class. So users can easily access these values.
- To measure physical quantities, users can use getter functions defined in the `Attitude`, `Orbit`, and `LocalEnvironment` classes as `dynamics_->GetAttitude().GetOmega_b()`.
- To generate torque and force, users can use `dynamics_->AddTorque_b` and `dynamics_->AddForce_b`.
-- The sample codes are in `SampleCodes/ControlAlgorithm/DirectMethod/`, and you can see very simple detumbling with the proportional control method.
-- To use the sample code, you need to copy the `User_sat_with_control.cpp` and build it instead of `User_sat.cpp`.
- - You need to edit `CMakeLists.txt` to add the copied `User_sat_with_control.cpp` to the `SOURCE_FILES` instead of the `User_sat.cpp`.
+- The sample codes are in `SampleCodes/ControlAlgorithm/DirectMethod/UserSat.cpp`, and you can see very simple detumbling with the proportional control method.
- By using the sample code with initial angular velocity = [0.05, -0.03, 0.01] rad/s, the following results are given.
- You need to edit the initialize file to set the initial angular velocity.
@@ -39,11 +38,11 @@
- This method measures a satellite's physical quantity via sensors, generates torque and force via actuators, and executes control algorithms on OBC.
- This tutorial assumes the spacecraft has a three-axis gyro sensor, a reaction wheel, and an OBC.
- The sample codes are in `SampleCodes/ControlAlgorithm/ComponentMethod/`
-- Firstly, users need to make the `User_OBC` class to emulate the OBC.
- - Copy the `User_OBC` files to the `S2E_USER/src/Components` from the `ComponentMethod/src/Components`, and add the `User_OBC.cpp` to the `set(SOURCE_FILES)` in the `CMakeLists.txt` to compile it.
- - The `User_OBC` class has the `UserComponent` class as a member, and users can access all components to get sensing information or set the output of actuators.
+- Firstly, users need to make the `UserOBC` class to emulate the OBC.
+ - Copy the `UserObc` files to the `s2e-user/src/Components` from the `ComponentMethod/src/Components`, and add the `UserObc.cpp` to the `set(SOURCE_FILES)` in the `CMakeLists.txt` to compile it.
+ - The `UserOBC` class has the `UserComponent` class as a member, and users can access all components to get sensing information or set the output of actuators.
- In this tutorial, the angular velocity is measured by the gyro sensor. RW's output torque is calculated using the X-axis of the measured angular velocity, and the torque is set to RW.
-- Next, users need to add the `User_OBC` into the `User_Component` class. You can copy the `User_Components` files to the `S2E_USER/src/Simulation/Spacecraft` from the `ComponentMethod/src/Simulation`.
+- Next, users need to add the `UserObc` into the `UserComponent` class. You can copy the `UserComponents` files to the `s2e-user/src/Simulation/Spacecraft` from the `ComponentMethod/src/Simulation`.
- Finally, users need to add new source codes to the `CMakeLists.txt` to compile them.
- By using the sample code, the following results are given.
- The X-axis angular velocity is controlled, but other axes are not controlled well since the satellite only has an RW on X-axis. The X-axis angular velocity has offset value since the gyro has offset noise.
diff --git a/Tutorials/HowToIntegrateC2A.md b/Tutorials/HowToIntegrateC2A.md
index e774a2d9..f84fd280 100644
--- a/Tutorials/HowToIntegrateC2A.md
+++ b/Tutorials/HowToIntegrateC2A.md
@@ -14,7 +14,8 @@
- Please set the environment for that the s2e-core can work without C2A.
- Clone the sample codes in the `FlightSW` directory.
- Execute `c2a-core/setup.sh` or `c2a-core/setup.bat`.
-
+- The supported version of this document
+ - Please confirm that the version of the documents and s2e-core is compatible.
## 2. How to build C2A in S2E
- When users want to use C2A, complete the following steps
diff --git a/Tutorials/HowToMakeNewComponents.md b/Tutorials/HowToMakeNewComponents.md
index 1937d583..d9f687bd 100644
--- a/Tutorials/HowToMakeNewComponents.md
+++ b/Tutorials/HowToMakeNewComponents.md
@@ -3,14 +3,15 @@
## 1. Overview
- In the [How To Add Components](./HowToAddComponents.md) tutorial, we have added existing components to the simulation scenario.
-- This tutorial explains how to make a new component into the S2E_USER directory.
-- **Note**: You can move the source files for the new component into the [s2e-core](https://github.com/ut-issl/s2e-core) repository if the component is useful for all S2E users.
-- The Supported version of this document
- - s2e-core: [v4.0](https://github.com/ut-issl/s2e-core/releases/tag/v4.0)
+- This tutorial explains how to make a new component into the s2e-user directory.
+ - **Note**: You can move the source files for the new component into the [s2e-core](https://github.com/ut-issl/s2e-core) repository if the component is useful for all S2E users.
+- The supported version of this document
+ - Please confirm that the version of the documents and s2e-core is compatible.
+
## 2. Overview of S2E/Components
-- Source codes emulating components are stored in the `S2E_CORE_OSS/src/Component` directory.
+- Source codes emulating components are stored in the `s2e-core/src/Component` directory.
- All components need to inherit the base class `ComponentBase` for general functions of components, and most of the components also inherit the base class `ILoggable` for the log output function.
- `ComponentBase` class
- The base class has an important virtual function `MainRoutine`, and subclasses need to define it in their codes.
@@ -21,28 +22,34 @@
- `ILoggable` class
- This base class has two important virtual functions `GetLogHeader` and `GetLogValue`, for CSV log output.
- These functions are registered into the log output list when the components are added in `UserComponents::CompoLogSetUp`
+- Communication with OBC
+ - If users want to emulate the communication(telemetry and command) between the components and the OBC, they can use the base class `ObcCommunicationBase` or `ObcI2cTargetCommunicationBase`.
+ - These base classes also support a feature to execute HILS function.
+
## 3. Make a simple clock sensor
- This chapter explains how to make a simple clock sensor, which observes the simulation elapsed time with a bias noise.
-1. Copy `ClockSensor.cpp` and `ClockSensor.h` to the directory `S2E_USER/src/Components` from `Documents_OSS/Tutorials/SampleCode/ClockSensor`
+1. Copy the following files in the directory `./Tutorials/SampleCode/ClockSensor` to the directory `s2e-user/src/Components`.
+ - `ClockSensor.cpp`
+ - `ClockSensor.hpp`
-2. Edit `./S2E_USER/CMakeList.txt` to add target source files for the compiler. Please add the following description in `set(SOURCE_FILES)`
+2. Edit `./s2e-user/CMakeList.txt` to add target source files for the compiler. Please add the following description in `set(SOURCE_FILES)`
```
src/Components/ClockSensor.cpp
```
-3. Build `S2E_USER` and check there is no error.
+3. Build `s2e-user` and check there is no error.
-4. Edit `User_component.h` and `User_component.cpp` as referring [How To Add Components](./HowToAddComponents.md)
+4. Edit `UserComponent.hpp` and `UserComponent.cpp` as referring [How To Add Components](./HowToAddComponents.md)
- The constructor of the `ClockSensor` requires arguments as `prescaler`, `clock_gen`, `sim_time`, and `bias_sec`.
- - `prescaler` and `bias_sec` are user setting parameters for the sensor, and you can set these value.
+ - `prescaler` and `bias_sec` are user setting parameters for the sensor, and you can set these values.
- `clock_gen` is an argument for the `ComponentBase` class.
- `sim_time` is a specific argument for the clock sensor to get time information. `SimTime` class is managed in the `GlobalEnvironment`, and the `GlobalEnvironment` is instantiated in the `SimulationCase` class.
- - You need to edit the `User_Components.cpp` as follows.
+ - You need to edit the `UserComponents.cpp` as follows.
- Instantiate the `ClockSensor` in the constructor.
```c++
clock_sensor_ = new ClockSensor(10,clock_gen,&glo_env->GetSimTime(),0.001);
@@ -56,31 +63,37 @@
logger.AddLoggable(clock_sensor_);
```
-5. Build `S2E_USER` and execute it
+5. Build `s2e-user` and execute it
6. Check the log file to confirm the output of the `clock_sensor`
- The output of the clock sensor has an offset error, and the update frequency is decided by the `prescaler` and the `CompoUpdateIntervalSec` in the base ini file.
## 4. Make an initialize file for the clock sensor
-- Usually, we want to change the parameters of components without rebuild such as noise properties, mounting coordinates, and so on. So in the next step, we explain how to make an initialize file for the `ClockSensor`.
+- Usually, we want to change the parameters of components without rebuilding such as noise properties, mounting coordinates, and so on. So this section explains how to make an initialize file for the `ClockSensor`.
-1. Copy `Init_ClockSensor.cpp` and `Initialize_UserComponent.h` into `S2E_USER/src/Components` from `Tutorial/SampleCodes/ClockSensor`
+1. Copy the following files in the directory `./Tutorials/SampleCode/ClockSensor` to the directory `s2e-user/src/Components`.
+ - `InitClockSensor.cpp`
+ - `InitClockSensor.hpp`
-2. Edit `./S2E_USER/CMakeList.txt` to add target source files for the compiler. Please add the following description in `set(SOURCE_FILES)`
+2. Edit `./s2e-user/CMakeList.txt` to add target source files for the compiler. Please add the following description in `set(SOURCE_FILES)`
```
- src/Components/Init_ClockSensor.cpp
+ src/Components/InitClockSensor.cpp
```
-4. Edit the constructor of the `User_components.cpp` as follows
-
- ```c++
- std::string clock_sensor_ini_path = iniAccess.ReadString("COMPONENTS_FILE", "clock_sensor_file");
- clock_sensor_ = new ClockSensor(InitClockSensor(clock_gen, glo_env->GetSimTime(), clock_sensor_ini_path));
- ```
+4. Edit the `UserComponents.cpp` as follows
+ - Add include files
+ ```c++
+ #include "../../Components/InitClockSensor.hpp"
+ ```
+ - Edit making instance of the `ClockSensor` at the constructor
+ ```c++
+ std::string clock_sensor_ini_path = iniAccess.ReadString("COMPONENTS_FILE", "clock_sensor_file");
+ clock_sensor_ = new ClockSensor(InitClockSensor(clock_gen, glo_env->GetSimTime(), clock_sensor_ini_path));
+ ```
-6. Copy `ClockSensor.ini` into `S2E_USER/data/ini/components` from `Tutorial/SampleCodes/ClockSensor`
+6. Copy `ClockSensor.ini` into `s2e-user/data/ini/components` from `./Tutorial/SampleCodes/ClockSensor`
7. Edit `UserSat.ini` to add the following line at the [COMPONENTS_FILE] section of the file
@@ -88,8 +101,8 @@
clock_sensor_file = ../../data/ini/components/ClockSensor.ini
```
-8. Build `S2E_USER` and execute it
+8. Build `s2e-user` and execute it
9. Check the log file
-10. Edit the `ClockSensor.ini` and rerun the `S2E_USER` to confirm the initialize file can affect the result.
+10. Edit the `ClockSensor.ini` and rerun the `s2e-user` to confirm the initialize file can affect the result.
diff --git a/Tutorials/HowToMakeNewSimulationScenario.md b/Tutorials/HowToMakeNewSimulationScenario.md
index 798fb368..ee0fc4b2 100644
--- a/Tutorials/HowToMakeNewSimulationScenario.md
+++ b/Tutorials/HowToMakeNewSimulationScenario.md
@@ -2,55 +2,59 @@
## 1. Overview
-- In the [Getting Started](./GettingStarted.md) tutorial, we can directly build and execute S2E_CORE_OSS, but for **source code sharing** and practical usage of S2E, we **strongly recommend managing S2E_CORE_OSS 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 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 `simulation scenario` and the `main`
- - Source codes for `components` if you have components, which strongly depends on your project.
+- 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`
+ - 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](https://cmake.org/), [Visual Studio Solution files](https://visualstudio.microsoft.com/downloads/), and others.
-- This tutorial explains an example of how to make S2E_USER repository and execute it.
+ - 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
- - s2e-core: [v4.0](https://github.com/ut-issl/s2e-core/releases/tag/v4.0)
+ - Please confirm that the version of the documents and s2e-core is compatible.
+
## 2. Setup S2E_CORE
-1. Clone [s2e-core](https://github.com/ut-issl/s2e-core) repository in the same directory with `s2e_user`.
+1. Clone [s2e-core](https://github.com/ut-issl/s2e-core) repository in a working directory.
+
+2. Download mandatory `ExtLibraries` (CSPICE and NRLMSISE-00).
+ - Please see a `How To Compile` document suit wity your platform.
+ ```
+ └─s2e-core
+ └─ExtLibraries
+ └─ cspice
+ └─ nrlmsise00
+ ```
-2. Execute script files to set up CSPICE and NRLMSISE-00 library.
- ```
- └─s2e-core
- └─ExtLibraries
- └─ cspice
- └─ nrlmsise00
- ```
-## 3. Setup & Compile S2E_USER
+## 3. Setup & Compile s2e-user
-1. Make a new directory `s2e_user`. It will be a root directory of S2E_USER
- ```
- └─s2e_user
- └─s2e-core
- └─ExtLibraries
- ```
+1. Make a new directory `s2e-user`. It will be a root directory of s2e-user.
+ ```
+ └─s2e-user
+ └─s2e-core
+ └─ExtLibraries
+ ```
-2. Copy directories and files in `s2e_user` directory in the `./Tutorials/SampleCodes/`
+2. Copy directories and files in the `./Tutorials/SampleCodes/s2e-user`.
-3. According to the [How to compile with Visual Studio](../General/HowToCompileWithVisualStudio.md), open the `s2e_user/CMakeList.txt` and compile the S2E_USER
- - You can also build it with Ubuntu in Docker. Please check [How to compile with Ubuntu in Docker](../General/HowToCompileWithUbuntuInDocker.md)
+3. According to the `How to compile` document, open the `s2e-user/CMakeList.txt` and build the s2e-user.
-4. Execute and check the `s2e_user/data/logs`
+4. Execute and check the `s2e-user/data/logs`.
-5. Similar to [Getting Started](./GettingStarted.md), you can edit initialize files and check the log file
+5. Similar to [Getting Started](./GettingStarted.md), you can edit initialize files and check the log file .
**Note:** You 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
-- This chapter explains the overview of `s2e_user` in the `SampleCodes` directory.
+- This chapter explains the overview of `s2e-user` in the `SampleCodes` directory.
- The files in the directory are as follows. From here, the detail of each file is described.
```
- └─s2e_user
+ └─s2e-user
└─CMakeLists.txt
└─CMakeSetting.json
└─data
@@ -60,38 +64,38 @@
└─src
└─Simulation
└─Case
- └─User_case.cpp
- └─User_case.h
+ └─UserCase.cpp
+ └─UserCase.h
└─Spacecraft
- └─User_Components.cpp
- └─User_Components.h
- └─User_sat.cpp
- └─User_sat.h
- └─S2E_USER.cpp
+ └─UserComponents.cpp
+ └─UserComponents.h
+ └─UserSat.cpp
+ └─UserSat.h
+ └─S2eUser.cpp
```
-1. `CMakeLists.txt ` and `CMakeSetting.json `
- - `CMakeLists.txt ` is a [CMake file](https://cmake.org/) for a compile setting.
+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.
- Of course, when you add new source files, you have to edit the CMake file to compile them.
- `CMakeSetting.json ` is a compile setting file for Visual Studio.
2. `data/ini` and `data/logs`
- In the `ini` directory, there are several initialize files.
- - The most important initialize file is `User_SimBase.ini`.
+ - The most important initialize file is `UserSimBase.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 `S2eUser.cpp`.
- Details of the initialize files are described in `Specifications`.
- Basic files are described in [Getting Started](./GettingStarted.md).
- `logs`
- - CSV log files will be outputted here. The output directory is also defined in `User_SimBase.ini`, so that you can change it.
-3. `src/S2E_USER.cpp`
+ - CSV log files will be outputted here. The output directory is also defined in `UserSimBase.ini`, so that you can change it.
+3. `src/S2eUser.cpp`
- This is the main file of this program.
- - In this code, `User_SimBase.ini` is defined as the base file for the simulation, and an instance of the `simulation case class` named `UserCase` is created and initialized. And finally, the main routine of the class is executed.
-4. `src/Simulation/Case`
- - `UserCase` class is defined here. `UserCase` class inherits the `SimulationCase` base class in the `S2E_CORE`. The `SimulationCase` class has a `SimulationConfig` and `GlobalEnvironment` class. The `UserCase` class has an instance of the `spacecraft` class named as `UserSat`.
+ - In this code, `UserSimBase.ini` is defined as the base file for the simulation, and an instance of the `simulation case class` named `UserCase` is created and initialized. And finally, the main routine of the class is executed.
+4. `src/Simulation/Case`
+ - `UserCase` class is defined here. `UserCase` class inherits the `SimulationCase` base class in the `s2e-core`. The `SimulationCase` class has a `SimulationConfig` and `GlobalEnvironment` class. The `UserCase` class has an instance of the `spacecraft` class named as `UserSat`.
5. `src/Simulation/Spacecraft/User_sat.cpp `
- - `UserSat` class is defined here. `UserSat` class inherits the `Spacecraft` class in the `S2E_CORE`. The `Spacecraft` base class has instances of `Dynamics`, `LocalEnvironment`, `Disturbance`, and `Structure`. And the `UserSat` class has an instance of `UserComponents`.
+ - `UserSat` class is defined here. `UserSat` class inherits the `Spacecraft` class in the `s2e-core`. The `Spacecraft` base class has instances of `Dynamics`, `LocalEnvironment`, `Disturbance`, and `Structure`. And the `UserSat` class has an instance of `UserComponents`.
- In the `UserSat`'s `Update` function, these four classes are updated to simulate the spacecraft behavior.
-6. `src/Simulation/Spacecraft/User_Components.cpp`
+6. `src/Simulation/Spacecraft/UserComponents.cpp`
- 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/Component`.
- - You can add new source codes in the `S2E_USER/Component` directory if you want to make original components.
+ - You can add new source codes in the `s2e-user/Component` directory if you want to make original components.
diff --git a/Tutorials/HowToSimulateMultipleSatellites.md b/Tutorials/HowToSimulateMultipleSatellites.md
index 3743a6a6..2295ebb8 100644
--- a/Tutorials/HowToSimulateMultipleSatellites.md
+++ b/Tutorials/HowToSimulateMultipleSatellites.md
@@ -3,43 +3,40 @@
## 1. Overview
- S2E can simulate multiple satellites.
- This document describes how to simulate multiple satellites.
-- The features of multiple satellite simulation are:
- + Relative dynamics information is logged automatically
- + Intersat communication can be used
- + Orbits can be propagated using relative dynamics theory.
-- You can find sample codes for this tutorial in [S2E_FF](https://gitlab.com/ut_issl/s2e/s2e_ff) repository.
-
+- For the sample codes, please see `./Tutorials/SampleCodes/MultipleSatellites`
+- The supported version of this document
+ - Please confirm that the version of the documents and s2e-core is compatible.
+
+
## 2. How to add a new satellite
1. Edit `ini` files
- 1. Add `ini` files for the new satellite.
- - `Sat.ini`, `Disturbance.ini`, `LocalEnvironment.ini`, `Structure.ini` are needed.
- 2. Register the ini file for the new satellite in `Simbase.ini`
- - The arguments of `sat_file` are used as satellite ID in simulation.
-
+ 1. Add `ini` files for the new satellite.
+ - `Sat.ini`, `Disturbance.ini`, `LocalEnvironment.ini`, `Structure.ini` are needed.
+ 2. Register the ini file for the new satellite in `Simbase.ini`
+ - The arguments of `sat_file` are used as satellite ID in simulation.
```
[SIM_SETTING]
- sat_file(0) = ../../data/ini/Sat0.ini
- sat_file(1) = ../../data/ini/Sat1.ini
+ num_of_simulated_spacecraft = 2
+ sat_file(0) = ../../data/ini/UserSat1.ini
+ sat_file(1) = ../../data/ini/UserSat2.ini
```
2. Edit source code
- 1. Add `Satellite`, `RelativeInformation`, `InterSatComm` instances to `Case` members.
-
-
-
+ 1. Add new `Satellite` instances to `Case` members in `UserCase.hpp`.
+ ```c++
+ UserSat* spacecraft0_;
+ UserSat* spacecraft1_;
+ ```
+
+ 2. Edit `UserCase.cpp` to copy the spacecraft related codes as the sample code.
+
+3. Build and execute the `s2e-user`
- 2. Edit constructor and destructor of `Case`.
-
-
-
+4. You can see the log `omega_true_b(X)[rad/s]` twice. The first one is angular velocity of `spacecraft0_`, and the socond one is angular velocity of `spacecraft1_` in the log file.
- 3. Instantiate the spacecraft and set up logs for `spacecraft`s, `rel_info`.
- - NOTE: Do not forget to include `rel_info` and `inter_sat_comm` in the argument of the satellite constructor. (The constructor that does not need `rel_info` and `inter_sat_comm` is used for single satellite simulation.)
-
-
-
- 4. Add Spacecraft update function into the main function in `Case.cpp`.
-
-
-
+## 3. Advanced usage
+- In the sample, the `spacecraft0_` and the `spacecraft1_` are completely same, but users can change the setting of these satellites with editing the `ini` files.
+ - Users can change the orbit, initial attitude, and so on.
+- Users also can set the different component for the spacecraft-0 and -1, when users define different `UserSat` and `UserComponents` class.
+- The document to use `relative information` will be written.
diff --git a/Tutorials/HowToUseMonteCarloSimulation.md b/Tutorials/HowToUseMonteCarloSimulation.md
index c565ae15..e386fe1a 100644
--- a/Tutorials/HowToUseMonteCarloSimulation.md
+++ b/Tutorials/HowToUseMonteCarloSimulation.md
@@ -8,8 +8,8 @@
- Please see the specification document for [MCSim](../Specifications/Simulation/Spec_MonteCarloSimulation.md) for a detailed description.
- This tutorial explains how to randomly change the initial value of the angular velocity.
- There are sample codes in `SampleCodes\MCSim`.
-- The Supported version of this document
- - s2e-core: [v4.0](https://github.com/ut-issl/s2e-core/releases/tag/v4.0)
+- The supported version of this document
+ - Please confirm that the version of the documents and s2e-core is compatible.
## 2. Edit Simulation Case
- To use the MCSim, users have to edit their `User_case.h` and `User_case.cpp`
@@ -66,7 +66,7 @@
std::string str_tmp = "";
str_tmp += WriteScalar("time", "s");
str_tmp += WriteVector("Omega", "b", "rad/s", 3);
- str_tmp += WriteVector("quat", "i2b", "-", 4);
+ str_tmp += WriteVector("Quaternion", "i2b", "-", 4);
return str_tmp;
}
std::string UserCase::GetLogValue() const
diff --git a/Tutorials/SampleCodes/C2A_Integration/C2A_src_user/Applications/CMakeLists.txt b/Tutorials/SampleCodes/C2A_Integration/C2A_src_user/Applications/CMakeLists.txt
deleted file mode 100644
index 00296618..00000000
--- a/Tutorials/SampleCodes/C2A_Integration/C2A_src_user/Applications/CMakeLists.txt
+++ /dev/null
@@ -1,20 +0,0 @@
-cmake_minimum_required(VERSION 3.13)
-
-project(C2A_USER_APPS)
-
-set(C2A_SRCS
- app_registry.c
- DriverInstances/di_aobc.c
- DriverInstances/di_gs.c
- DriverInstances/di_uart_test.c
- DriverInstances/di_s2e_uart_test.c
- UserDefined/debug_apps.c
-)
-
-if(BUILD_C2A_AS_CXX)
- set_source_files_properties(${C2A_SRCS} PROPERTIES LANGUAGE CXX) # C++
-endif()
-
-add_library(${PROJECT_NAME} OBJECT ${C2A_SRCS})
-
-include(${C2A_USER_DIR}/common.cmake)
diff --git a/Tutorials/SampleCodes/C2A_Integration/C2A_src_user/Applications/DriverInstances/di_s2e_uart_test.c b/Tutorials/SampleCodes/C2A_Integration/C2A_src_user/Applications/DriverInstances/di_s2e_uart_test.c
deleted file mode 100644
index 1020226c..00000000
--- a/Tutorials/SampleCodes/C2A_Integration/C2A_src_user/Applications/DriverInstances/di_s2e_uart_test.c
+++ /dev/null
@@ -1,54 +0,0 @@
-#pragma section REPRO
-/**
- * @file di_s2e_uart_test.h
- * @brief S2EgUARTʐMeXgpAv
- */
-
-#include "di_s2e_uart_test.h"
-
-#include // for NULL
-#include
-#include
-
-
-static UART_Config S2E_UART_TEST_channel_;
-static uint8_t S2E_UART_TEST_port_id_ = 1;
-static uint8_t S2E_UART_TEST_count_ = 0;
-
-static void S2E_UART_TEST_init_(void);
-static void S2E_UART_TEST_update_(void);
-
-AppInfo S2E_UART_TEST_update(void)
-{
- return AI_create_app_info("s2e_uart_test", S2E_UART_TEST_init_, S2E_UART_TEST_update_);
-}
-
-static void S2E_UART_TEST_init_(void)
-{
- S2E_UART_TEST_channel_.ch = S2E_UART_TEST_port_id_;
- S2E_UART_TEST_channel_.baudrate = 115200;
- S2E_UART_TEST_channel_.stop_bit = UART_STOP_BIT_1BIT;
-}
-
-static void S2E_UART_TEST_update_(void)
-{
- uint8_t test_tx_data_[5] = {'S', 'E', 'T', 'A', '\n'};
- uint8_t test_rx_data_[100];
- uint8_t i;
- // Send
- test_tx_data_[3] = 'A' + S2E_UART_TEST_count_;
- UART_tx(&S2E_UART_TEST_channel_, test_tx_data_, 5);
- S2E_UART_TEST_count_++;
- if(S2E_UART_TEST_count_ >= 26) S2E_UART_TEST_count_ = 0;
-
- // Receive
- UART_rx(&S2E_UART_TEST_channel_, &test_rx_data_, 100);
- Printf("S2E_UART_TEST: received data = ");
- for (i = 0; i < 3; i++)
- {
- Printf("%c, ", test_rx_data_[i]);
- }
- Printf("\n");
-}
-
-#pragma section
diff --git a/Tutorials/SampleCodes/C2A_Integration/C2A_src_user/Applications/DriverInstances/di_s2e_uart_test.h b/Tutorials/SampleCodes/C2A_Integration/C2A_src_user/Applications/DriverInstances/di_s2e_uart_test.h
deleted file mode 100644
index a7511f23..00000000
--- a/Tutorials/SampleCodes/C2A_Integration/C2A_src_user/Applications/DriverInstances/di_s2e_uart_test.h
+++ /dev/null
@@ -1,12 +0,0 @@
-/**
- * @file di_s2e_uart_test.h
- * @brief S2EgUARTʐMeXgpAv
- */
-#ifndef DI_S2E_UART_TEST_H_
-#define DI_S2E_UART_TEST_H_
-
-#include
-
-AppInfo S2E_UART_TEST_update(void);
-
-#endif
diff --git a/Tutorials/SampleCodes/C2A_Integration/C2A_src_user/Applications/app_headers.h b/Tutorials/SampleCodes/C2A_Integration/C2A_src_user/Applications/app_headers.h
deleted file mode 100644
index 56d6457b..00000000
--- a/Tutorials/SampleCodes/C2A_Integration/C2A_src_user/Applications/app_headers.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/**
- * @file
- * @brief Appのヘッダをまとめたヘッダ
- */
-#ifndef APP_HEADERS_H_
-#define APP_HEADERS_H_
-
-// Core
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-// DI
-#include "DriverInstances/di_aobc.h"
-#include "DriverInstances/di_uart_test.h"
-#include "DriverInstances/di_s2e_uart_test.h"
-#include "DriverInstances/di_gs.h"
-
-// UserDefined
-#include "UserDefined/debug_apps.h"
-
-#endif
diff --git a/Tutorials/SampleCodes/C2A_Integration/C2A_src_user/Applications/app_registry.c b/Tutorials/SampleCodes/C2A_Integration/C2A_src_user/Applications/app_registry.c
deleted file mode 100644
index 0b1fdf35..00000000
--- a/Tutorials/SampleCodes/C2A_Integration/C2A_src_user/Applications/app_registry.c
+++ /dev/null
@@ -1,50 +0,0 @@
-#pragma section REPRO
-#include "app_registry.h"
-
-#include
-
-#include "app_headers.h"
-
-static AM_ACK add_application_(size_t id,
- AppInfo (*app_creator)(void));
-
-void AR_load_initial_settings(void)
-{
- add_application_(AR_NOP, NOP_create_app);
- add_application_(AR_DI_GS_CMD_PH, DI_GS_cmd_packet_handler);
- add_application_(AR_DI_GS_MST_PH, DI_GS_mst_packet_handler);
- add_application_(AR_DI_GS_RPT_PH, DI_GS_rpt_packet_handler);
- add_application_(AR_DI_UART_TEST, UART_TEST_update);
- add_application_(AR_DI_S2E_UART_TEST, S2E_UART_TEST_update);
- add_application_(AR_GSC_DISPATCHER, GSCD_create_app);
- add_application_(AR_RTC_DISPATCHER, RTCD_create_app);
- add_application_(AR_TLC_DISPATCHER_GS, TLCD_gs_create_app);
- add_application_(AR_TLC_DISPATCHER_BC, TLCD_bc_create_app);
- add_application_(AR_TLC_DISPATCHER_TLM, TLCD_tlm_create_app);
-#ifdef TLCD_ENABLE_MISSION_TL
- add_application_(AR_TLC_DISPATCHER_MIS, TLCD_mis_create_app);
-#endif
- add_application_(AR_EVENT_UTILITY, EVENT_UTIL_create_app);
- add_application_(AR_ANOMALY_HANDLER, AH_create_app);
- add_application_(AR_MEM_DUMP, MEM_create_app);
- add_application_(AR_TELEMETRY_MANAGER, TLM_MGR_create_app);
- add_application_(AR_DIVIDED_CMD_UTILITY, DCU_create_app);
- add_application_(AR_UTILITY_CMD, UTIL_CMD_create_app);
- add_application_(AR_UTILITY_COUNTER, UTIL_COUNTER_create_app);
- add_application_(AR_APP_DBG_FLUSH_SCREEN, APP_DBG_flush_screen);
- add_application_(AR_APP_DBG_PRINT_TIMESTAMP, APP_DBG_print_time_stamp);
- add_application_(AR_APP_DBG_PRINT_CMD_STATUS, APP_DBG_print_cmd_status);
- add_application_(AR_APP_DBG_PRINT_EVENT_LOGGER0, APP_DBG_print_event_logger0);
- add_application_(AR_APP_DBG_PRINT_EVENT_LOGGER1, APP_DBG_print_event_logger1);
- add_application_(AR_APP_DBG_PRINT_EVENT_HANDLER, APP_DBG_print_event_handler);
- add_application_(AR_APP_DBG_PRINT_GIT_REV, APP_DBG_print_git_rev);
-}
-
-static AM_ACK add_application_(size_t id,
- AppInfo (*app_creator)(void))
-{
- AppInfo ai = app_creator();
- return AM_register_ai(id, &ai);
-}
-
-#pragma section
diff --git a/Tutorials/SampleCodes/C2A_Integration/C2A_src_user/Applications/app_registry.h b/Tutorials/SampleCodes/C2A_Integration/C2A_src_user/Applications/app_registry.h
deleted file mode 100644
index 40c66160..00000000
--- a/Tutorials/SampleCodes/C2A_Integration/C2A_src_user/Applications/app_registry.h
+++ /dev/null
@@ -1,40 +0,0 @@
-#ifndef APP_REGISTRY_H_
-#define APP_REGISTRY_H_
-#include
-
-// こいつの自動生成がほしい...
-typedef enum
-{
- AR_NOP,
- AR_DI_GS_CMD_PH,
- AR_DI_GS_MST_PH,
- AR_DI_GS_RPT_PH,
- AR_DI_UART_TEST,
- AR_DI_S2E_UART_TEST,
- AR_GSC_DISPATCHER,
- AR_RTC_DISPATCHER,
- AR_TLC_DISPATCHER_GS,
- AR_TLC_DISPATCHER_BC,
- AR_TLC_DISPATCHER_TLM,
-#ifdef TLCD_ENABLE_MISSION_TL
- AR_TLC_DISPATCHER_MIS,
-#endif
- AR_EVENT_UTILITY,
- AR_ANOMALY_HANDLER,
- AR_MEM_DUMP,
- AR_TELEMETRY_MANAGER,
- AR_DIVIDED_CMD_UTILITY,
- AR_UTILITY_CMD,
- AR_UTILITY_COUNTER,
- AR_APP_DBG_FLUSH_SCREEN,
- AR_APP_DBG_PRINT_TIMESTAMP,
- AR_APP_DBG_PRINT_CMD_STATUS,
- AR_APP_DBG_PRINT_EVENT_LOGGER0,
- AR_APP_DBG_PRINT_EVENT_LOGGER1,
- AR_APP_DBG_PRINT_EVENT_HANDLER,
- AR_APP_DBG_PRINT_GIT_REV
-} AR_APP_ID;
-
-void AR_load_initial_settings(void);
-
-#endif // APP_REGISTRY_H_
diff --git a/Tutorials/SampleCodes/C2A_Integration/C2A_src_user/Settings/Modes/TaskLists/Elements/tl_elem_drivers_update.c b/Tutorials/SampleCodes/C2A_Integration/C2A_src_user/Settings/Modes/TaskLists/Elements/tl_elem_drivers_update.c
deleted file mode 100644
index 2f5e286e..00000000
--- a/Tutorials/SampleCodes/C2A_Integration/C2A_src_user/Settings/Modes/TaskLists/Elements/tl_elem_drivers_update.c
+++ /dev/null
@@ -1,24 +0,0 @@
-#pragma section REPRO
-#include "tl_elem_drivers_update.h"
-
-#include "../../../../Applications/app_registry.h"
-#include "../../../../TlmCmd/block_command_definitions.h"
-
-#include
-
-
-void BCL_load_tl_elem_drivers_update_initial(void)
-{
- BCL_tool_register_app(0, AR_DI_S2E_UART_TEST);
- BCL_tool_register_app(1, AR_NOP);
- BCL_tool_register_app(2, AR_NOP);
- BCL_tool_register_app(3, AR_NOP);
- BCL_tool_register_app(4, AR_NOP);
- BCL_tool_register_app(5, AR_NOP);
- BCL_tool_register_app(6, AR_NOP);
- BCL_tool_register_app(7, AR_NOP);
- BCL_tool_register_app(8, AR_NOP);
- BCL_tool_register_app(9, AR_NOP);
-}
-
-#pragma section
diff --git a/Tutorials/SampleCodes/C2A_Integration/S2E_src/Simulation/Spacecraft/c2a_core_sample_components.cpp b/Tutorials/SampleCodes/C2A_Integration/S2E_src/Simulation/Spacecraft/c2a_core_sample_components.cpp
deleted file mode 100644
index 036f4840..00000000
--- a/Tutorials/SampleCodes/C2A_Integration/S2E_src/Simulation/Spacecraft/c2a_core_sample_components.cpp
+++ /dev/null
@@ -1,39 +0,0 @@
-#include "c2a_core_sample_components.h"
-
-#include
-
-#ifdef USE_C2A
-#include "src_user/Settings/port_config.h"
-#endif
-
-C2aCoreSampleComponents::C2aCoreSampleComponents(const Dynamics* dynamics, const Structure* structure, const LocalEnvironment* local_env,
- const GlobalEnvironment* glo_env, const SimulationConfig* config, ClockGenerator* clock_gen)
- : dynamics_(dynamics), structure_(structure), local_env_(local_env), glo_env_(glo_env), config_(config) {
-#ifdef USE_C2A
- obc_ = new OBC_C2A(clock_gen, 100);
-
- obc_->ConnectComPort(PORT_CH_RS422_MOBC_EXT, 1024, 1024); // UART通信用にとりあえず繋いでおく
-
- exp_ = new EXP(clock_gen, 1, 10, obc_);
-#endif
-}
-
-C2aCoreSampleComponents::~C2aCoreSampleComponents() {
- delete exp_;
- // OBC must be deleted the last since it has com ports
- delete obc_;
-}
-
-Vector<3> C2aCoreSampleComponents::GenerateForce_N_b() {
- // There is no orbit control component, so it remains 0
- Vector<3> force_N_b_(0.0);
- return force_N_b_;
-}
-
-Vector<3> C2aCoreSampleComponents::GenerateTorque_Nm_b() {
- // No attitude control component
- Vector<3> torque_Nm_b_(0.0);
- return torque_Nm_b_;
-}
-
-void C2aCoreSampleComponents::LogSetup(Logger& logger) { UNUSED(logger); }
diff --git a/Tutorials/SampleCodes/C2A_Integration/S2E_src/Simulation/Spacecraft/c2a_core_sample_components.h b/Tutorials/SampleCodes/C2A_Integration/S2E_src/Simulation/Spacecraft/c2a_core_sample_components.h
deleted file mode 100644
index b10cf85c..00000000
--- a/Tutorials/SampleCodes/C2A_Integration/S2E_src/Simulation/Spacecraft/c2a_core_sample_components.h
+++ /dev/null
@@ -1,34 +0,0 @@
-#pragma once
-
-#include
-
-#include "Dynamics.h"
-#include "GlobalEnvironment.h"
-#include "LocalEnvironment.h"
-#include "Vector.hpp"
-
-// include for components
-#include "OBC_C2A.h"
-#include
-
-class C2aCoreSampleComponents : public InstalledComponents {
- public:
- C2aCoreSampleComponents(const Dynamics* dynamics, const Structure* structure, const LocalEnvironment* local_env, const GlobalEnvironment* glo_env,
- const SimulationConfig* config, ClockGenerator* clock_gen);
- ~C2aCoreSampleComponents();
- libra::Vector<3> GenerateForce_N_b();
- libra::Vector<3> GenerateTorque_Nm_b();
- void LogSetup(Logger& logger);
-
- private:
- // Components
- OBC_C2A* obc_;
- EXP* exp_;
-
- // References
- const Dynamics* dynamics_;
- const Structure* structure_;
- const LocalEnvironment* local_env_;
- const GlobalEnvironment* glo_env_;
- const SimulationConfig* config_;
-};
diff --git a/Tutorials/SampleCodes/ClockSensor/ClockSensor.cpp b/Tutorials/SampleCodes/ClockSensor/ClockSensor.cpp
index 18c69b53..0e1949b5 100644
--- a/Tutorials/SampleCodes/ClockSensor/ClockSensor.cpp
+++ b/Tutorials/SampleCodes/ClockSensor/ClockSensor.cpp
@@ -1,10 +1,10 @@
-#include "ClockSensor.h"
+#include "ClockSensor.hpp"
ClockSensor::ClockSensor(
- int prescaler,
+ const int prescaler,
ClockGenerator* clock_gen,
- const SimTime* sim_time,
- double bias_sec
+ const SimTime& sim_time,
+ const double bias_sec
)
: ComponentBase(prescaler, clock_gen),
sim_time_(sim_time), bias_sec_(bias_sec),
@@ -14,7 +14,8 @@ ClockSensor::ClockSensor(
void ClockSensor::MainRoutine(int count)
{
- time_output_sec_ = sim_time_->GetElapsedSec() + bias_sec_;
+ UNUSED(count);
+ time_output_sec_ = sim_time_.GetElapsedSec() + bias_sec_;
}
std::string ClockSensor::GetLogHeader() const
diff --git a/Tutorials/SampleCodes/ClockSensor/ClockSensor.h b/Tutorials/SampleCodes/ClockSensor/ClockSensor.hpp
similarity index 80%
rename from Tutorials/SampleCodes/ClockSensor/ClockSensor.h
rename to Tutorials/SampleCodes/ClockSensor/ClockSensor.hpp
index 7de90ead..2cae77b8 100644
--- a/Tutorials/SampleCodes/ClockSensor/ClockSensor.h
+++ b/Tutorials/SampleCodes/ClockSensor/ClockSensor.hpp
@@ -7,10 +7,10 @@ class ClockSensor: public ComponentBase, public ILoggable
{
public:
ClockSensor(
- int prescaler,
+ const int prescaler,
ClockGenerator* clock_gen,
- const SimTime* sim_time,
- double bias_sec
+ const SimTime& sim_time,
+ const double bias_sec
);
protected:
@@ -21,7 +21,7 @@ class ClockSensor: public ComponentBase, public ILoggable
private:
int prescaler_;
ClockGenerator* clock_gen_;
- const SimTime* sim_time_;
+ const SimTime& sim_time_;
double bias_sec_;
double time_output_sec_;
};
diff --git a/Tutorials/SampleCodes/ClockSensor/EditedCodes/UserComponents.cpp b/Tutorials/SampleCodes/ClockSensor/EditedCodes/UserComponents.cpp
new file mode 100644
index 00000000..34831105
--- /dev/null
+++ b/Tutorials/SampleCodes/ClockSensor/EditedCodes/UserComponents.cpp
@@ -0,0 +1,45 @@
+#include "UserComponents.hpp"
+
+#include
+#include "../../Components/InitClockSensor.hpp"
+
+UserComponents::UserComponents(
+ const Dynamics* dynamics,
+ const Structure* structure,
+ const LocalEnvironment* local_env,
+ const GlobalEnvironment* glo_env,
+ const SimulationConfig* config,
+ ClockGenerator* clock_gen
+):dynamics_(dynamics), structure_(structure), local_env_(local_env), glo_env_(glo_env), config_(config)
+{
+ obc_ = new OBC(clock_gen);
+ IniAccess ini_access = IniAccess(config->sat_file_[0]);
+ std::string clock_sensor_ini_path = ini_access.ReadString("COMPONENTS_FILE", "clock_sensor_file");
+ clock_sensor_ = new ClockSensor(InitClockSensor(clock_gen, glo_env->GetSimTime(), clock_sensor_ini_path));
+}
+
+UserComponents::~UserComponents()
+{
+ delete clock_sensor_;
+ // OBC must be deleted the last since it has com ports
+ delete obc_;
+}
+
+Vector<3> UserComponents::GenerateForce_N_b()
+{
+ // There is no orbit control component, so it remains 0
+ Vector<3> force_N_b_(0.0);
+ return force_N_b_;
+}
+
+Vector<3> UserComponents::GenerateTorque_Nm_b()
+{
+ // No attitude control component
+ Vector<3> torque_Nm_b_(0.0);
+ return torque_Nm_b_;
+}
+
+void UserComponents::LogSetup(Logger & logger)
+{
+ logger.AddLoggable(clock_sensor_);
+}
diff --git a/Tutorials/SampleCodes/ClockSensor/edited codes/User_Components.h b/Tutorials/SampleCodes/ClockSensor/EditedCodes/UserComponents.hpp
similarity index 65%
rename from Tutorials/SampleCodes/ClockSensor/edited codes/User_Components.h
rename to Tutorials/SampleCodes/ClockSensor/EditedCodes/UserComponents.hpp
index 0d361c95..36a536ed 100644
--- a/Tutorials/SampleCodes/ClockSensor/edited codes/User_Components.h
+++ b/Tutorials/SampleCodes/ClockSensor/EditedCodes/UserComponents.hpp
@@ -1,15 +1,17 @@
#pragma once
-#include "Vector.hpp"
+#include
+
#include "Dynamics.h"
#include "GlobalEnvironment.h"
#include "LocalEnvironment.h"
+#include "Vector.hpp"
-// include for component
+// include for components
#include "OBC.h"
-#include "../../Components/ClockSensor.h"
+#include "../../Components/ClockSensor.hpp"
-class UserComponents
+class UserComponents : public InstalledComponents
{
public:
UserComponents(
@@ -18,13 +20,13 @@ class UserComponents
const LocalEnvironment* local_env,
const GlobalEnvironment* glo_env,
const SimulationConfig* config,
- ClockGenerator* clock_gen,
- const int sat_id
+ ClockGenerator* clock_gen
);
~UserComponents();
- libra::Vector<3> GenerateForce_b();
- libra::Vector<3> GenerateTorque_b();
- void CompoLogSetUp(Logger& logger);
+ libra::Vector<3> GenerateForce_N_b();
+ libra::Vector<3> GenerateTorque_Nm_b();
+ void LogSetup(Logger& logger);
+
private:
// Components
OBC* obc_;
diff --git a/Tutorials/SampleCodes/ClockSensor/edited codes/UserSat.ini b/Tutorials/SampleCodes/ClockSensor/EditedCodes/UserSat.ini
similarity index 61%
rename from Tutorials/SampleCodes/ClockSensor/edited codes/UserSat.ini
rename to Tutorials/SampleCodes/ClockSensor/EditedCodes/UserSat.ini
index 1f29a35c..f23b08d1 100644
--- a/Tutorials/SampleCodes/ClockSensor/edited codes/UserSat.ini
+++ b/Tutorials/SampleCodes/ClockSensor/EditedCodes/UserSat.ini
@@ -1,7 +1,8 @@
[ATTITUDE]
// Attitude propagation mode
-// 0: RK4, 1: ControlledAttitude
-propagate_mode = 0
+// RK4 : Attitude Propagation with RK4 including disturbances and control torque
+// CONTROLLED : Attitude Calculation with Controlled Attitude mode. All disturbances and control torque are ignored.
+propagate_mode = RK4
// Initial angular velocity at body frame,[rad/s]
Omega_b(0) = 0.0
@@ -20,22 +21,15 @@ Torque_b(0) = +0.000
Torque_b(1) = -0.000
Torque_b(2) = 0.000
-
[ControlledAttitude]
// Mode definitions
-// INERTIAL_STABILIZE = 0,
-// SUN_POINTING = 1,
-// EARTH_CENTER_POINTING = 2
-// VELOCITY_DIRECTION_POINTING = 3,
-// ORBIT_NORMAL_POINTING = 4,
-main_mode = 3
-sub_mode = 1
-
-// Target Quaternion for INERTIAL_STABILIZE mode,(real part,imaginary part)
-quaternion_i2t(0) = 0.5
-quaternion_i2t(1) = 0.5
-quaternion_i2t(2) = 0.5
-quaternion_i2t(3) = 0.5
+// INERTIAL_STABILIZE
+// SUN_POINTING
+// EARTH_CENTER_POINTING
+// VELOCITY_DIRECTION_POINTING
+// ORBIT_NORMAL_POINTING
+main_mode = INERTIAL_STABILIZE
+sub_mode = SUN_POINTING
// Pointing direction @ body frame for main pointing mode
pointing_t_b(0) = 0.707
@@ -54,13 +48,16 @@ calculation = ENABLE
logging = ENABLE
// Orbit propagation mode
-// 0: RK4 with initial position and velocity
-// 1: SGP4 with TLE
-// 2: Relative dynamics (for formation flying simulation)
-propagate_mode = 1
-
-// TLE definition for SGP4 ///////////////////////////////////////////////
-// ISS
+// RK4 : RK4 propagation with disturbances and thruster maneuver
+// SGP4 : SGP4 propagation using TLE without thruster maneuver
+// RELATIVE : Relative dynamics (for formation flying simulation)
+// KEPLER : Kepler orbit propagation without disturbances and thruster maneuver
+// ENCKE : Encke orbit propagation with disturbances and thruster maneuver
+propagate_mode = SGP4
+
+// Settings for SGP4 ///////////////////////////////////////////////
+// TLE
+// Example: ISS
tle1=1 25544U 98067A 20076.51604214 .00016717 00000-0 10270-3 0 9005
tle2=2 25544 51.6412 86.9962 0006063 30.9353 329.2153 15.49228202 17647
wgs = 2 // 0: wgs72old, 1: wgs72, 2: wgs84
@@ -102,25 +99,43 @@ reference_sat_id = 1
///////////////////////////////////////////////////////////////////////////////
+// Information used for orbital propagation by the Kepler Motion ///////////
+// initialize mode for kepler motion
+// INIT_POSVEL : initialize with position and velocity defined for RK4
+// INIT_OE : initialize with the following orbital elements
+init_mode_kepler = INIT_POSVEL
+// Orbital Elements for INIT_OE
+semi_major_axis_m = 6794500.0
+eccentricity = 0.0015
+inclination_rad = 0.9012
+raan_rad = 0.1411
+arg_perigee_rad = 1.7952
+epoch_jday = 2.458940966402607e6
+///////////////////////////////////////////////////////////////////////////////
+
+
+// Information used for orbital propagation by the Encke Formulation ///////////
+error_tolerance = 0.0001
+// initialize position and vector are same with RK4 setting
+///////////////////////////////////////////////////////////////////////////////
+
+
[Thermal]
IsCalcEnabled=0
debug=0
-thrm_file = ../../data/ini/Thermal_CSV/
[LOCAL_ENVIRONMENT]
-local_env_file = ../../data/ini/UserSat_LocalEnvironment.ini
+local_env_file = ../../data/ini/UserSatLocalEnvironment.ini
[DISTURBANCE]
-dist_file = ../../data/ini/UserSat_Disturbance.ini
+dist_file = ../../data/ini/UserSatDisturbance.ini
[STRUCTURE_FILE]
-structure_file = ../../data/ini/UserSat_Structure.ini
+structure_file = ../../data/ini/UserSatStructure.ini
[COMPONENTS_FILE]
// Users can add the path for component initialize files here.
-gyro_file = ../../data/ini/components/Gyro_xxx.ini
-gyro_file_2 = ../../data/ini/components/Gyro_yyy.ini
clock_sensor_file = ../../data/ini/components/ClockSensor.ini
diff --git a/Tutorials/SampleCodes/ClockSensor/InitClockSensor.cpp b/Tutorials/SampleCodes/ClockSensor/InitClockSensor.cpp
new file mode 100644
index 00000000..cf435eaa
--- /dev/null
+++ b/Tutorials/SampleCodes/ClockSensor/InitClockSensor.cpp
@@ -0,0 +1,15 @@
+#include "ClockSensor.hpp"
+#include
+
+ClockSensor InitClockSensor(ClockGenerator* clock_gen,
+ const SimTime& sim_time,
+ const std::string file_name)
+{
+ IniAccess ini_file(file_name);
+
+ const double bias_sec = ini_file.ReadDouble("ClockSensor", "bias_sec");
+ const int prescaler = ini_file.ReadInt("ClockSensor", "prescaler");
+ ClockSensor clock_sensor(prescaler, clock_gen, sim_time, bias_sec);
+
+ return clock_sensor;
+}
diff --git a/Tutorials/SampleCodes/ClockSensor/InitClockSensor.hpp b/Tutorials/SampleCodes/ClockSensor/InitClockSensor.hpp
new file mode 100644
index 00000000..09c0e2d4
--- /dev/null
+++ b/Tutorials/SampleCodes/ClockSensor/InitClockSensor.hpp
@@ -0,0 +1,6 @@
+#pragma once
+#include "ClockSensor.hpp"
+
+ClockSensor InitClockSensor(ClockGenerator *clock_gen,
+ const SimTime &sim_time,
+ const std::string file_name);
diff --git a/Tutorials/SampleCodes/ClockSensor/Init_ClockSensor.cpp b/Tutorials/SampleCodes/ClockSensor/Init_ClockSensor.cpp
deleted file mode 100644
index 52b70dfb..00000000
--- a/Tutorials/SampleCodes/ClockSensor/Init_ClockSensor.cpp
+++ /dev/null
@@ -1,16 +0,0 @@
-#include "Initialize.h"
-#include
-#include "ClockSensor.h"
-
-ClockSensor InitClockSensor(ClockGenerator* clock_gen,
- const SimTime* sim_time,
- std::string file_name)
-{
- IniAccess ini_file(file_name);
-
- double bias_sec = ini_file.ReadDouble("ClockSensor", "bias_sec");
- int prescaler = ini_file.ReadInt("ClockSensor", "prescaler");
- ClockSensor clock_sensor(prescaler, clock_gen, sim_time, bias_sec);
-
- return clock_sensor;
-}
diff --git a/Tutorials/SampleCodes/ClockSensor/Initialize_UserComponent.h b/Tutorials/SampleCodes/ClockSensor/Initialize_UserComponent.h
deleted file mode 100644
index 4d8222d4..00000000
--- a/Tutorials/SampleCodes/ClockSensor/Initialize_UserComponent.h
+++ /dev/null
@@ -1,6 +0,0 @@
-#pragma once
-#include "ClockSensor.h"
-
-ClockSensor InitClockSensor(ClockGenerator* clock_gen,
- const SimTime* sim_time,
- std::string file_name);
\ No newline at end of file
diff --git a/Tutorials/SampleCodes/ClockSensor/edited codes/User_Components.cpp b/Tutorials/SampleCodes/ClockSensor/edited codes/User_Components.cpp
deleted file mode 100644
index b5b3c1e8..00000000
--- a/Tutorials/SampleCodes/ClockSensor/edited codes/User_Components.cpp
+++ /dev/null
@@ -1,52 +0,0 @@
-#include "User_Components.h"
-#include "Initialize.h"
-#include "../../Components/Initialize_UserComponent.h"
-
-UserComponents::UserComponents(
- const Dynamics* dynamics,
- const Structure* structure,
- const LocalEnvironment* local_env,
- const GlobalEnvironment* glo_env,
- const SimulationConfig* config,
- ClockGenerator* clock_gen,
- const int sat_id
-):dynamics_(dynamics), structure_(structure), local_env_(local_env), glo_env_(glo_env), config_(config)
-{
- IniAccess iniAccess = IniAccess(config->sat_file_[0]);
- double compo_step_sec = glo_env_->GetSimTime().GetCompoStepSec();
-
- obc_ = new OBC(clock_gen);
-
- std::string clock_sensor_ini_path = iniAccess.ReadString("COMPONENTS_FILE",
- "clock_sensor_file");
- clock_sensor_ = new ClockSensor(InitClockSensor(clock_gen,
- &glo_env->GetSimTime(),
- clock_sensor_ini_path));
-}
-
-UserComponents::~UserComponents()
-{
- delete clock_sensor_;
- delete obc_;
- // OBC must be deleted the last since it has com ports
-}
-
-Vector<3> UserComponents::GenerateForce_b()
-{
- // There is no orbit control component, so it remains 0
- Vector<3> force_b_(0.0);
- return force_b_;
-};
-
-Vector<3> UserComponents::GenerateTorque_b()
-{
- // No attitude control component
- Vector<3> torque_b_(0.0);
- return torque_b_;
-};
-
-void UserComponents::CompoLogSetUp(Logger & logger)
-{
- // Users can set log output when they need component log
- logger.AddLoggable(clock_sensor_);
-}
diff --git a/Tutorials/SampleCodes/ControlAlgorithm/ComponentMethod/data/Gyro_xxx.ini b/Tutorials/SampleCodes/ControlAlgorithm/ComponentMethod/data/GyroXxx.ini
similarity index 100%
rename from Tutorials/SampleCodes/ControlAlgorithm/ComponentMethod/data/Gyro_xxx.ini
rename to Tutorials/SampleCodes/ControlAlgorithm/ComponentMethod/data/GyroXxx.ini
diff --git a/Tutorials/SampleCodes/ControlAlgorithm/ComponentMethod/data/RW_xxx.ini b/Tutorials/SampleCodes/ControlAlgorithm/ComponentMethod/data/RwXxx.ini
similarity index 100%
rename from Tutorials/SampleCodes/ControlAlgorithm/ComponentMethod/data/RW_xxx.ini
rename to Tutorials/SampleCodes/ControlAlgorithm/ComponentMethod/data/RwXxx.ini
diff --git a/Tutorials/SampleCodes/ControlAlgorithm/ComponentMethod/data/UserSat.ini b/Tutorials/SampleCodes/ControlAlgorithm/ComponentMethod/data/UserSat.ini
index b8a804c0..6ad7f535 100644
--- a/Tutorials/SampleCodes/ControlAlgorithm/ComponentMethod/data/UserSat.ini
+++ b/Tutorials/SampleCodes/ControlAlgorithm/ComponentMethod/data/UserSat.ini
@@ -1,7 +1,8 @@
[ATTITUDE]
// Attitude propagation mode
-// 0: RK4, 1: ControlledAttitude
-propagate_mode = 0
+// RK4 : Attitude Propagation with RK4 including disturbances and control torque
+// CONTROLLED : Attitude Calculation with Controlled Attitude mode. All disturbances and control torque are ignored.
+propagate_mode = RK4
// Initial angular velocity at body frame,[rad/s]
Omega_b(0) = 0.02
@@ -20,22 +21,15 @@ Torque_b(0) = +0.000
Torque_b(1) = -0.000
Torque_b(2) = 0.000
-
[ControlledAttitude]
// Mode definitions
-// INERTIAL_STABILIZE = 0,
-// SUN_POINTING = 1,
-// EARTH_CENTER_POINTING = 2
-// VELOCITY_DIRECTION_POINTING = 3,
-// ORBIT_NORMAL_POINTING = 4,
-main_mode = 3
-sub_mode = 1
-
-// Target Quaternion for INERTIAL_STABILIZE mode,(real part,imaginary part)
-quaternion_i2t(0) = 0.5
-quaternion_i2t(1) = 0.5
-quaternion_i2t(2) = 0.5
-quaternion_i2t(3) = 0.5
+// INERTIAL_STABILIZE
+// SUN_POINTING
+// EARTH_CENTER_POINTING
+// VELOCITY_DIRECTION_POINTING
+// ORBIT_NORMAL_POINTING
+main_mode = INERTIAL_STABILIZE
+sub_mode = SUN_POINTING
// Pointing direction @ body frame for main pointing mode
pointing_t_b(0) = 0.707
@@ -54,13 +48,16 @@ calculation = ENABLE
logging = ENABLE
// Orbit propagation mode
-// 0: RK4 with initial position and velocity
-// 1: SGP4 with TLE
-// 2: Relative dynamics (for formation flying simulation)
-propagate_mode = 1
-
-// TLE definition for SGP4 ///////////////////////////////////////////////
-// ISS
+// RK4 : RK4 propagation with disturbances and thruster maneuver
+// SGP4 : SGP4 propagation using TLE without thruster maneuver
+// RELATIVE : Relative dynamics (for formation flying simulation)
+// KEPLER : Kepler orbit propagation without disturbances and thruster maneuver
+// ENCKE : Encke orbit propagation with disturbances and thruster maneuver
+propagate_mode = SGP4
+
+// Settings for SGP4 ///////////////////////////////////////////////
+// TLE
+// Example: ISS
tle1=1 25544U 98067A 20076.51604214 .00016717 00000-0 10270-3 0 9005
tle2=2 25544 51.6412 86.9962 0006063 30.9353 329.2153 15.49228202 17647
wgs = 2 // 0: wgs72old, 1: wgs72, 2: wgs84
@@ -102,24 +99,44 @@ reference_sat_id = 1
///////////////////////////////////////////////////////////////////////////////
+// Information used for orbital propagation by the Kepler Motion ///////////
+// initialize mode for kepler motion
+// INIT_POSVEL : initialize with position and velocity defined for RK4
+// INIT_OE : initialize with the following orbital elements
+init_mode_kepler = INIT_POSVEL
+// Orbital Elements for INIT_OE
+semi_major_axis_m = 6794500.0
+eccentricity = 0.0015
+inclination_rad = 0.9012
+raan_rad = 0.1411
+arg_perigee_rad = 1.7952
+epoch_jday = 2.458940966402607e6
+///////////////////////////////////////////////////////////////////////////////
+
+
+// Information used for orbital propagation by the Encke Formulation ///////////
+error_tolerance = 0.0001
+// initialize position and vector are same with RK4 setting
+///////////////////////////////////////////////////////////////////////////////
+
+
[Thermal]
IsCalcEnabled=0
debug=0
-thrm_file = ../../data/ini/Thermal_CSV/
[LOCAL_ENVIRONMENT]
-local_env_file = ../../data/ini/UserSat_LocalEnvironment.ini
+local_env_file = ../../data/ini/UserSatLocalEnvironment.ini
[DISTURBANCE]
-dist_file = ../../data/ini/UserSat_Disturbance.ini
+dist_file = ../../data/ini/UserSatDisturbance.ini
[STRUCTURE_FILE]
-structure_file = ../../data/ini/UserSat_Structure.ini
+structure_file = ../../data/ini/UserSatStructure.ini
[COMPONENTS_FILE]
// Users can add the path for component initialize files here.
-gyro_file = ../../data/ini/components/Gyro_xxx.ini
-rw_file = ../../data/ini/components/RW_xxx.ini
+gyro_file = ../../data/ini/components/GyroXxx.ini
+rw_file = ../../data/ini/components/RwXxx.ini
diff --git a/Tutorials/SampleCodes/ControlAlgorithm/ComponentMethod/src/Components/UserObc.cpp b/Tutorials/SampleCodes/ControlAlgorithm/ComponentMethod/src/Components/UserObc.cpp
new file mode 100644
index 00000000..1c4112e4
--- /dev/null
+++ b/Tutorials/SampleCodes/ControlAlgorithm/ComponentMethod/src/Components/UserObc.cpp
@@ -0,0 +1,33 @@
+#include "UserObc.hpp"
+#include "../Simulation/Spacecraft/UserComponents.hpp"
+
+UserObc::UserObc(ClockGenerator* clock_gen, UserComponents& components)
+: ComponentBase(1, clock_gen), components_(components)
+{
+ Initialize();
+}
+
+UserObc::~UserObc()
+{
+}
+
+void UserObc::Initialize()
+{
+}
+
+void UserObc::MainRoutine(int count)
+{
+ UNUSED(count);
+ // Sensor inputs
+ const libra::Vector<3> gyro_omega_c = components_.GetGyro().GetOmegaC();
+ // const double rw_rpm = components_.GetRw().GetVelocityRpm(); // An example of RW rotation speed observation
+
+ // Control Algorithm
+ const double Kp = 5e-3;
+ double torque = -1.0 * Kp * gyro_omega_c(0);
+
+ // Actuator outputs
+ components_.GetRw().SetDriveFlag(true);
+ components_.GetRw().SetVelocityLimitRpm(8000);
+ components_.GetRw().SetTargetTorqueBody(torque);
+}
diff --git a/Tutorials/SampleCodes/ControlAlgorithm/ComponentMethod/src/Components/User_OBC.h b/Tutorials/SampleCodes/ControlAlgorithm/ComponentMethod/src/Components/UserObc.hpp
similarity index 67%
rename from Tutorials/SampleCodes/ControlAlgorithm/ComponentMethod/src/Components/User_OBC.h
rename to Tutorials/SampleCodes/ControlAlgorithm/ComponentMethod/src/Components/UserObc.hpp
index 1112bb26..75312844 100644
--- a/Tutorials/SampleCodes/ControlAlgorithm/ComponentMethod/src/Components/User_OBC.h
+++ b/Tutorials/SampleCodes/ControlAlgorithm/ComponentMethod/src/Components/UserObc.hpp
@@ -4,11 +4,11 @@
class UserComponents;
-class UserOBC: public ComponentBase
+class UserObc: public ComponentBase
{
public:
- UserOBC(ClockGenerator* clock_gen, UserComponents& components);
- ~UserOBC();
+ UserObc(ClockGenerator* clock_gen, UserComponents& components);
+ ~UserObc();
void Initialize();
double GetCurrent(int port_id) const;
protected:
diff --git a/Tutorials/SampleCodes/ControlAlgorithm/ComponentMethod/src/Components/User_OBC.cpp b/Tutorials/SampleCodes/ControlAlgorithm/ComponentMethod/src/Components/User_OBC.cpp
deleted file mode 100644
index 52f032b3..00000000
--- a/Tutorials/SampleCodes/ControlAlgorithm/ComponentMethod/src/Components/User_OBC.cpp
+++ /dev/null
@@ -1,32 +0,0 @@
-#include "User_OBC.h"
-#include "../Simulation/Spacecraft/User_Components.h"
-
-UserOBC::UserOBC(ClockGenerator* clock_gen, UserComponents& components)
-: ComponentBase(1, clock_gen), components_(components)
-{
- Initialize();
-}
-
-UserOBC::~UserOBC()
-{
-}
-
-void UserOBC::Initialize()
-{
-}
-
-void UserOBC::MainRoutine(int count)
-{
- // Sensor inputs
- libra::Vector<3> gyro_omega_c = components_.GetGyro().GetOmegaC();
- double rw_rpm = components_.GetRw().GetVelocityRpm();
-
- // Control Algorithm
- double Kp = 5e-3;
- double torque = -1.0*Kp*gyro_omega_c(0);
-
- // Actuator outputs
- components_.GetRw().SetDriveFlag(true);
- components_.GetRw().SetVelocityLimitRpm(8000);
- components_.GetRw().SetTargetTorqueBody(torque);
-}
diff --git a/Tutorials/SampleCodes/ControlAlgorithm/ComponentMethod/src/Simulation/UserComponents.cpp b/Tutorials/SampleCodes/ControlAlgorithm/ComponentMethod/src/Simulation/UserComponents.cpp
new file mode 100644
index 00000000..d3b142e8
--- /dev/null
+++ b/Tutorials/SampleCodes/ControlAlgorithm/ComponentMethod/src/Simulation/UserComponents.cpp
@@ -0,0 +1,53 @@
+#include "UserComponents.hpp"
+
+#include
+
+UserComponents::UserComponents(
+ const Dynamics* dynamics,
+ const Structure* structure,
+ const LocalEnvironment* local_env,
+ const GlobalEnvironment* glo_env,
+ const SimulationConfig* config,
+ ClockGenerator* clock_gen
+):dynamics_(dynamics), structure_(structure), local_env_(local_env), glo_env_(glo_env), config_(config)
+{
+ IniAccess ini_access = IniAccess(config->sat_file_[0]);
+ const double compo_step_sec = glo_env_->GetSimTime().GetCompoStepSec();
+
+ obc_ = new UserObc(clock_gen, *this);
+
+ const std::string gyro_ini_path = ini_access.ReadString("COMPONENTS_FILE", "gyro_file");
+ gyro_ = new Gyro(InitGyro(clock_gen, 1, gyro_ini_path, compo_step_sec, dynamics));
+
+ const std::string rw_ini_path = ini_access.ReadString("COMPONENTS_FILE", "rw_file");
+ rw_ = new RWModel(InitRWModel(clock_gen, 1, rw_ini_path, dynamics->GetAttitude().GetPropStep(), compo_step_sec));
+}
+
+UserComponents::~UserComponents()
+{
+ delete gyro_;
+ delete rw_;
+ // OBC must be deleted the last since it has com ports
+ delete obc_;
+}
+
+Vector<3> UserComponents::GenerateForce_N_b()
+{
+ // There is no orbit control component, so it remains 0
+ Vector<3> force_N_b_(0.0);
+ return force_N_b_;
+}
+
+Vector<3> UserComponents::GenerateTorque_Nm_b()
+{
+ // No attitude control component
+ Vector<3> torque_Nm_b_(0.0);
+ torque_Nm_b_ = rw_->GetOutputTorqueB();
+ return torque_Nm_b_;
+}
+
+void UserComponents::LogSetup(Logger & logger)
+{
+ logger.AddLoggable(gyro_);
+ logger.AddLoggable(rw_);
+}
diff --git a/Tutorials/SampleCodes/ControlAlgorithm/ComponentMethod/src/Simulation/User_Components.h b/Tutorials/SampleCodes/ControlAlgorithm/ComponentMethod/src/Simulation/UserComponents.hpp
similarity index 64%
rename from Tutorials/SampleCodes/ControlAlgorithm/ComponentMethod/src/Simulation/User_Components.h
rename to Tutorials/SampleCodes/ControlAlgorithm/ComponentMethod/src/Simulation/UserComponents.hpp
index e38079ea..ba2b396f 100644
--- a/Tutorials/SampleCodes/ControlAlgorithm/ComponentMethod/src/Simulation/User_Components.h
+++ b/Tutorials/SampleCodes/ControlAlgorithm/ComponentMethod/src/Simulation/UserComponents.hpp
@@ -1,16 +1,19 @@
#pragma once
-#include "Vector.hpp"
+#include
+
#include "Dynamics.h"
#include "GlobalEnvironment.h"
#include "LocalEnvironment.h"
+#include "Vector.hpp"
-// include for component
-#include "../../Components/User_OBC.h"
-#include "Gyro.h"
-#include "RWModel.h"
+// include for components
+#include "../../Components/UserObc.hpp"
+#include "InitGyro.hpp"
+#include "InitRwModel.hpp"
-class UserComponents
+
+class UserComponents : public InstalledComponents
{
public:
UserComponents(
@@ -19,21 +22,19 @@ class UserComponents
const LocalEnvironment* local_env,
const GlobalEnvironment* glo_env,
const SimulationConfig* config,
- ClockGenerator* clock_gen,
- const int sat_id
+ ClockGenerator* clock_gen
);
~UserComponents();
- libra::Vector<3> GenerateForce_b();
- libra::Vector<3> GenerateTorque_b();
- void CompoLogSetUp(Logger& logger);
-
+ libra::Vector<3> GenerateForce_N_b();
+ libra::Vector<3> GenerateTorque_Nm_b();
+ void LogSetup(Logger& logger);
//Getter
inline Gyro& GetGyro(){ return *gyro_; }
inline RWModel& GetRw(){ return *rw_; }
private:
// Components
- UserOBC* obc_;
+ UserObc* obc_;
Gyro* gyro_;
RWModel* rw_;
diff --git a/Tutorials/SampleCodes/ControlAlgorithm/ComponentMethod/src/Simulation/User_Components.cpp b/Tutorials/SampleCodes/ControlAlgorithm/ComponentMethod/src/Simulation/User_Components.cpp
deleted file mode 100644
index e3dedf12..00000000
--- a/Tutorials/SampleCodes/ControlAlgorithm/ComponentMethod/src/Simulation/User_Components.cpp
+++ /dev/null
@@ -1,56 +0,0 @@
-#include "User_Components.h"
-#include "Initialize.h"
-
-UserComponents::UserComponents(
- const Dynamics* dynamics,
- const Structure* structure,
- const LocalEnvironment* local_env,
- const GlobalEnvironment* glo_env,
- const SimulationConfig* config,
- ClockGenerator* clock_gen,
- const int sat_id
-):dynamics_(dynamics), structure_(structure),
- local_env_(local_env), glo_env_(glo_env),
- config_(config)
-{
- IniAccess iniAccess = IniAccess(config->sat_file_[0]);
- double compo_step_sec = glo_env_->GetSimTime().GetCompoStepSec();
-
- obc_ = new UserOBC(clock_gen, *this);
-
- const std::string gyro_ini_path = iniAccess.ReadString("COMPONENTS_FILE", "gyro_file");
- gyro_ = new Gyro(InitGyro(clock_gen, 1, gyro_ini_path, compo_step_sec, dynamics));
-
- const std::string rw_ini_path = iniAccess.ReadString("COMPONENTS_FILE", "rw_file");
- rw_ = new RWModel(InitRWModel(clock_gen, 1, rw_ini_path, dynamics->GetAttitude().GetPropStep(), compo_step_sec));
-}
-
-UserComponents::~UserComponents()
-{
- delete gyro_;
- delete rw_;
- delete obc_;
- // OBC must be deleted the last since it has com ports
-}
-
-Vector<3> UserComponents::GenerateForce_b()
-{
- // There is no orbit control component, so it remains 0
- Vector<3> force_b_(0.0);
- return force_b_;
-};
-
-Vector<3> UserComponents::GenerateTorque_b()
-{
- // No attitude control component
- Vector<3> torque_b_(0.0);
- torque_b_ = rw_->GetOutputTorqueB();
- return torque_b_;
-};
-
-void UserComponents::CompoLogSetUp(Logger & logger)
-{
- // Users can set log output when they need component log
- logger.AddLoggable(gyro_);
- logger.AddLoggable(rw_);
-}
diff --git a/Tutorials/SampleCodes/ControlAlgorithm/DirectMethod/UserSat.cpp b/Tutorials/SampleCodes/ControlAlgorithm/DirectMethod/UserSat.cpp
new file mode 100644
index 00000000..93f97158
--- /dev/null
+++ b/Tutorials/SampleCodes/ControlAlgorithm/DirectMethod/UserSat.cpp
@@ -0,0 +1,39 @@
+#include "UserSat.hpp"
+#include "UserComponents.hpp"
+
+UserSat::UserSat(SimulationConfig* sim_config, const GlobalEnvironment* glo_env, const int sat_id)
+:Spacecraft(sim_config, glo_env, sat_id)
+{
+ components_ = new UserComponents(dynamics_, structure_, local_env_, glo_env, sim_config, &clock_gen_);
+}
+
+void UserSat::Update(const SimTime* sim_time)
+{
+ dynamics_->ClearForceTorque();
+
+ // Update local environment and disturbance
+ local_env_->Update(dynamics_, sim_time);
+ disturbances_->Update(*local_env_, *dynamics_, sim_time);
+ // Update components
+ clock_gen_.UpdateComponents(sim_time);
+
+ // Sensing
+ Vector<3> observed_omega_b = dynamics_->GetAttitude().GetOmega_b();
+
+ // Control algorithm
+ Vector<3> control_torque_b(0.0);
+ Vector<3> control_force_b(0.0);
+ double Kp = 5.0e-3;
+ control_torque_b = -1.0 * Kp * observed_omega_b;
+
+ // Add generated force and torque by disturbances
+ dynamics_->AddAcceleration_i(disturbances_->GetAccelerationI());
+ dynamics_->AddTorque_b(disturbances_->GetTorque());
+ dynamics_->AddForce_b(disturbances_->GetForce());
+ // Generate force and torque
+ dynamics_->AddTorque_b(control_torque_b);
+ dynamics_->AddForce_b(control_force_b);
+
+ // Propagate dynamics
+ dynamics_->Update(sim_time, &(local_env_->GetCelesInfo()));
+}
diff --git a/Tutorials/SampleCodes/ControlAlgorithm/DirectMethod/User_sat_with_control.cpp b/Tutorials/SampleCodes/ControlAlgorithm/DirectMethod/User_sat_with_control.cpp
deleted file mode 100644
index 24f21b60..00000000
--- a/Tutorials/SampleCodes/ControlAlgorithm/DirectMethod/User_sat_with_control.cpp
+++ /dev/null
@@ -1,40 +0,0 @@
-#include "User_sat.h"
-
-UserSat::UserSat(SimulationConfig* sim_config, const GlobalEnvironment* glo_env, const int sat_id)
-:Spacecraft(sim_config, glo_env, sat_id)
-{
-}
-
-UserSat::~UserSat()
-{
-}
-
-void UserSat::Initialize(SimulationConfig* sim_config, const GlobalEnvironment* glo_env, const int sat_id)
-{
-}
-
-void UserSat::LogSetup(Logger & logger)
-{
- Spacecraft::LogSetup(logger);
-}
-
-void UserSat::Update(const SimTime* sim_time)
-{
- // Update Dynamics
- Spacecraft::Update(sim_time);
- // clear force and torques
- Clear();
-
- // Sensing
- Vector<3> observed_omega_b = dynamics_->GetAttitude().GetOmega_b();
-
- // Control algorithm
- Vector<3> control_torque_b(0.0);
- Vector<3> control_force_b(0.0);
- double Kp = 5.0e-3;
- control_torque_b = -1.0 * Kp * observed_omega_b;
-
- // Generate force and torque
- dynamics_->AddTorque_b(control_torque_b);
- dynamics_->AddForce_b(control_force_b);
-}
diff --git a/Tutorials/SampleCodes/MCSim/S2E_USER.cpp b/Tutorials/SampleCodes/MCSim/S2eUser.cpp
similarity index 82%
rename from Tutorials/SampleCodes/MCSim/S2E_USER.cpp
rename to Tutorials/SampleCodes/MCSim/S2eUser.cpp
index 53ab232f..3b05a0e6 100644
--- a/Tutorials/SampleCodes/MCSim/S2E_USER.cpp
+++ b/Tutorials/SampleCodes/MCSim/S2eUser.cpp
@@ -1,11 +1,9 @@
// Simulator includes
-#include "Initialize.h"
-#include "Logger.h"
-#include "SimulationCase.h"
-#include "MCSimExecutor.h"
+#include
+#include
// Add custom include files
-#include "./Simulation/Case/User_case.h"
+#include "./Simulation/Case/UserCase.hpp"
// degub print of initialize file path
void print_path(std::string path)
@@ -22,10 +20,10 @@ void print_path(std::string path)
}
// Main function
-int main(int argc, char* argv[])
+int main()
{
// Set initialize file
- std::string ini_file = "../../data/ini/User_SimBase.ini";
+ std::string ini_file = "../../data/ini/UserSimBase.ini";
MCSimExecutor* mc_sim = InitMCSim(ini_file);
Logger *log_mc_sim = InitLogMC(ini_file, mc_sim->IsEnabled());
diff --git a/Tutorials/SampleCodes/MCSim/User_case.cpp b/Tutorials/SampleCodes/MCSim/UserCase.cpp
similarity index 95%
rename from Tutorials/SampleCodes/MCSim/User_case.cpp
rename to Tutorials/SampleCodes/MCSim/UserCase.cpp
index eceef37f..202ea4b3 100644
--- a/Tutorials/SampleCodes/MCSim/User_case.cpp
+++ b/Tutorials/SampleCodes/MCSim/UserCase.cpp
@@ -1,5 +1,4 @@
-#include "User_case.h"
-#include "Initialize.h"
+#include "UserCase.hpp"
#include "SimulationObject.h"
UserCase::UserCase(std::string ini_fname, MCSimExecutor& mc_sim, const std::string log_path)
@@ -65,7 +64,7 @@ std::string UserCase::GetLogHeader() const
std::string str_tmp = "";
str_tmp += WriteScalar("time", "s");
str_tmp += WriteVector("Omega", "b", "rad/s", 3);
- str_tmp += WriteVector("quat", "i2b", "-", 4);
+ str_tmp += WriteVector("Quaternion", "i2b", "-", 4);
return str_tmp;
}
std::string UserCase::GetLogValue() const
diff --git a/Tutorials/SampleCodes/MCSim/User_case.h b/Tutorials/SampleCodes/MCSim/UserCase.hpp
similarity index 91%
rename from Tutorials/SampleCodes/MCSim/User_case.h
rename to Tutorials/SampleCodes/MCSim/UserCase.hpp
index 4fa20232..146aa979 100644
--- a/Tutorials/SampleCodes/MCSim/User_case.h
+++ b/Tutorials/SampleCodes/MCSim/UserCase.hpp
@@ -1,7 +1,7 @@
#pragma once
#include "SimulationCase.h"
-#include "../Spacecraft/User_sat.h"
+#include "../Spacecraft/UserSat.hpp"
#include "MCSimExecutor.h"
class UserCase: public SimulationCase
diff --git a/Tutorials/SampleCodes/MCSim/User_SimBase.ini b/Tutorials/SampleCodes/MCSim/UserSimBase.ini
similarity index 98%
rename from Tutorials/SampleCodes/MCSim/User_SimBase.ini
rename to Tutorials/SampleCodes/MCSim/UserSimBase.ini
index 67710a54..ec354772 100644
--- a/Tutorials/SampleCodes/MCSim/User_SimBase.ini
+++ b/Tutorials/SampleCodes/MCSim/UserSimBase.ini
@@ -74,26 +74,18 @@ TPC3 = ../../../ExtLibraries/cspice/generic_kernels/pck/pck00010.tpc
BSP = ../../../ExtLibraries/cspice/generic_kernels/spk/planets/de430.bsp
-[HIPPARCOS_CATALOGUE]
-catalogue_path = ../../../ExtLibraries/HipparcosCatalogue/hip_main.csv
-max_magnitude = 3.0 // Max magnitude to read from Hip catalog
-calculation = DISNABLE
-logging = DISABLE
-
-
[MC_EXECUTION]
// ENABLED or DISABLED
-MCSimEnabled = DISABLED
+MCSimEnabled = ENABLED
// When LogHistory=ENABLED, a default csv log file is outputted for each sample case.
// Note: When MCSimEnabled=ENABLED, a default csv log file will always be generated.
-LogHistory = DISABLED
+LogHistory = ENABLED
// Number of Monte Carlo executions
// The total calculation time is proportional with this value
NumOfExecutions = 5
-
[MC_RANDOMIZATION]
Param(0) = ATTITUDE0.Omega_b
ATTITUDE0.Omega_b.randomization_type = CartesianUniform
@@ -105,6 +97,13 @@ ATTITUDE0.Omega_b.sigma_or_max(1) = 0.05
ATTITUDE0.Omega_b.sigma_or_max(2) = 0.05
+[HIPPARCOS_CATALOGUE]
+catalogue_path = ../../../ExtLibraries/HipparcosCatalogue/hip_main.csv
+max_magnitude = 3.0 // Max magnitude to read from Hip catalog
+calculation = DISABLE
+logging = DISABLE
+
+
[RAND]
// Seed of randam. When this value is 0, the seed will be varied by time.
Rand_Seed = 0x11223344
diff --git a/Tutorials/SampleCodes/MultipleSatellites/data/UserSat1.ini b/Tutorials/SampleCodes/MultipleSatellites/data/UserSat1.ini
new file mode 100644
index 00000000..b1a18f27
--- /dev/null
+++ b/Tutorials/SampleCodes/MultipleSatellites/data/UserSat1.ini
@@ -0,0 +1,142 @@
+[ATTITUDE]
+// Attitude propagation mode
+// RK4 : Attitude Propagation with RK4 including disturbances and control torque
+// CONTROLLED : Attitude Calculation with Controlled Attitude mode. All disturbances and control torque are ignored.
+propagate_mode = RK4
+
+// Initial angular velocity at body frame,[rad/s]
+Omega_b(0) = 0.0
+Omega_b(1) = 0.0
+Omega_b(2) = 0.0
+
+// Initial quaternion,i->b,(real part,imaginary part)
+Quaternion_i2b(0) = 0.0
+Quaternion_i2b(1) = 0.0
+Quaternion_i2b(2) = 0.0
+Quaternion_i2b(3) = 1.0
+
+// Initial torque at body frame,[Nm]
+// Note: The initial torque added just for the first propagation step
+Torque_b(0) = +0.000
+Torque_b(1) = -0.000
+Torque_b(2) = 0.000
+
+[ControlledAttitude]
+// Mode definitions
+// INERTIAL_STABILIZE
+// SUN_POINTING
+// EARTH_CENTER_POINTING
+// VELOCITY_DIRECTION_POINTING
+// ORBIT_NORMAL_POINTING
+main_mode = INERTIAL_STABILIZE
+sub_mode = SUN_POINTING
+
+// Pointing direction @ body frame for main pointing mode
+pointing_t_b(0) = 0.707
+pointing_t_b(1) = 0.707
+pointing_t_b(2) = 0.0
+
+// Pointing direction @ body frame for sub pointing mode
+// pointing_t_b and pointing_sub_t_b should separate larger than 30 degrees.
+pointing_sub_t_b(0) = 0.0
+pointing_sub_t_b(1) = 0.0
+pointing_sub_t_b(2) = 1.0
+
+
+[ORBIT]
+calculation = ENABLE
+logging = ENABLE
+
+// Orbit propagation mode
+// RK4 : RK4 propagation with disturbances and thruster maneuver
+// SGP4 : SGP4 propagation using TLE without thruster maneuver
+// RELATIVE : Relative dynamics (for formation flying simulation)
+// KEPLER : Kepler orbit propagation without disturbances and thruster maneuver
+// ENCKE : Encke orbit propagation with disturbances and thruster maneuver
+propagate_mode = SGP4
+
+// Settings for SGP4 ///////////////////////////////////////////////
+// TLE
+// Example: ISS
+tle1=1 25544U 98067A 20076.51604214 .00016717 00000-0 10270-3 0 9005
+tle2=2 25544 51.6412 86.9962 0006063 30.9353 329.2153 15.49228202 17647
+wgs = 2 // 0: wgs72old, 1: wgs72, 2: wgs84
+//////////////////////////////////////////////////////////////////////////
+
+// Initial value definition for RK4 //////////////////////////////////////
+// *The coordinate system is defined in PlanetSelect.ini
+// Initial satellite position[m]
+init_position(0) = 4.2164140100E+07 // radius of GEO
+init_position(1) = 0
+init_position(2) = 0
+
+//initial satellite velocity[m/s]
+init_velocity(0) = 0
+init_velocity(1) = 3.074661E+03 // Speed of a spacecraft in GEO
+init_velocity(2) = 0
+///////////////////////////////////////////////////////////////////////////
+
+// Information used for relative orbit propagation//////////////////////////////
+// Relative Orbit Update Method (0 means RK4, 1 means STM)
+relative_orbit_update_method = 0
+// RK4 Relative Dynamics model type (only valid for RK4 update)
+// 0: Hill
+relative_dynamics_model_type = 0
+// STM Relative Dynamics model type (only valid for STM update)
+// 0: HCW
+stm_model_type = 0
+// Initial satellite position relative to the reference satellite in LVLH frame[m]
+// *The coordinate system is defined in PlanetSelect.ini
+init_relative_position_lvlh(0) = 0.0
+init_relative_position_lvlh(1) = 100.0
+init_relative_position_lvlh(2) = 0.0
+// initial satellite velocity relative to the reference satellite in LVLH frame[m/s]
+init_relative_velocity_lvlh(0) = 0.0
+init_relative_velocity_lvlh(1) = 0.0
+init_relative_velocity_lvlh(2) = 0.0
+// information of reference satellite
+reference_sat_id = 1
+///////////////////////////////////////////////////////////////////////////////
+
+
+// Information used for orbital propagation by the Kepler Motion ///////////
+// initialize mode for kepler motion
+// INIT_POSVEL : initialize with position and velocity defined for RK4
+// INIT_OE : initialize with the following orbital elements
+init_mode_kepler = INIT_POSVEL
+// Orbital Elements for INIT_OE
+semi_major_axis_m = 6794500.0
+eccentricity = 0.0015
+inclination_rad = 0.9012
+raan_rad = 0.1411
+arg_perigee_rad = 1.7952
+epoch_jday = 2.458940966402607e6
+///////////////////////////////////////////////////////////////////////////////
+
+
+// Information used for orbital propagation by the Encke Formulation ///////////
+error_tolerance = 0.0001
+// initialize position and vector are same with RK4 setting
+///////////////////////////////////////////////////////////////////////////////
+
+
+[Thermal]
+IsCalcEnabled=0
+debug=0
+
+[LOCAL_ENVIRONMENT]
+local_env_file = ../../data/ini/UserSat1LocalEnvironment.ini
+
+
+[DISTURBANCE]
+dist_file = ../../data/ini/UserSat1Disturbance.ini
+
+
+[STRUCTURE_FILE]
+structure_file = ../../data/ini/UserSat1Structure.ini
+
+
+[COMPONENTS_FILE]
+// Users can add the path for component initialize files here.
+gyro_file = ../../data/ini/components/GyroXxx.ini
+rw_file = ../../data/ini/components/RwXxx.ini
diff --git a/Tutorials/SampleCodes/s2e_user/data/ini/UserSat_Disturbance.ini b/Tutorials/SampleCodes/MultipleSatellites/data/UserSat1Disturbance.ini
similarity index 93%
rename from Tutorials/SampleCodes/s2e_user/data/ini/UserSat_Disturbance.ini
rename to Tutorials/SampleCodes/MultipleSatellites/data/UserSat1Disturbance.ini
index cc6cde4a..9e95346b 100644
--- a/Tutorials/SampleCodes/s2e_user/data/ini/UserSat_Disturbance.ini
+++ b/Tutorials/SampleCodes/MultipleSatellites/data/UserSat1Disturbance.ini
@@ -35,7 +35,7 @@ calculation = DISABLE
logging = ENABLE
// The number of gravity-generating bodies other than the central body
num_of_third_body = 1
-// ist of gravity-generating bodies other than the central body
+// List of gravity-generating bodies other than the central body
// All these bodies must be included in the "selected_body" of "PlanetSelect.ini"
third_body(0) = SUN
third_body(1) = MOON
diff --git a/Tutorials/SampleCodes/s2e_user/data/ini/UserSat_LocalEnvironment.ini b/Tutorials/SampleCodes/MultipleSatellites/data/UserSat1LocalEnvironment.ini
similarity index 100%
rename from Tutorials/SampleCodes/s2e_user/data/ini/UserSat_LocalEnvironment.ini
rename to Tutorials/SampleCodes/MultipleSatellites/data/UserSat1LocalEnvironment.ini
diff --git a/Tutorials/SampleCodes/s2e_user/data/ini/UserSat_Structure.ini b/Tutorials/SampleCodes/MultipleSatellites/data/UserSat1Structure.ini
similarity index 100%
rename from Tutorials/SampleCodes/s2e_user/data/ini/UserSat_Structure.ini
rename to Tutorials/SampleCodes/MultipleSatellites/data/UserSat1Structure.ini
diff --git a/Tutorials/SampleCodes/MultipleSatellites/data/UserSat2.ini b/Tutorials/SampleCodes/MultipleSatellites/data/UserSat2.ini
new file mode 100644
index 00000000..0ba49704
--- /dev/null
+++ b/Tutorials/SampleCodes/MultipleSatellites/data/UserSat2.ini
@@ -0,0 +1,142 @@
+[ATTITUDE]
+// Attitude propagation mode
+// RK4 : Attitude Propagation with RK4 including disturbances and control torque
+// CONTROLLED : Attitude Calculation with Controlled Attitude mode. All disturbances and control torque are ignored.
+propagate_mode = RK4
+
+// Initial angular velocity at body frame,[rad/s]
+Omega_b(0) = 0.0
+Omega_b(1) = 0.0
+Omega_b(2) = 0.0
+
+// Initial quaternion,i->b,(real part,imaginary part)
+Quaternion_i2b(0) = 0.0
+Quaternion_i2b(1) = 0.0
+Quaternion_i2b(2) = 0.0
+Quaternion_i2b(3) = 1.0
+
+// Initial torque at body frame,[Nm]
+// Note: The initial torque added just for the first propagation step
+Torque_b(0) = +0.000
+Torque_b(1) = -0.000
+Torque_b(2) = 0.000
+
+[ControlledAttitude]
+// Mode definitions
+// INERTIAL_STABILIZE
+// SUN_POINTING
+// EARTH_CENTER_POINTING
+// VELOCITY_DIRECTION_POINTING
+// ORBIT_NORMAL_POINTING
+main_mode = INERTIAL_STABILIZE
+sub_mode = SUN_POINTING
+
+// Pointing direction @ body frame for main pointing mode
+pointing_t_b(0) = 0.707
+pointing_t_b(1) = 0.707
+pointing_t_b(2) = 0.0
+
+// Pointing direction @ body frame for sub pointing mode
+// pointing_t_b and pointing_sub_t_b should separate larger than 30 degrees.
+pointing_sub_t_b(0) = 0.0
+pointing_sub_t_b(1) = 0.0
+pointing_sub_t_b(2) = 1.0
+
+
+[ORBIT]
+calculation = ENABLE
+logging = ENABLE
+
+// Orbit propagation mode
+// RK4 : RK4 propagation with disturbances and thruster maneuver
+// SGP4 : SGP4 propagation using TLE without thruster maneuver
+// RELATIVE : Relative dynamics (for formation flying simulation)
+// KEPLER : Kepler orbit propagation without disturbances and thruster maneuver
+// ENCKE : Encke orbit propagation with disturbances and thruster maneuver
+propagate_mode = SGP4
+
+// Settings for SGP4 ///////////////////////////////////////////////
+// TLE
+// Example: ISS
+tle1=1 25544U 98067A 20076.51604214 .00016717 00000-0 10270-3 0 9005
+tle2=2 25544 51.6412 86.9962 0006063 30.9353 329.2153 15.49228202 17647
+wgs = 2 // 0: wgs72old, 1: wgs72, 2: wgs84
+//////////////////////////////////////////////////////////////////////////
+
+// Initial value definition for RK4 //////////////////////////////////////
+// *The coordinate system is defined in PlanetSelect.ini
+// Initial satellite position[m]
+init_position(0) = 4.2164140100E+07 // radius of GEO
+init_position(1) = 0
+init_position(2) = 0
+
+//initial satellite velocity[m/s]
+init_velocity(0) = 0
+init_velocity(1) = 3.074661E+03 // Speed of a spacecraft in GEO
+init_velocity(2) = 0
+///////////////////////////////////////////////////////////////////////////
+
+// Information used for relative orbit propagation//////////////////////////////
+// Relative Orbit Update Method (0 means RK4, 1 means STM)
+relative_orbit_update_method = 0
+// RK4 Relative Dynamics model type (only valid for RK4 update)
+// 0: Hill
+relative_dynamics_model_type = 0
+// STM Relative Dynamics model type (only valid for STM update)
+// 0: HCW
+stm_model_type = 0
+// Initial satellite position relative to the reference satellite in LVLH frame[m]
+// *The coordinate system is defined in PlanetSelect.ini
+init_relative_position_lvlh(0) = 0.0
+init_relative_position_lvlh(1) = 100.0
+init_relative_position_lvlh(2) = 0.0
+// initial satellite velocity relative to the reference satellite in LVLH frame[m/s]
+init_relative_velocity_lvlh(0) = 0.0
+init_relative_velocity_lvlh(1) = 0.0
+init_relative_velocity_lvlh(2) = 0.0
+// information of reference satellite
+reference_sat_id = 1
+///////////////////////////////////////////////////////////////////////////////
+
+
+// Information used for orbital propagation by the Kepler Motion ///////////
+// initialize mode for kepler motion
+// INIT_POSVEL : initialize with position and velocity defined for RK4
+// INIT_OE : initialize with the following orbital elements
+init_mode_kepler = INIT_POSVEL
+// Orbital Elements for INIT_OE
+semi_major_axis_m = 6794500.0
+eccentricity = 0.0015
+inclination_rad = 0.9012
+raan_rad = 0.1411
+arg_perigee_rad = 1.7952
+epoch_jday = 2.458940966402607e6
+///////////////////////////////////////////////////////////////////////////////
+
+
+// Information used for orbital propagation by the Encke Formulation ///////////
+error_tolerance = 0.0001
+// initialize position and vector are same with RK4 setting
+///////////////////////////////////////////////////////////////////////////////
+
+
+[Thermal]
+IsCalcEnabled=0
+debug=0
+
+[LOCAL_ENVIRONMENT]
+local_env_file = ../../data/ini/UserSat2LocalEnvironment.ini
+
+
+[DISTURBANCE]
+dist_file = ../../data/ini/UserSat2Disturbance.ini
+
+
+[STRUCTURE_FILE]
+structure_file = ../../data/ini/UserSat2Structure.ini
+
+
+[COMPONENTS_FILE]
+// Users can add the path for component initialize files here.
+gyro_file = ../../data/ini/components/GyroXxx.ini
+rw_file = ../../data/ini/components/RwXxx.ini
diff --git a/Tutorials/SampleCodes/MultipleSatellites/data/UserSat2Disturbance.ini b/Tutorials/SampleCodes/MultipleSatellites/data/UserSat2Disturbance.ini
new file mode 100644
index 00000000..9e95346b
--- /dev/null
+++ b/Tutorials/SampleCodes/MultipleSatellites/data/UserSat2Disturbance.ini
@@ -0,0 +1,42 @@
+[GEOPOTENTIAL]
+calculation = DISABLE
+logging = ENABLE
+degree = 4
+file_path = ../../../ExtLibraries/GeoPotential/egm96_to360.ascii
+
+
+[MAG_DISTURBANCE]
+calculation = ENABLE
+logging = ENABLE
+
+
+[AIRDRAG]
+calculation = ENABLE
+logging = ENABLE
+// Condition of air drag
+Temp_wall = 30 // Surface Temperature[degC]
+Temp_molecular = 3 // Atmosphere Temperature[degC]
+// Note: they are converted in unit [K] inside the codes
+Molecular = 18.0 // Molecular weight of the thermosphere[g/mol]
+
+
+[SRDIST]
+calculation = ENABLE
+logging = ENABLE
+
+
+[GRAVITY_GRADIENT]
+calculation = ENABLE
+logging = ENABLE
+
+
+[THIRD_BODY_GRAVITY]
+calculation = DISABLE
+logging = ENABLE
+// The number of gravity-generating bodies other than the central body
+num_of_third_body = 1
+// List of gravity-generating bodies other than the central body
+// All these bodies must be included in the "selected_body" of "PlanetSelect.ini"
+third_body(0) = SUN
+third_body(1) = MOON
+third_body(2) = MARS
diff --git a/Tutorials/SampleCodes/MultipleSatellites/data/UserSat2LocalEnvironment.ini b/Tutorials/SampleCodes/MultipleSatellites/data/UserSat2LocalEnvironment.ini
new file mode 100644
index 00000000..22944d49
--- /dev/null
+++ b/Tutorials/SampleCodes/MultipleSatellites/data/UserSat2LocalEnvironment.ini
@@ -0,0 +1,34 @@
+[MAG_ENVIRONMENT]
+calculation = ENABLE
+logging = ENABLE
+coeff_file = ../../../s2e-core/src/Library/igrf/igrf13.coef
+mag_rwdev = 10.0 //Random Walk speed[nT]
+mag_rwlimit = 400.0 //Random Walk max limit[nT]
+mag_wnvar = 50.0 //White noise standard deviation [nT]
+
+
+[SRP]
+calculation = ENABLE
+logging = ENABLE
+
+
+[ATMOSPHERE]
+calculation = ENABLE
+logging = ENABLE
+
+// Atmosphere model
+// STANDARD: Model using scale height, NRLMSISE00: NRLMSISE00 model
+model = STANDARD
+nrlmsise00_table_path = ../../../ExtLibraries/nrlmsise00/table/SpaceWeather.txt
+// Whether using user-defined f10.7 and ap value
+// Ref of f10.7: https://www.swpc.noaa.gov/phenomena/f107-cm-radio-emissions
+// Ref of ap: http://wdc.kugi.kyoto-u.ac.jp/kp/kpexp-j.html
+is_manual_param_used = ENABLE
+manual_daily_f107 = 150.0 // User defined f10.7(1 day)
+manual_average_f107 = 150.0 // User defined f10.7(30 days average)
+manual_ap = 3.0 // User defined ap
+rho_stddev = 0.0 // Standard deviation of the air density
+
+
+[LOCAL_CELESTIAL_INFORMATION]
+logging = ENABLE
diff --git a/Tutorials/SampleCodes/MultipleSatellites/data/UserSat2Structure.ini b/Tutorials/SampleCodes/MultipleSatellites/data/UserSat2Structure.ini
new file mode 100644
index 00000000..7d64810d
--- /dev/null
+++ b/Tutorials/SampleCodes/MultipleSatellites/data/UserSat2Structure.ini
@@ -0,0 +1,115 @@
+//
+// The origin of all vectors defined here is the body-fixed frame.
+// Users can define the origin of the body-fixed frame by themselves.
+// If users want to define the origin as the center of gravity, they need to set cg_b = zero vector.
+// If users want to define the origin as a specific point, they need to set all vectors to suit their definition carefully.
+//
+
+[STRUCTURE]
+// Inertia Tensor @ body fixed frame [kg・m2]
+Iner(0) = 0.1 //I(0,0)
+Iner(1) = 0.0 //I(0,1)
+Iner(2) = 0.0 //I(0,2)
+Iner(3) = 0.0 //I(1,0)
+Iner(4) = 0.1 //I(1,1)
+Iner(5) = 0.0 //I(1,2)
+Iner(6) = 0.0 //I(2,0)
+Iner(7) = 0.0 //I(2,1)
+Iner(8) = 0.1 //I(2,2)
+
+mass = 14 //[kg]
+
+// Position vector of the center of gravity @ the body frame [m]
+cg_b(0) = 0.01
+cg_b(1) = 0.01
+cg_b(2) = 0.01
+
+[SURFACES]
+num_of_surfaces = 6
+
+// Area of each surface [m^2]
+area_0 = 0.25
+area_1 = 0.25
+area_2 = 0.25
+area_3 = 0.25
+area_4 = 0.25
+area_5 = 0.25
+
+// Position vector of each surface geometric center @ body frame [m]
+position_0(0) = 0.25
+position_0(1) = 0.0
+position_0(2) = 0.0
+position_1(0) = -0.25
+position_1(1) = 0.0
+position_1(2) = 0.0
+position_2(0) = 0.0
+position_2(1) = 0.25
+position_2(2) = 0.0
+position_3(0) = 0.0
+position_3(1) = -0.25
+position_3(2) = 0.0
+position_4(0) = 0.0
+position_4(1) = 0.0
+position_4(2) = 0.25
+position_5(0) = 0.0
+position_5(1) = 0.0
+position_5(2) = -0.25
+
+// Normal vector of each surface @ body frame
+normal_0(0) = 1.0
+normal_0(1) = 0.0
+normal_0(2) = 0.0
+normal_1(0) = -1.0
+normal_1(1) = 0.0
+normal_1(2) = 0.0
+normal_2(0) = 0.0
+normal_2(1) = 1.0
+normal_2(2) = 0.0
+normal_3(0) = 0.0
+normal_3(1) = -1.0
+normal_3(2) = 0.0
+normal_4(0) = 0.0
+normal_4(1) = 0.0
+normal_4(2) = 1.0
+normal_5(0) = 0.0
+normal_5(1) = 0.0
+normal_5(2) = -1.0
+
+// Total reflectance for the Sun spectrum
+reflectivity_0 = 0.4
+reflectivity_1 = 0.4
+reflectivity_2 = 0.4
+reflectivity_3 = 0.4
+reflectivity_4 = 0.4
+reflectivity_5 = 0.4
+
+// Specularity for the Sun spectrum
+specularity_0 = 0.4
+specularity_1 = 0.4
+specularity_2 = 0.4
+specularity_3 = 0.4
+specularity_4 = 0.4
+specularity_5 = 0.4
+
+// Specularity for air drag
+air_specularity_0 = 0.4
+air_specularity_1 = 0.4
+air_specularity_2 = 0.4
+air_specularity_3 = 0.4
+air_specularity_4 = 0.4
+air_specularity_5 = 0.4
+
+[RMM]
+// Constant component of Residual Magnetic Moment(RMM) [A・m^2]
+rmm_const_b(0) = 0.04
+rmm_const_b(1) = 0.04
+rmm_const_b(2) = 0.04
+
+// RMM Random Walk Speed [nT]
+rmm_rwdev = 1.0E-5
+
+// RMM Random Walk Limit [nT]
+rmm_rwlimit = 1.0E-3
+
+// RMM White Noise Standard deviation [nT]
+rmm_wnvar = 5.0E-5
diff --git a/Tutorials/SampleCodes/MultipleSatellites/data/UserSimBase.ini b/Tutorials/SampleCodes/MultipleSatellites/data/UserSimBase.ini
new file mode 100644
index 00000000..c785622d
--- /dev/null
+++ b/Tutorials/SampleCodes/MultipleSatellites/data/UserSimBase.ini
@@ -0,0 +1,122 @@
+[TIME]
+// Simulation start date [UTC]
+StartYMDHMS=2020/01/01 12:00:00.0
+
+// Simulation finish time [sec]
+EndTimeSec=200
+
+// Simulation step time [sec]
+// Minimum time step for the entire simulation
+StepTimeSec=0.1
+
+// Attitude Update Period [sec]
+// Attitude is updated at the period specified here
+AttitudeUpdateIntervalSec=0.1 // should be larger than StepTimeSec
+
+// Attitide Δt for Runge-Kutt method [sec]
+// This must be smaller than "AttitudeUpdateIntervalSec"
+AttitudeRKStepSec = 0.001
+
+// Orbit Update Period [sec]
+// Orbit is updated at the period specified here
+OrbitUpdateIntervalSec = 0.1 // should be larger than StepTimeSec
+
+// Orbit Δt for Runge-Kutta method [sec]
+// This must be smaller than "OrbitUpdateIntervalSec"
+OrbitRKStepSec = 0.1
+
+// Thermal Update Period [sec]
+// Thermal is updated at the period specified here
+ThermalUpdateIntervalSec = 0.1 // should be larger than StepTimeSec
+
+// Thermal Δt for Runge-Kutta method [sec]
+// This must be smaller than "ThermalUpdateIntervalSec"
+ThermalRKStepSec = 0.1
+
+// Component Update Period [sec]
+CompoUpdateIntervalSec = 0.1 // should be larger than StepTimeSec
+
+// Log Output Period [sec]
+LogOutPutIntervalSec = 0.1 // should be larger than StepTimeSec
+
+// Simulation speed
+// 0: as fast as possible, 1: real-time, >1: faster than real-time, <1: slower than real-time
+SimulationSpeed = 0
+
+
+[PLANET_SELECTION]
+// Whether global celestial information is logged or not
+logging = ENABLE
+
+// Definition of Inertial frame
+inertial_frame = J2000
+aberration_correction = NONE
+center_object = EARTH
+
+// Earth Rotation model
+// Idle:no motion,Simple:rotation only,Full:full-dynamics
+rotation_mode = Simple
+
+// Definition of calculation celestial bodies
+num_of_selected_body = 3
+selected_body(0) = EARTH
+selected_body(1) = SUN
+selected_body(2) = MOON
+selected_body(3) = MARS
+
+
+[FURNSH_PATH]
+// CSPICE Kernel files definition
+TLS = ../../../ExtLibraries/cspice/generic_kernels/lsk/naif0010.tls
+TPC1 = ../../../ExtLibraries/cspice/generic_kernels/pck/de-403-masses.tpc
+TPC2 = ../../../ExtLibraries/cspice/generic_kernels/pck/gm_de431.tpc
+TPC3 = ../../../ExtLibraries/cspice/generic_kernels/pck/pck00010.tpc
+BSP = ../../../ExtLibraries/cspice/generic_kernels/spk/planets/de430.bsp
+
+
+[MC_EXECUTION]
+// ENABLED or DISABLED
+MCSimEnabled = DISABLED
+
+// When LogHistory=ENABLED, a default csv log file is outputted for each sample case.
+// Note: When MCSimEnabled=ENABLED, a default csv log file will always be generated.
+LogHistory = ENABLED
+
+// Number of Monte Carlo executions
+// The total calculation time is proportional with this value
+NumOfExecutions = 5
+
+[MC_RANDOMIZATION]
+Param(0) = ATTITUDE0.Omega_b
+ATTITUDE0.Omega_b.randomization_type = CartesianUniform
+ATTITUDE0.Omega_b.mean_or_min(0) = 0.0
+ATTITUDE0.Omega_b.mean_or_min(1) = 0.0
+ATTITUDE0.Omega_b.mean_or_min(2) = 0.0
+ATTITUDE0.Omega_b.sigma_or_max(0) = 0.05
+ATTITUDE0.Omega_b.sigma_or_max(1) = 0.05
+ATTITUDE0.Omega_b.sigma_or_max(2) = 0.05
+
+
+[HIPPARCOS_CATALOGUE]
+catalogue_path = ../../../ExtLibraries/HipparcosCatalogue/hip_main.csv
+max_magnitude = 3.0 // Max magnitude to read from Hip catalog
+calculation = DISABLE
+logging = DISABLE
+
+
+[RAND]
+// Seed of randam. When this value is 0, the seed will be varied by time.
+Rand_Seed = 0x11223344
+
+
+[SIM_SETTING]
+// Whether the ini files are saved or not
+log_inifile = 1
+
+// Initialize files
+// File name must not over 256 characters (defined in initialize.h as MAX_CHAR_NUM)
+// If you want to add a spacecraft, create the corresponding Sat.ini, and specify it as sat_file(1), sat_file(2)... .
+num_of_simulated_spacecraft = 2
+sat_file(0) = ../../data/ini/UserSat1.ini
+sat_file(1) = ../../data/ini/UserSat2.ini
+log_file_path = ../../data/logs/
diff --git a/Tutorials/SampleCodes/C2A_Integration/S2E_src/CMakeLists.txt b/Tutorials/SampleCodes/s2e-user/CMakeLists.txt
similarity index 90%
rename from Tutorials/SampleCodes/C2A_Integration/S2E_src/CMakeLists.txt
rename to Tutorials/SampleCodes/s2e-user/CMakeLists.txt
index 4fca508f..b8c77f30 100644
--- a/Tutorials/SampleCodes/C2A_Integration/S2E_src/CMakeLists.txt
+++ b/Tutorials/SampleCodes/s2e-user/CMakeLists.txt
@@ -1,15 +1,16 @@
+## General Settings
cmake_policy(SET CMP0048 NEW)
-project(S2E_FOR_C2A_CORE
+project(S2E_USER
LANGUAGES CXX
- DESCRIPTION "S2E_FOR_C2A_CORE"
- VERSION 1.0
+ DESCRIPTION "s2e-user: A sample of S2E User Side"
+ VERSION 5.0.0
)
cmake_minimum_required(VERSION 3.13)
# build config
option(USE_HILS "Use HILS" OFF)
-option(USE_C2A "Use C2A" ON)
+option(USE_C2A "Use C2A" OFF)
# preprocessor
if(WIN32)
@@ -28,7 +29,7 @@ if(NOT DEFINED FLIGHT_SW_DIR)
set(FLIGHT_SW_DIR ../FlightSW)
endif()
if(NOT DEFINED C2A_NAME)
- set(C2A_NAME "c2a-core/Examples/minimum_user_for_s2e")
+ set(C2A_NAME "c2a_oss")
endif()
## options to use C2A
@@ -56,9 +57,7 @@ if(USE_HILS AND WIN32)
message(${WS2_32_LIB})
endif()
-set(S2E_DIR ${CMAKE_CURRENT_COURCE_DIR})
-
-## include directories of S2E-CORE
+## include directories of s2e-core
include_directories(${CSPICE_DIR}/include)
include_directories(${NRLMSISE00_DIR}/src)
include_directories(${S2E_CORE_DIR}/src)
@@ -112,10 +111,10 @@ add_subdirectory(${S2E_CORE_DIR}/src/Library/Geodesy S2E_CORE/Geodesy)
add_subdirectory(${S2E_CORE_DIR}/src/Simulation S2E_CORE/Simulation)
set(SOURCE_FILES
- src/s2e_for_c2a_core.cpp
- src/Simulation/Case/c2a_core_sample_case.cpp
- src/Simulation/Spacecraft/c2a_core_sample_sat.cpp
- src/Simulation/Spacecraft/c2a_core_sample_components.cpp
+ src/S2eUser.cpp
+ src/Simulation/Case/UserCase.cpp
+ src/Simulation/Spacecraft/UserSat.cpp
+ src/Simulation/Spacecraft/UserComponents.cpp
)
# Create executable file
add_executable(${PROJECT_NAME} ${SOURCE_FILES})
@@ -125,19 +124,16 @@ if(CYGWIN)
SET (CMAKE_FIND_LIBRARY_SUFFIXES ".so" ".a")
find_library(CSPICE_LIB
NAMES cspice.a csupport.a
- PATHS ${CSPICE_DIR}/cspice_cygwin/lib
- )
+ PATHS ${CSPICE_DIR}/cspice_cygwin/lib)
elseif(UNIX)
find_library(CSPICE_LIB
NAMES cspice.a csupport.a
- PATHS ${CSPICE_DIR}/cspice_unix/lib
- )
+ PATHS ${CSPICE_DIR}/cspice_unix/lib)
elseif(WIN32)
SET (CMAKE_FIND_LIBRARY_SUFFIXES ".lib")
find_library(CSPICE_LIB
NAMES cspice.lib csupport.lib
- PATHS ${CSPICE_DIR}/cspice_msvs/lib
- )
+ PATHS ${CSPICE_DIR}/cspice_msvs/lib)
endif()
if(NOT CSPICE_LIB)
message(FATAL_ERROR "cspice not found in ${EXT_LIB_DIR}")
@@ -146,21 +142,18 @@ endif()
## nrlmsise00 library
if(CYGWIN)
SET (CMAKE_FIND_LIBRARY_SUFFIXES ".a")
- find_library(NRLMSISE00_LIB
+ find_library(NRLMSISE00_LIB
NAMES libnrlmsise00.a
- PATHS ${NRLMSISE00_DIR}/lib
- )
+ PATHS ${NRLMSISE00_DIR}/lib)
elseif(UNIX)
- find_library(NRLMSISE00_LIB
+ find_library(NRLMSISE00_LIB
NAMES libnrlmsise00.a
- PATHS ${NRLMSISE00_DIR}/lib
- )
+ PATHS ${NRLMSISE00_DIR}/lib)
elseif(WIN32)
SET (CMAKE_FIND_LIBRARY_SUFFIXES ".lib")
- find_library(NRLMSISE00_LIB
+ find_library(NRLMSISE00_LIB
NAMES libnrlmsise00.lib
- PATHS ${NRLMSISE00_DIR}/lib
- )
+ PATHS ${NRLMSISE00_DIR}/lib)
endif()
if(NOT NRLMSISE00_LIB)
message(FATAL_ERROR "nrlmsise00 not found in ${EXT_LIB_DIR}")
@@ -211,4 +204,4 @@ endif()
message("Cspice_LIB: " ${CSPICE_LIB})
message("nrlmsise00_LIB: " ${NRLMSISE00_LIB})
-include(common.cmake)
+include(${S2E_CORE_DIR}/common.cmake)
diff --git a/Tutorials/SampleCodes/s2e_user/CMakeSettings.json b/Tutorials/SampleCodes/s2e-user/CMakeSettings.json
similarity index 89%
rename from Tutorials/SampleCodes/s2e_user/CMakeSettings.json
rename to Tutorials/SampleCodes/s2e-user/CMakeSettings.json
index 431847fb..54477e50 100644
--- a/Tutorials/SampleCodes/s2e_user/CMakeSettings.json
+++ b/Tutorials/SampleCodes/s2e-user/CMakeSettings.json
@@ -2,7 +2,7 @@
"configurations": [
{
"name": "Win32",
- "generator": "Visual Studio 16 2019",
+ "generator": "Visual Studio 17 2022",
"configurationType": "Debug",
"inheritEnvironments": [
"msvc_x86"
diff --git a/Tutorials/SampleCodes/s2e_user/data/ini/components/Gyro_xxx.ini b/Tutorials/SampleCodes/s2e-user/data/ini/Components/GyroXxx.ini
similarity index 100%
rename from Tutorials/SampleCodes/s2e_user/data/ini/components/Gyro_xxx.ini
rename to Tutorials/SampleCodes/s2e-user/data/ini/Components/GyroXxx.ini
diff --git a/Tutorials/SampleCodes/s2e_user/data/ini/UserSat.ini b/Tutorials/SampleCodes/s2e-user/data/ini/UserSat.ini
similarity index 60%
rename from Tutorials/SampleCodes/s2e_user/data/ini/UserSat.ini
rename to Tutorials/SampleCodes/s2e-user/data/ini/UserSat.ini
index 35751dd2..d9788b97 100644
--- a/Tutorials/SampleCodes/s2e_user/data/ini/UserSat.ini
+++ b/Tutorials/SampleCodes/s2e-user/data/ini/UserSat.ini
@@ -1,7 +1,8 @@
[ATTITUDE]
// Attitude propagation mode
-// 0: RK4, 1: ControlledAttitude
-propagate_mode = 0
+// RK4 : Attitude Propagation with RK4 including disturbances and control torque
+// CONTROLLED : Attitude Calculation with Controlled Attitude mode. All disturbances and control torque are ignored.
+propagate_mode = RK4
// Initial angular velocity at body frame,[rad/s]
Omega_b(0) = 0.0
@@ -20,22 +21,15 @@ Torque_b(0) = +0.000
Torque_b(1) = -0.000
Torque_b(2) = 0.000
-
[ControlledAttitude]
// Mode definitions
-// INERTIAL_STABILIZE = 0,
-// SUN_POINTING = 1,
-// EARTH_CENTER_POINTING = 2
-// VELOCITY_DIRECTION_POINTING = 3,
-// ORBIT_NORMAL_POINTING = 4,
-main_mode = 3
-sub_mode = 1
-
-// Target Quaternion for INERTIAL_STABILIZE mode,(real part,imaginary part)
-quaternion_i2t(0) = 0.5
-quaternion_i2t(1) = 0.5
-quaternion_i2t(2) = 0.5
-quaternion_i2t(3) = 0.5
+// INERTIAL_STABILIZE
+// SUN_POINTING
+// EARTH_CENTER_POINTING
+// VELOCITY_DIRECTION_POINTING
+// ORBIT_NORMAL_POINTING
+main_mode = INERTIAL_STABILIZE
+sub_mode = SUN_POINTING
// Pointing direction @ body frame for main pointing mode
pointing_t_b(0) = 0.707
@@ -54,13 +48,16 @@ calculation = ENABLE
logging = ENABLE
// Orbit propagation mode
-// 0: RK4 with initial position and velocity
-// 1: SGP4 with TLE
-// 2: Relative dynamics (for formation flying simulation)
-propagate_mode = 1
-
-// TLE definition for SGP4 ///////////////////////////////////////////////
-// ISS
+// RK4 : RK4 propagation with disturbances and thruster maneuver
+// SGP4 : SGP4 propagation using TLE without thruster maneuver
+// RELATIVE : Relative dynamics (for formation flying simulation)
+// KEPLER : Kepler orbit propagation without disturbances and thruster maneuver
+// ENCKE : Encke orbit propagation with disturbances and thruster maneuver
+propagate_mode = SGP4
+
+// Settings for SGP4 ///////////////////////////////////////////////
+// TLE
+// Example: ISS
tle1=1 25544U 98067A 20076.51604214 .00016717 00000-0 10270-3 0 9005
tle2=2 25544 51.6412 86.9962 0006063 30.9353 329.2153 15.49228202 17647
wgs = 2 // 0: wgs72old, 1: wgs72, 2: wgs84
@@ -102,21 +99,41 @@ reference_sat_id = 1
///////////////////////////////////////////////////////////////////////////////
+// Information used for orbital propagation by the Kepler Motion ///////////
+// initialize mode for kepler motion
+// INIT_POSVEL : initialize with position and velocity defined for RK4
+// INIT_OE : initialize with the following orbital elements
+init_mode_kepler = INIT_POSVEL
+// Orbital Elements for INIT_OE
+semi_major_axis_m = 6794500.0
+eccentricity = 0.0015
+inclination_rad = 0.9012
+raan_rad = 0.1411
+arg_perigee_rad = 1.7952
+epoch_jday = 2.458940966402607e6
+///////////////////////////////////////////////////////////////////////////////
+
+
+// Information used for orbital propagation by the Encke Formulation ///////////
+error_tolerance = 0.0001
+// initialize position and vector are same with RK4 setting
+///////////////////////////////////////////////////////////////////////////////
+
+
[Thermal]
IsCalcEnabled=0
debug=0
-thrm_file = ../../data/ini/Thermal_CSV/
[LOCAL_ENVIRONMENT]
-local_env_file = ../../data/ini/UserSat_LocalEnvironment.ini
+local_env_file = ../../data/ini/UserSatLocalEnvironment.ini
[DISTURBANCE]
-dist_file = ../../data/ini/UserSat_Disturbance.ini
+dist_file = ../../data/ini/UserSatDisturbance.ini
[STRUCTURE_FILE]
-structure_file = ../../data/ini/UserSat_Structure.ini
+structure_file = ../../data/ini/UserSatStructure.ini
[COMPONENTS_FILE]
diff --git a/Tutorials/SampleCodes/s2e-user/data/ini/UserSatDisturbance.ini b/Tutorials/SampleCodes/s2e-user/data/ini/UserSatDisturbance.ini
new file mode 100644
index 00000000..9e95346b
--- /dev/null
+++ b/Tutorials/SampleCodes/s2e-user/data/ini/UserSatDisturbance.ini
@@ -0,0 +1,42 @@
+[GEOPOTENTIAL]
+calculation = DISABLE
+logging = ENABLE
+degree = 4
+file_path = ../../../ExtLibraries/GeoPotential/egm96_to360.ascii
+
+
+[MAG_DISTURBANCE]
+calculation = ENABLE
+logging = ENABLE
+
+
+[AIRDRAG]
+calculation = ENABLE
+logging = ENABLE
+// Condition of air drag
+Temp_wall = 30 // Surface Temperature[degC]
+Temp_molecular = 3 // Atmosphere Temperature[degC]
+// Note: they are converted in unit [K] inside the codes
+Molecular = 18.0 // Molecular weight of the thermosphere[g/mol]
+
+
+[SRDIST]
+calculation = ENABLE
+logging = ENABLE
+
+
+[GRAVITY_GRADIENT]
+calculation = ENABLE
+logging = ENABLE
+
+
+[THIRD_BODY_GRAVITY]
+calculation = DISABLE
+logging = ENABLE
+// The number of gravity-generating bodies other than the central body
+num_of_third_body = 1
+// List of gravity-generating bodies other than the central body
+// All these bodies must be included in the "selected_body" of "PlanetSelect.ini"
+third_body(0) = SUN
+third_body(1) = MOON
+third_body(2) = MARS
diff --git a/Tutorials/SampleCodes/s2e-user/data/ini/UserSatLocalEnvironment.ini b/Tutorials/SampleCodes/s2e-user/data/ini/UserSatLocalEnvironment.ini
new file mode 100644
index 00000000..22944d49
--- /dev/null
+++ b/Tutorials/SampleCodes/s2e-user/data/ini/UserSatLocalEnvironment.ini
@@ -0,0 +1,34 @@
+[MAG_ENVIRONMENT]
+calculation = ENABLE
+logging = ENABLE
+coeff_file = ../../../s2e-core/src/Library/igrf/igrf13.coef
+mag_rwdev = 10.0 //Random Walk speed[nT]
+mag_rwlimit = 400.0 //Random Walk max limit[nT]
+mag_wnvar = 50.0 //White noise standard deviation [nT]
+
+
+[SRP]
+calculation = ENABLE
+logging = ENABLE
+
+
+[ATMOSPHERE]
+calculation = ENABLE
+logging = ENABLE
+
+// Atmosphere model
+// STANDARD: Model using scale height, NRLMSISE00: NRLMSISE00 model
+model = STANDARD
+nrlmsise00_table_path = ../../../ExtLibraries/nrlmsise00/table/SpaceWeather.txt
+// Whether using user-defined f10.7 and ap value
+// Ref of f10.7: https://www.swpc.noaa.gov/phenomena/f107-cm-radio-emissions
+// Ref of ap: http://wdc.kugi.kyoto-u.ac.jp/kp/kpexp-j.html
+is_manual_param_used = ENABLE
+manual_daily_f107 = 150.0 // User defined f10.7(1 day)
+manual_average_f107 = 150.0 // User defined f10.7(30 days average)
+manual_ap = 3.0 // User defined ap
+rho_stddev = 0.0 // Standard deviation of the air density
+
+
+[LOCAL_CELESTIAL_INFORMATION]
+logging = ENABLE
diff --git a/Tutorials/SampleCodes/s2e-user/data/ini/UserSatStructure.ini b/Tutorials/SampleCodes/s2e-user/data/ini/UserSatStructure.ini
new file mode 100644
index 00000000..7d64810d
--- /dev/null
+++ b/Tutorials/SampleCodes/s2e-user/data/ini/UserSatStructure.ini
@@ -0,0 +1,115 @@
+//
+// The origin of all vectors defined here is the body-fixed frame.
+// Users can define the origin of the body-fixed frame by themselves.
+// If users want to define the origin as the center of gravity, they need to set cg_b = zero vector.
+// If users want to define the origin as a specific point, they need to set all vectors to suit their definition carefully.
+//
+
+[STRUCTURE]
+// Inertia Tensor @ body fixed frame [kg・m2]
+Iner(0) = 0.1 //I(0,0)
+Iner(1) = 0.0 //I(0,1)
+Iner(2) = 0.0 //I(0,2)
+Iner(3) = 0.0 //I(1,0)
+Iner(4) = 0.1 //I(1,1)
+Iner(5) = 0.0 //I(1,2)
+Iner(6) = 0.0 //I(2,0)
+Iner(7) = 0.0 //I(2,1)
+Iner(8) = 0.1 //I(2,2)
+
+mass = 14 //[kg]
+
+// Position vector of the center of gravity @ the body frame [m]
+cg_b(0) = 0.01
+cg_b(1) = 0.01
+cg_b(2) = 0.01
+
+[SURFACES]
+num_of_surfaces = 6
+
+// Area of each surface [m^2]
+area_0 = 0.25
+area_1 = 0.25
+area_2 = 0.25
+area_3 = 0.25
+area_4 = 0.25
+area_5 = 0.25
+
+// Position vector of each surface geometric center @ body frame [m]
+position_0(0) = 0.25
+position_0(1) = 0.0
+position_0(2) = 0.0
+position_1(0) = -0.25
+position_1(1) = 0.0
+position_1(2) = 0.0
+position_2(0) = 0.0
+position_2(1) = 0.25
+position_2(2) = 0.0
+position_3(0) = 0.0
+position_3(1) = -0.25
+position_3(2) = 0.0
+position_4(0) = 0.0
+position_4(1) = 0.0
+position_4(2) = 0.25
+position_5(0) = 0.0
+position_5(1) = 0.0
+position_5(2) = -0.25
+
+// Normal vector of each surface @ body frame
+normal_0(0) = 1.0
+normal_0(1) = 0.0
+normal_0(2) = 0.0
+normal_1(0) = -1.0
+normal_1(1) = 0.0
+normal_1(2) = 0.0
+normal_2(0) = 0.0
+normal_2(1) = 1.0
+normal_2(2) = 0.0
+normal_3(0) = 0.0
+normal_3(1) = -1.0
+normal_3(2) = 0.0
+normal_4(0) = 0.0
+normal_4(1) = 0.0
+normal_4(2) = 1.0
+normal_5(0) = 0.0
+normal_5(1) = 0.0
+normal_5(2) = -1.0
+
+// Total reflectance for the Sun spectrum
+reflectivity_0 = 0.4
+reflectivity_1 = 0.4
+reflectivity_2 = 0.4
+reflectivity_3 = 0.4
+reflectivity_4 = 0.4
+reflectivity_5 = 0.4
+
+// Specularity for the Sun spectrum
+specularity_0 = 0.4
+specularity_1 = 0.4
+specularity_2 = 0.4
+specularity_3 = 0.4
+specularity_4 = 0.4
+specularity_5 = 0.4
+
+// Specularity for air drag
+air_specularity_0 = 0.4
+air_specularity_1 = 0.4
+air_specularity_2 = 0.4
+air_specularity_3 = 0.4
+air_specularity_4 = 0.4
+air_specularity_5 = 0.4
+
+[RMM]
+// Constant component of Residual Magnetic Moment(RMM) [A・m^2]
+rmm_const_b(0) = 0.04
+rmm_const_b(1) = 0.04
+rmm_const_b(2) = 0.04
+
+// RMM Random Walk Speed [nT]
+rmm_rwdev = 1.0E-5
+
+// RMM Random Walk Limit [nT]
+rmm_rwlimit = 1.0E-3
+
+// RMM White Noise Standard deviation [nT]
+rmm_wnvar = 5.0E-5
diff --git a/Tutorials/SampleCodes/s2e_user/data/ini/User_SimBase.ini b/Tutorials/SampleCodes/s2e-user/data/ini/UserSimBase.ini
similarity index 100%
rename from Tutorials/SampleCodes/s2e_user/data/ini/User_SimBase.ini
rename to Tutorials/SampleCodes/s2e-user/data/ini/UserSimBase.ini
diff --git a/Tutorials/SampleCodes/s2e_user/data/logs/.gitkeep b/Tutorials/SampleCodes/s2e-user/data/logs/.gitkeep
similarity index 100%
rename from Tutorials/SampleCodes/s2e_user/data/logs/.gitkeep
rename to Tutorials/SampleCodes/s2e-user/data/logs/.gitkeep
diff --git a/Tutorials/SampleCodes/s2e_user/src/S2E_USER.cpp b/Tutorials/SampleCodes/s2e-user/src/S2eUser.cpp
similarity index 73%
rename from Tutorials/SampleCodes/s2e_user/src/S2E_USER.cpp
rename to Tutorials/SampleCodes/s2e-user/src/S2eUser.cpp
index 75ed20a5..43e2cf8a 100644
--- a/Tutorials/SampleCodes/s2e_user/src/S2E_USER.cpp
+++ b/Tutorials/SampleCodes/s2e-user/src/S2eUser.cpp
@@ -1,10 +1,8 @@
// Simulator includes
-#include "Initialize.h"
-#include "Logger.h"
-#include "SimulationCase.h"
+#include "Interface/LogOutput/Logger.h"
// Add custom include files
-#include "./Simulation/Case/User_case.h"
+#include "./Simulation/Case/UserCase.hpp"
// degub print of initialize file path
void print_path(std::string path)
@@ -21,10 +19,10 @@ void print_path(std::string path)
}
// Main function
-int main(int argc, char* argv[])
+int main()
{
// Set initialize file
- std::string ini_file = "../../data/ini/User_SimBase.ini";
+ std::string ini_file = "../../data/ini/UserSimBase.ini";
std::cout << "Starting simulation..." << std::endl;
std::cout << "\tIni file: ";
diff --git a/Tutorials/SampleCodes/s2e_user/src/Simulation/Case/User_case.cpp b/Tutorials/SampleCodes/s2e-user/src/Simulation/Case/UserCase.cpp
similarity index 96%
rename from Tutorials/SampleCodes/s2e_user/src/Simulation/Case/User_case.cpp
rename to Tutorials/SampleCodes/s2e-user/src/Simulation/Case/UserCase.cpp
index deabf20f..673d7744 100644
--- a/Tutorials/SampleCodes/s2e_user/src/Simulation/Case/User_case.cpp
+++ b/Tutorials/SampleCodes/s2e-user/src/Simulation/Case/UserCase.cpp
@@ -1,5 +1,4 @@
-#include "User_case.h"
-#include "Initialize.h"
+#include "UserCase.hpp"
UserCase::UserCase(std::string ini_fname)
: SimulationCase(ini_fname)
diff --git a/Tutorials/SampleCodes/s2e_user/src/Simulation/Case/User_case.h b/Tutorials/SampleCodes/s2e-user/src/Simulation/Case/UserCase.hpp
similarity index 89%
rename from Tutorials/SampleCodes/s2e_user/src/Simulation/Case/User_case.h
rename to Tutorials/SampleCodes/s2e-user/src/Simulation/Case/UserCase.hpp
index 82e0812c..ce99b09d 100644
--- a/Tutorials/SampleCodes/s2e_user/src/Simulation/Case/User_case.h
+++ b/Tutorials/SampleCodes/s2e-user/src/Simulation/Case/UserCase.hpp
@@ -1,7 +1,7 @@
#pragma once
#include "SimulationCase.h"
-#include "../Spacecraft/User_sat.h"
+#include "../Spacecraft/UserSat.hpp"
class UserCase: public SimulationCase
{
diff --git a/Tutorials/SampleCodes/s2e_user/src/Simulation/Spacecraft/User_Components.cpp b/Tutorials/SampleCodes/s2e-user/src/Simulation/Spacecraft/UserComponents.cpp
similarity index 56%
rename from Tutorials/SampleCodes/s2e_user/src/Simulation/Spacecraft/User_Components.cpp
rename to Tutorials/SampleCodes/s2e-user/src/Simulation/Spacecraft/UserComponents.cpp
index ee51e96c..1044a071 100644
--- a/Tutorials/SampleCodes/s2e_user/src/Simulation/Spacecraft/User_Components.cpp
+++ b/Tutorials/SampleCodes/s2e-user/src/Simulation/Spacecraft/UserComponents.cpp
@@ -1,5 +1,6 @@
-#include "User_Components.h"
-#include "Initialize.h"
+#include "UserComponents.hpp"
+
+#include
UserComponents::UserComponents(
const Dynamics* dynamics,
@@ -7,37 +8,34 @@ UserComponents::UserComponents(
const LocalEnvironment* local_env,
const GlobalEnvironment* glo_env,
const SimulationConfig* config,
- ClockGenerator* clock_gen,
- const int sat_id
+ ClockGenerator* clock_gen
):dynamics_(dynamics), structure_(structure), local_env_(local_env), glo_env_(glo_env), config_(config)
{
- IniAccess iniAccess = IniAccess(config->sat_file_[0]);
- double compo_step_sec = glo_env_->GetSimTime().GetCompoStepSec();
-
obc_ = new OBC(clock_gen);
}
UserComponents::~UserComponents()
{
- delete obc_;
// OBC must be deleted the last since it has com ports
+ delete obc_;
}
-Vector<3> UserComponents::GenerateForce_b()
+Vector<3> UserComponents::GenerateForce_N_b()
{
// There is no orbit control component, so it remains 0
- Vector<3> force_b_(0.0);
- return force_b_;
-};
+ Vector<3> force_N_b_(0.0);
+ return force_N_b_;
+}
-Vector<3> UserComponents::GenerateTorque_b()
+Vector<3> UserComponents::GenerateTorque_Nm_b()
{
// No attitude control component
- Vector<3> torque_b_(0.0);
- return torque_b_;
-};
+ Vector<3> torque_Nm_b_(0.0);
+ return torque_Nm_b_;
+}
-void UserComponents::CompoLogSetUp(Logger & logger)
+void UserComponents::LogSetup(Logger & logger)
{
// Users can set log output when they need component log
+ UNUSED(logger);
}
diff --git a/Tutorials/SampleCodes/s2e_user/src/Simulation/Spacecraft/User_Components.h b/Tutorials/SampleCodes/s2e-user/src/Simulation/Spacecraft/UserComponents.hpp
similarity index 71%
rename from Tutorials/SampleCodes/s2e_user/src/Simulation/Spacecraft/User_Components.h
rename to Tutorials/SampleCodes/s2e-user/src/Simulation/Spacecraft/UserComponents.hpp
index 46be40d4..a7a617a9 100644
--- a/Tutorials/SampleCodes/s2e_user/src/Simulation/Spacecraft/User_Components.h
+++ b/Tutorials/SampleCodes/s2e-user/src/Simulation/Spacecraft/UserComponents.hpp
@@ -1,14 +1,16 @@
#pragma once
-#include "Vector.hpp"
+#include
+
#include "Dynamics.h"
#include "GlobalEnvironment.h"
#include "LocalEnvironment.h"
+#include "Vector.hpp"
// include for components
#include "OBC.h"
-class UserComponents
+class UserComponents : public InstalledComponents
{
public:
UserComponents(
@@ -17,13 +19,13 @@ class UserComponents
const LocalEnvironment* local_env,
const GlobalEnvironment* glo_env,
const SimulationConfig* config,
- ClockGenerator* clock_gen,
- const int sat_id
+ ClockGenerator* clock_gen
);
~UserComponents();
- libra::Vector<3> GenerateForce_b();
- libra::Vector<3> GenerateTorque_b();
- void CompoLogSetUp(Logger& logger);
+ libra::Vector<3> GenerateForce_N_b();
+ libra::Vector<3> GenerateTorque_Nm_b();
+ void LogSetup(Logger& logger);
+
private:
// Components
OBC* obc_;
diff --git a/Tutorials/SampleCodes/s2e-user/src/Simulation/Spacecraft/UserSat.cpp b/Tutorials/SampleCodes/s2e-user/src/Simulation/Spacecraft/UserSat.cpp
new file mode 100644
index 00000000..33341b48
--- /dev/null
+++ b/Tutorials/SampleCodes/s2e-user/src/Simulation/Spacecraft/UserSat.cpp
@@ -0,0 +1,8 @@
+#include "UserSat.hpp"
+#include "UserComponents.hpp"
+
+UserSat::UserSat(SimulationConfig* sim_config, const GlobalEnvironment* glo_env, const int sat_id)
+:Spacecraft(sim_config, glo_env, sat_id)
+{
+ components_ = new UserComponents(dynamics_, structure_, local_env_, glo_env, sim_config, &clock_gen_);
+}
diff --git a/Tutorials/SampleCodes/s2e-user/src/Simulation/Spacecraft/UserSat.hpp b/Tutorials/SampleCodes/s2e-user/src/Simulation/Spacecraft/UserSat.hpp
new file mode 100644
index 00000000..5d852681
--- /dev/null
+++ b/Tutorials/SampleCodes/s2e-user/src/Simulation/Spacecraft/UserSat.hpp
@@ -0,0 +1,11 @@
+#pragma once
+
+#include "Spacecraft.h"
+#include "UserComponents.hpp"
+
+class UserSat : public Spacecraft
+{
+public:
+ UserSat(SimulationConfig* sim_config, const GlobalEnvironment* glo_env, const int sat_id);
+private:
+};
diff --git a/Tutorials/SampleCodes/s2e_user/CMakeLists.txt b/Tutorials/SampleCodes/s2e_user/CMakeLists.txt
deleted file mode 100644
index 6aca5056..00000000
--- a/Tutorials/SampleCodes/s2e_user/CMakeLists.txt
+++ /dev/null
@@ -1,205 +0,0 @@
-## General Settings
-cmake_minimum_required(VERSION 3.13)
-project(S2E_USER)
-set(CMAKE_CXX_STANDARD 14)
-# preprocessor
-if(WIN32)
- add_definitions(-DWIN32)
-endif()
-
-## set directory path
-set(S2E_CORE_DIR ../s2e-core)
-set(CSPICE_DIR ../ExtLibraries/cspice)
-set(NRLMSISE00_DIR ../ExtLibraries/nrlmsise00)
-set(FLIGHT_SW_DIR ../FlightSW)
-set(C2A_DIR ${FLIGHT_SW_DIR}/c2a_user_oss)
-
-if(WIN32)
-elseif(APPLE)
- set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ./out) # set build path
-endif()
-
-## Options to use C2A
-option(USE_C2A "Use C2A")
-set(USE_C2A OFF)
-if(USE_C2A)
- # add definition
- add_definitions(-DUSE_C2A)
- add_definitions(-DSILS_FW)
-
- # include_directories of C2A
- include_directories(${C2A_DIR}/src/src_core/System/AnomalyLogger)
- include_directories(${C2A_DIR}/src/src_core/System/ApplicationManager)
- include_directories(${C2A_DIR}/src/src_core/System/ModeManager)
- include_directories(${C2A_DIR}/src/src_core/System/TaskManager)
- include_directories(${C2A_DIR}/src/src_core/System/WatchdogTimer)
- include_directories(${C2A_DIR}/src/src_core/System/TimeManager)
- include_directories(${C2A_DIR}/src/src_core/CmdTlm)
- include_directories(${C2A_DIR}/src/src_user/Applications)
- include_directories(${C2A_DIR}/src)
- include_directories(${S2E_CORE_DIR}/src/Interface/SpacecraftInOut)
-
- # add subdirectory
- add_subdirectory(${C2A_DIR} C2A_CORE)
-
- message("USE C2A")
-endif()
-
-## Options to use HILS
-option(USE_HILS "Use HILS")
-set(USE_HILS OFF)
-if(USE_HILS AND WIN32)
- add_definitions(-DUSE_HILS)
- ## winsock2
- SET (CMAKE_FIND_LIBRARY_SUFFIXES ".lib")
- find_library(WS2_32_LIB ws2_32.lib)
- message("path for winsock2 is")
- message(${WS2_32_LIB})
-endif()
-
-## include directories of S2E_CORE
-include_directories(${CSPICE_DIR}/include)
-include_directories(${NRLMSISE00_DIR}/src)
-include_directories(${S2E_CORE_DIR}/src/Library/math)
-include_directories(${S2E_CORE_DIR}/src/Dynamics)
-include_directories(${S2E_CORE_DIR}/src/Disturbance)
-include_directories(${S2E_CORE_DIR}/src/Interface/InitInput)
-include_directories(${S2E_CORE_DIR}/src/Interface/LogOutput)
-include_directories(${S2E_CORE_DIR}/src/Simulation)
-include_directories(${S2E_CORE_DIR}/src/Simulation/MCSim)
-include_directories(${S2E_CORE_DIR}/src/Simulation/Spacecraft)
-include_directories(${S2E_CORE_DIR}/src/Simulation/Spacecraft/Structure)
-include_directories(${S2E_CORE_DIR}/src/Simulation/GroundStation)
-include_directories(${S2E_CORE_DIR}/src/Simulation/Case)
-include_directories(${S2E_CORE_DIR}/src/Disturbance)
-include_directories(${S2E_CORE_DIR}/src/Environment/Global)
-include_directories(${S2E_CORE_DIR}/src/Environment/Local)
-include_directories(${S2E_CORE_DIR}/src/Component/Abstract)
-include_directories(${S2E_CORE_DIR}/src/Component/AOCS)
-include_directories(${S2E_CORE_DIR}/src/Component/CDH)
-include_directories(${S2E_CORE_DIR}/src/Component/CommGS)
-include_directories(${S2E_CORE_DIR}/src/Component/Mission/Telescope)
-include_directories(${S2E_CORE_DIR}/src/Component/Power)
-include_directories(${S2E_CORE_DIR}/src/Component/Propulsion)
-include_directories(${S2E_CORE_DIR}/src/Component/Thermal)
-
-## add_subdirectories
-add_subdirectory(${S2E_CORE_DIR}/src/Component S2E_CORE/Component)
-add_subdirectory(${S2E_CORE_DIR}/src/Disturbance S2E_CORE/Disturbance)
-add_subdirectory(${S2E_CORE_DIR}/src/Dynamics S2E_CORE/Dynamics)
-add_subdirectory(${S2E_CORE_DIR}/src/Environment/Global S2E_CORE/Environment/Global)
-add_subdirectory(${S2E_CORE_DIR}/src/Environment/Local S2E_CORE/Environment/Local)
-add_subdirectory(${S2E_CORE_DIR}/src/RelativeInformation S2E_CORE/RelativeInformation)
-add_subdirectory(${S2E_CORE_DIR}/src/Interface/InitInput S2E_CORE/InitInput)
-add_subdirectory(${S2E_CORE_DIR}/src/Interface/LogOutput S2E_CORE/LogOutput)
-add_subdirectory(${S2E_CORE_DIR}/src/Interface/SpacecraftInOut S2E_CORE/SpacecraftInOut)
-add_subdirectory(${S2E_CORE_DIR}/src/Interface/HilsInOut S2E_CORE/HilsInOut)
-add_subdirectory(${S2E_CORE_DIR}/src/Library/igrf S2E_CORE/igrf)
-add_subdirectory(${S2E_CORE_DIR}/src/Library/inih S2E_CORE/inih)
-add_subdirectory(${S2E_CORE_DIR}/src/Library/math S2E_CORE/math)
-add_subdirectory(${S2E_CORE_DIR}/src/Library/nrlmsise00 S2E_CORE/nrlmsise00)
-add_subdirectory(${S2E_CORE_DIR}/src/Library/sgp4 S2E_CORE/sgp4)
-add_subdirectory(${S2E_CORE_DIR}/src/Library/utils S2E_CORE/utils)
-add_subdirectory(${S2E_CORE_DIR}/src/Library/optics S2E_CORE/optics)
-add_subdirectory(${S2E_CORE_DIR}/src/Library/RelativeOrbit S2E_CORE/RelativeOrbit)
-add_subdirectory(${S2E_CORE_DIR}/src/Simulation S2E_CORE/Simulation)
-
-set(SOURCE_FILES
- src/S2E_USER.cpp
- src/Simulation/Case/User_case.cpp
- src/Simulation/Spacecraft/User_sat.cpp
- src/Simulation/Spacecraft/User_Components.cpp
-)
-# Create executable file
-add_executable(${PROJECT_NAME} ${SOURCE_FILES})
-
-# Compile option
-if(MSVC)
- target_compile_options(${PROJECT_NAME} PUBLIC "/W4")
- target_compile_options(${PROJECT_NAME} PUBLIC "/source-charset:utf-8")
-else()
- target_compile_options(${PROJECT_NAME} PUBLIC "${CMAKE_CXX_FLAGS}-Wall")
- set(CMAKE_CXX_FLAGS "-m32 -rdynamic -Wall -g")
- set(CMAKE_C_FLAGS "-m32 -rdynamic -Wall -g")
-endif()
-
-## cspice library
-if(CYGWIN)
- SET (CMAKE_FIND_LIBRARY_SUFFIXES ".so" ".a")
- find_library(CSPICE_LIB
- NAMES cspice.a csupport.a
- PATHS ${CSPICE_DIR}/cspice_cygwin/lib)
-elseif(UNIX)
- find_library(CSPICE_LIB
- NAMES cspice.a csupport.a
- PATHS ${CSPICE_DIR}/cspice_unix/lib)
-elseif(WIN32)
- SET (CMAKE_FIND_LIBRARY_SUFFIXES ".lib")
- find_library(CSPICE_LIB
- NAMES cspice.lib csupport.lib
- PATHS ${CSPICE_DIR}/cspice_msvs/lib)
-endif()
-
-## nrlmsise00 library
-if(CYGWIN)
- SET (CMAKE_FIND_LIBRARY_SUFFIXES ".a")
- find_library(NRLMSISE00_LIB
- NAMES libnrlmsise00.a
- PATHS ${NRLMSISE00_DIR}/lib)
-elseif(UNIX)
- find_library(NRLMSISE00_LIB
- NAMES libnrlmsise00.a
- PATHS ${NRLMSISE00_DIR}/lib)
-elseif(WIN32)
- SET (CMAKE_FIND_LIBRARY_SUFFIXES ".lib")
- find_library(NRLMSISE00_LIB
- NAMES libnrlmsise00.lib
- PATHS ${NRLMSISE00_DIR}/lib)
-endif()
-
-## Linking libraries
-set(S2E_LIBRARIES
- IGRF WRAPPER_NRLMSISE00 INIH MATH SGP4 UTIL OPTICS RELATIVE_ORBIT_MODELS
-)
-# Initialize link
-target_link_libraries(COMPONENT INTERFACE INI_IN DYNAMICS GLOBAL_ENVIRONMENT LOCAL_ENVIRONMENT SC_IO RELATIVE_INFO ${S2E_LIBRARIES})
-target_link_libraries(DYNAMICS INTERFACE INI_IN GLOBAL_ENVIRONMENT LOCAL_ENVIRONMENT SIMULATION ${S2E_LIBRARIES})
-target_link_libraries(DISTURBANCE INTERFACE INI_IN DYNAMICS GLOBAL_ENVIRONMENT LOCAL_ENVIRONMENT ${S2E_LIBRARIES})
-target_link_libraries(SIMULATION INTERFACE INI_IN DYNAMICS GLOBAL_ENVIRONMENT LOCAL_ENVIRONMENT DISTURBANCE ${S2E_LIBRARIES})
-target_link_libraries(GLOBAL_ENVIRONMENT INTERFACE INI_IN ${CSPICE_LIB} ${S2E_LIBRARIES})
-target_link_libraries(LOCAL_ENVIRONMENT INTERFACE INI_IN GLOBAL_ENVIRONMENT ${CSPICE_LIB} ${S2E_LIBRARIES})
-target_link_libraries(INI_IN INTERFACE DYNAMICS GLOBAL_ENVIRONMENT LOCAL_ENVIRONMENT ${S2E_LIBRARIES})
-target_link_libraries(WRAPPER_NRLMSISE00 INTERFACE ${NRLMSISE00_LIB})
-
-target_link_libraries(${PROJECT_NAME} DYNAMICS)
-target_link_libraries(${PROJECT_NAME} DISTURBANCE)
-target_link_libraries(${PROJECT_NAME} SIMULATION)
-target_link_libraries(${PROJECT_NAME} GLOBAL_ENVIRONMENT LOCAL_ENVIRONMENT)
-target_link_libraries(${PROJECT_NAME} RELATIVE_INFO)
-target_link_libraries(${PROJECT_NAME} INI_ACC LOG_OUT SC_IO)
-target_link_libraries(${PROJECT_NAME} COMPONENT)
-target_link_libraries(${PROJECT_NAME} HILS_IO)
-
-## C2A integration
-if(USE_C2A)
- target_link_libraries(${PROJECT_NAME} C2A)
-endif()
-
-## HILS
-if(USE_HILS)
- target_link_libraries(${PROJECT_NAME} ${WS2_32_LIB})
- set_target_properties(${PROJECT_NAME} PROPERTIES COMMON_LANGUAGE_RUNTIME "")
- set_target_properties(COMPONENT PROPERTIES COMMON_LANGUAGE_RUNTIME "")
- set_target_properties(DYNAMICS PROPERTIES COMMON_LANGUAGE_RUNTIME "")
- set_target_properties(DISTURBANCE PROPERTIES COMMON_LANGUAGE_RUNTIME "")
- set_target_properties(SIMULATION PROPERTIES COMMON_LANGUAGE_RUNTIME "")
- set_target_properties(GLOBAL_ENVIRONMENT PROPERTIES COMMON_LANGUAGE_RUNTIME "")
- set_target_properties(LOCAL_ENVIRONMENT PROPERTIES COMMON_LANGUAGE_RUNTIME "")
- set_target_properties(INI_IN PROPERTIES COMMON_LANGUAGE_RUNTIME "")
- set_target_properties(HILS_IO PROPERTIES COMMON_LANGUAGE_RUNTIME "")
- set_target_properties(RELATIVE_INFO PROPERTIES COMMON_LANGUAGE_RUNTIME "")
-endif()
-
-## Cmake debug
-message("Cspice_LIB: " ${CSPICE_LIB})
-message("nrlmsise00_LIB: " ${NRLMSISE00_LIB})
diff --git a/Tutorials/SampleCodes/s2e_user/data/ini/Thermal_CSV/Cij.csv b/Tutorials/SampleCodes/s2e_user/data/ini/Thermal_CSV/Cij.csv
deleted file mode 100644
index 96562833..00000000
--- a/Tutorials/SampleCodes/s2e_user/data/ini/Thermal_CSV/Cij.csv
+++ /dev/null
@@ -1,4 +0,0 @@
-0,28,0,0
-28,0,15,0
-0,15,0,0
-0,0,0,0
diff --git a/Tutorials/SampleCodes/s2e_user/data/ini/Thermal_CSV/Heaters.csv b/Tutorials/SampleCodes/s2e_user/data/ini/Thermal_CSV/Heaters.csv
deleted file mode 100644
index 023c87d5..00000000
--- a/Tutorials/SampleCodes/s2e_user/data/ini/Thermal_CSV/Heaters.csv
+++ /dev/null
@@ -1,4 +0,0 @@
-id,label,zeus_id,ohm
-0,heater0,0,1
-1,heater1,1,2
-2,heater2,2,3
\ No newline at end of file
diff --git a/Tutorials/SampleCodes/s2e_user/data/ini/Thermal_CSV/Node.csv b/Tutorials/SampleCodes/s2e_user/data/ini/Thermal_CSV/Node.csv
deleted file mode 100644
index 72970e41..00000000
--- a/Tutorials/SampleCodes/s2e_user/data/ini/Thermal_CSV/Node.csv
+++ /dev/null
@@ -1,4 +0,0 @@
-Node_id,Node_label,heater_node_id,capacity,alpha,area,normal_v_b_x,normal_v_b_y,normal_v_b_z,initial_internal_heat,initial_temperature
-0,BUS,0,880,0,0.5,1,0,0,0,300
-1,SAP,1,880,0,0.5,0,1,1,0,350
-2,BUS-2,2,880,0,0.5,0,1,1,0,400
diff --git a/Tutorials/SampleCodes/s2e_user/data/ini/Thermal_CSV/Rij.csv b/Tutorials/SampleCodes/s2e_user/data/ini/Thermal_CSV/Rij.csv
deleted file mode 100644
index cfea304e..00000000
--- a/Tutorials/SampleCodes/s2e_user/data/ini/Thermal_CSV/Rij.csv
+++ /dev/null
@@ -1,4 +0,0 @@
-0,0,0,0
-0.00E+00,0,0,0
-0,0,0,0
-0,0,0,0
diff --git a/Tutorials/SampleCodes/s2e_user/data/ini/Thermal_CSV/TempSensors.csv b/Tutorials/SampleCodes/s2e_user/data/ini/Thermal_CSV/TempSensors.csv
deleted file mode 100644
index d5484868..00000000
--- a/Tutorials/SampleCodes/s2e_user/data/ini/Thermal_CSV/TempSensors.csv
+++ /dev/null
@@ -1,4 +0,0 @@
-id,label,node_id,ohm_harness,is_aquariusdyn
-0,thermo0,0,1,0
-1,thermo1,1,2,0
-2,thermo2,2,3,1
\ No newline at end of file
diff --git a/Tutorials/SampleCodes/s2e_user/data/ini/Thermal_CSV/ThermoCompo.csv b/Tutorials/SampleCodes/s2e_user/data/ini/Thermal_CSV/ThermoCompo.csv
deleted file mode 100644
index 5da8a868..00000000
--- a/Tutorials/SampleCodes/s2e_user/data/ini/Thermal_CSV/ThermoCompo.csv
+++ /dev/null
@@ -1,3 +0,0 @@
-id,lavel,node_id,ohm_harness
-0,thermo0,0,1
-1,thermo1,1,2
diff --git a/Tutorials/SampleCodes/s2e_user/src/Simulation/Spacecraft/User_sat.cpp b/Tutorials/SampleCodes/s2e_user/src/Simulation/Spacecraft/User_sat.cpp
deleted file mode 100644
index 9cf0900b..00000000
--- a/Tutorials/SampleCodes/s2e_user/src/Simulation/Spacecraft/User_sat.cpp
+++ /dev/null
@@ -1,39 +0,0 @@
-#include "User_sat.h"
-#include "User_Components.h"
-#include "Initialize.h"
-#include "ClockGenerator.h"
-
-UserSat::UserSat(SimulationConfig* sim_config, const GlobalEnvironment* glo_env, const int sat_id)
-:Spacecraft(sim_config, glo_env, sat_id)
-{
- Initialize(sim_config, glo_env, sat_id);
-}
-
-UserSat::~UserSat()
-{
- delete components_;
-}
-
-void UserSat::Initialize(SimulationConfig* sim_config, const GlobalEnvironment* glo_env, const int sat_id)
-{
- components_ = new UserComponents(dynamics_, structure_, local_env_, glo_env, sim_config, &clock_gen_, sat_id);
-}
-
-void UserSat::LogSetup(Logger & logger)
-{
- Spacecraft::LogSetup(logger);
- components_->CompoLogSetUp(logger);
-}
-
-void UserSat::Update(const SimTime* sim_time)
-{
- // Update Dynamics
- Spacecraft::Update(sim_time);
- // clear force and torques
- Clear();
- // Update Components
- clock_gen_.UpdateComponents(sim_time);
- // Add force and torque generated by components
- dynamics_->AddTorque_b(components_->GenerateTorque_b());
- dynamics_->AddForce_b(components_->GenerateForce_b());
-}
diff --git a/Tutorials/SampleCodes/s2e_user/src/Simulation/Spacecraft/User_sat.h b/Tutorials/SampleCodes/s2e_user/src/Simulation/Spacecraft/User_sat.h
deleted file mode 100644
index c566b285..00000000
--- a/Tutorials/SampleCodes/s2e_user/src/Simulation/Spacecraft/User_sat.h
+++ /dev/null
@@ -1,18 +0,0 @@
-#pragma once
-
-#include "Spacecraft.h"
-#include "User_Components.h"
-
-class UserSat : public Spacecraft
-{
-public:
- UserSat(SimulationConfig* sim_config, const GlobalEnvironment* glo_env, const int sat_id);
- ~UserSat();
-
- virtual void Initialize(SimulationConfig* sim_config, const GlobalEnvironment* glo_env, const int sat_id);
- virtual void LogSetup(Logger& logger);
- virtual void Update(const SimTime* sim_time);
-
-private:
- UserComponents* components_;
-};
diff --git a/Tutorials/figs/MultipleSatellite_Case_cpp_constructor.JPG b/Tutorials/figs/MultipleSatellite_Case_cpp_constructor.JPG
deleted file mode 100644
index 0cd322bb..00000000
Binary files a/Tutorials/figs/MultipleSatellite_Case_cpp_constructor.JPG and /dev/null differ
diff --git a/Tutorials/figs/MultipleSatellite_Case_cpp_init.JPG b/Tutorials/figs/MultipleSatellite_Case_cpp_init.JPG
deleted file mode 100644
index b7ec0244..00000000
Binary files a/Tutorials/figs/MultipleSatellite_Case_cpp_init.JPG and /dev/null differ
diff --git a/Tutorials/figs/MultipleSatellite_Case_cpp_main.JPG b/Tutorials/figs/MultipleSatellite_Case_cpp_main.JPG
deleted file mode 100644
index b5dad475..00000000
Binary files a/Tutorials/figs/MultipleSatellite_Case_cpp_main.JPG and /dev/null differ
diff --git a/Tutorials/figs/MultipleSatellite_Case_h.JPG b/Tutorials/figs/MultipleSatellite_Case_h.JPG
deleted file mode 100644
index 29518c3b..00000000
Binary files a/Tutorials/figs/MultipleSatellite_Case_h.JPG and /dev/null differ