Skip to content

Commit

Permalink
Update main branch
Browse files Browse the repository at this point in the history
See merge request !160
  • Loading branch information
200km committed Dec 25, 2021
2 parents 556d4b3 + 5a08fe4 commit 6c52fca
Show file tree
Hide file tree
Showing 133 changed files with 3,329 additions and 760 deletions.
11 changes: 11 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
stages:
- build
variables:
GIT_STRATEGY: clone
GIT_SUBMODULE_STRATEGY: recursive
build_on_vs2019:
stage: build
script:
- echo %CD%
- cd ./scripts/CI
- ./build_on_vs2019.bat
14 changes: 9 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
## General settings
cmake_minimum_required(VERSION 3.10)
cmake_minimum_required(VERSION 3.13)
set(CMAKE_CXX_STANDARD 14)
project(S2E CXX)
# preprocessor
Expand Down Expand Up @@ -45,6 +45,7 @@ add_subdirectory(src/Environment/Local)
add_subdirectory(src/Dynamics)
add_subdirectory(src/Disturbance)
add_subdirectory(src/Component)
add_subdirectory(src/RelativeInformation)
add_subdirectory(src/Interface/InitInput)
add_subdirectory(src/Interface/LogOutput)
add_subdirectory(src/Interface/SpacecraftInOut)
Expand All @@ -54,6 +55,8 @@ add_subdirectory(src/Library/math)
add_subdirectory(src/Library/nrlmsise00)
add_subdirectory(src/Library/sgp4)
add_subdirectory(src/Library/utils)
add_subdirectory(src/Library/optics)
add_subdirectory(src/Library/RelativeOrbit)
#add_subdirectory(src/Interface/HilsInOut)

set(SOURCE_FILES
Expand Down Expand Up @@ -115,10 +118,10 @@ endif()

## Linking libraries
set(S2E_LIBRARIES
IGRF WRAPPER_NRLMSISE00 INIH MATH SGP4 UTIL
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 ${S2E_LIBRARIES})
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})
Expand All @@ -131,6 +134,7 @@ 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)

Expand All @@ -152,5 +156,5 @@ if(USE_C2A)
endif()

## Cmake debug
message("Cspice_LIB: "${CSPICE_LIB})
message("nrlmsise00_LIB: "${NRLMSISE00_LIB})
message("Cspice_LIB: " ${CSPICE_LIB})
message("nrlmsise00_LIB: " ${NRLMSISE00_LIB})
2 changes: 1 addition & 1 deletion CMakeSettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"configurations": [
{
"name": "Win32",
"generator": "Visual Studio 15 2017",
"generator": "Visual Studio 16 2019",
"configurationType": "Debug",
"inheritEnvironments": [
"msvc_x86"
Expand Down
55 changes: 55 additions & 0 deletions data/SampleSat/ini/SampleGNSS.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
[GNSS_SATELLIES]
directory_path = ../../../ExtLibraries/sp3/
calculation = DISABLE

true_position_file_sort = IGS
//choose from IGS, IGR, IGU,
// CODE_Final, CODE_Rapid, CODE_Ultra_rapid,
// JAXA_Final, JAXA_Rapid, JAXA_Ultra_rapid, madocaRT,
// QZSS_Final, QZSS_Rapid, QZSS_Ultra_rapid
true_position_first = igs21233.sp3
//As small as possible within the range.
true_position_last = igs21233.sp3
true_position_interpolation_method = 1
//choose from 0: Lagrange, 1: Trigonometric : temporarily, only Trigonometric is valid, Lagrange is not yet implemented.
true_position_interpolation_number = 9
//if you chose Trigonometric as interpolation method, you must choose odds number here.

true_clock_file_extension = .clk_30s
//choose frome .sp3, .clk_30s or .clk
true_clock_file_sort = IGS
//choose from IGS, IGR, IGU,
// CODE_Final, CODE_Rapid, CODE_Ultra_rapid,
// JAXA_Final, JAXA_Rapid, JAXA_Ultra_rapid, madocaRT,
// QZSS_Final, QZSS_Rapid, QZSS_Ultra_rapid
//if you choose clk_30s, should choose the one equivalent to final, if you choose clk should choose the one equivalent to rapid.
true_clock_first = igs21233.clk_30s
//As small as possible within the range.
true_clock_last = igs21233.clk_30s
true_clock_interpolation_number = 3
//The method is fixed with Lagrange interpolation, 3 (quadratic) recommended

estimate_position_file_sort = madocaRT
//choose from IGS, IGR, IGU,
// CODE_Final, CODE_Rapid, CODE_Ultra_rapid,
// JAXA_Final, JAXA_Rapid, JAXA_Ultra_rapid, madocaRT,
// QZSS_Final, QZSS_Rapid, QZSS_Ultra_rapid
estimate_position_first = madoca21233.sp3
//As small as possible within the range.
estimate_position_last = madoca21233.sp3
estimate_position_interpolation_method = 1
//choose from 0: Lagrange, 1: Trigonometric : temporarily, only Trigonometric is valid, Lagrange is not yet implemented.
estimate_position_interpolation_number = 9
//if you chose Trigonometric as interpolation method, you must choose odds number here.
estimate_clock_file_sort = madocaRT
//choose from IGS, IGR, IGU,
// CODE_Final, CODE_Rapid, CODE_Ultra_rapid,
// JAXA_Final, JAXA_Rapid, JAXA_Ultra_rapid, madocaRT,
// QZSS_Final, QZSS_Rapid, QZSS_Ultra_rapid
estimate_clock_file_extension = .sp3
//choose frome .sp3, .clk_30s or .clk
estimate_clock_first = madoca21233.sp3
//As small as possible within the range.
estimate_clock_last = madoca21233.sp3
estimate_clock_interpolation_number = 3
//The method is fixed with Lagrange interpolation, 3 (quadratic) recommended
5 changes: 4 additions & 1 deletion data/SampleSat/ini/SampleLocalEnvironment.ini
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,7 @@ model = NRLMSISE00
nrlmsise00_table_path = ../../../ExtLibraries/nrlmsise00/table/SpaceWeather.txt
calculation = ENABLE
logging = ENABLE
rho_stddev = 0.0//0.1 //空気密度標準偏差の割合
rho_stddev = 0.0//0.1 //空気密度標準偏差の割合

[LOCAL_CELESTIAL_INFORMATION]
logging = ENABLE
27 changes: 25 additions & 2 deletions data/SampleSat/ini/SampleSat.ini
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,9 @@ calculation = ENABLE
logging = ENABLE

propagate_mode = 1
//0→ルンゲクッタ法で軌道情報をpropagate(深宇宙軌道向き)
//1→SGP4に四つ地球周回の軌道情報をpropagate
//0→propagate orbit using Runge-Kutta method
//1→propagate orbit using SGP4(only for Earth orbit)
//2→propagate orbit using relative dynamics theory(for formation flying simulation)

//地球周回軌道情報//////////////////////////////////////////////////////////////
//ISS
Expand Down Expand Up @@ -81,6 +82,28 @@ 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
///////////////////////////////////////////////////////////////////////////////

[Thermal]
IsCalcEnabled=0
debug=0
Expand Down
77 changes: 14 additions & 63 deletions data/SampleSat/ini/SampleSimBase.ini
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ 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-Kutta method [sec]
//Attitide Δt for Runge-Kutt method [sec]
//This must be smaller than "AttitudeUpdateIntervalSec"
AttitudeRKStepSec = 0.001

Expand All @@ -30,8 +30,9 @@ ThermalRKStepSec = 0.1

//Component Update Period [sec]
CompoUpdateIntervalSec = 0.1 // should be larger than StepTimeSec

//Log Output Period [sec]
LogOutPutIntervalSec = 0.5 // should be larger than StepTimeSec
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

Expand Down Expand Up @@ -63,10 +64,14 @@ ATTITUDE0.Omega_b.sigma_or_max(1) = 0.05817764 // 3-sigma = 10 [deg/s]
ATTITUDE0.Omega_b.sigma_or_max(2) = 0.05817764 // 3-sigma = 10 [deg/s]

[PLANET_SELECTION]
//天体情報
//Whether global celestial information is logged or not
logging = ENABLE
//Celestial Information
inertial_frame = J2000
aberration_correction = NONE
center_object = EARTH
//designation of dynamics model, Idle:no motion,Simple:rotation only,Full:full-dynamics
rotation_mode = Simple
num_of_selected_body = 3
selected_body(0) = EARTH
selected_body(1) = SUN
Expand All @@ -87,70 +92,16 @@ max_magnitude = 3.0 //ヒッパルコス星表から読み出す等級の上限
calculation = DISABLE
logging = DISABLE

[GNSS_SATELLIES]
directory_path = ../../../ExtLibraries/sp3/
calculation = DISABLE

true_position_file_sort = IGS
//choose from IGS, IGR, IGU,
// CODE_Final, CODE_Rapid, CODE_Ultra_rapid,
// JAXA_Final, JAXA_Rapid, JAXA_Ultra_rapid, madocaRT,
// QZSS_Final, QZSS_Rapid, QZSS_Ultra_rapid
true_position_first = igs21233.sp3
//As small as possible within the range.
true_position_last = igs21233.sp3
true_position_interpolation_method = 1
//choose from 0: Lagrange, 1: Trigonometric : temporarily, only Trigonometric is valid, Lagrange is not yet implemented.
true_position_interpolation_number = 9
//if you chose Trigonometric as interpolation method, you must choose odds number here.

true_clock_file_extension = .clk_30s
//choose frome .sp3, .clk_30s or .clk
true_clock_file_sort = IGS
//choose from IGS, IGR, IGU,
// CODE_Final, CODE_Rapid, CODE_Ultra_rapid,
// JAXA_Final, JAXA_Rapid, JAXA_Ultra_rapid, madocaRT,
// QZSS_Final, QZSS_Rapid, QZSS_Ultra_rapid
//if you choose clk_30s, should choose the one equivalent to final, if you choose clk should choose the one equivalent to rapid.
true_clock_first = igs21233.clk_30s
//As small as possible within the range.
true_clock_last = igs21233.clk_30s
true_clock_interpolation_number = 3
//The method is fixed with Lagrange interpolation, 3 (quadratic) recommended

estimate_position_file_sort = madocaRT
//choose from IGS, IGR, IGU,
// CODE_Final, CODE_Rapid, CODE_Ultra_rapid,
// JAXA_Final, JAXA_Rapid, JAXA_Ultra_rapid, madocaRT,
// QZSS_Final, QZSS_Rapid, QZSS_Ultra_rapid
estimate_position_first = madoca21233.sp3
//As small as possible within the range.
estimate_position_last = madoca21233.sp3
estimate_position_interpolation_method = 1
//choose from 0: Lagrange, 1: Trigonometric : temporarily, only Trigonometric is valid, Lagrange is not yet implemented.
estimate_position_interpolation_number = 9
//if you chose Trigonometric as interpolation method, you must choose odds number here.
estimate_clock_file_sort = madocaRT
//choose from IGS, IGR, IGU,
// CODE_Final, CODE_Rapid, CODE_Ultra_rapid,
// JAXA_Final, JAXA_Rapid, JAXA_Ultra_rapid, madocaRT,
// QZSS_Final, QZSS_Rapid, QZSS_Ultra_rapid
estimate_clock_file_extension = .sp3
//choose frome .sp3, .clk_30s or .clk
estimate_clock_first = madoca21233.sp3
//As small as possible within the range.
estimate_clock_last = madoca21233.sp3
estimate_clock_interpolation_number = 3
//The method is fixed with Lagrange interpolation, 3 (quadratic) recommended

[RAND]
Rand_Seed = 0x11223344 //乱数のSeed. 0にすると時変になる

[SIM_SETTING]
log_inifile = 1
//ファイル設定
//If you want to add a spacecraft, create the corresponding Sat.ini, and specify it as sat_file(1), sat_file(2)... .
sat_file(0) = ../../data/SampleSat/ini/SampleSat.ini
gs_file = ../../data/SampleSat/ini/SampleGS.ini
inter_sat_comm_file = ../../data/SampleSat/ini/SampleInterSatComm.ini
log_file_path = ../../data/SampleSat/logs/
num_of_simulated_spacecraft = 1
sat_file(0) = ../../data/SampleSat/ini/SampleSat.ini
gs_file = ../../data/SampleSat/ini/SampleGS.ini
inter_sat_comm_file = ../../data/SampleSat/ini/SampleInterSatComm.ini
gnss_file = ../../data/SampleSat/ini/SampleGNSS.ini
log_file_path = ../../data/SampleSat/logs/
34 changes: 31 additions & 3 deletions data/SampleSat/ini/component/GNSSReceiver.ini
Original file line number Diff line number Diff line change
@@ -1,9 +1,37 @@
[GNSSReceiver]
prescaler = 10

antenna_direction(0) = 0.0
antenna_direction(1) = 0.0
antenna_direction(2) = 1.0
// Position of antenna at body frame [m]
antenna_pos_b(0) = 0.0125
antenna_pos_b(1) = 0.0000
antenna_pos_b(2) = 0.1815

// Quaternion from body frame to component frame
q_b2c(0) = 0.0
q_b2c(1) = 0.0
q_b2c(2) = 0.0
q_b2c(3) = 1.0

// Antenna model
// 0... simple model : GNSS sats are visible when antenna directs anti-earth direction
// 1... cone model : GNSS sats visible when a sat is in a cone
antenna_model = 0

// Antenna half width [deg]
half_width = 60

// Number of channels
ch_max = 8

// GNSS ID
// G...GPS
// R...GLONASS
// E...Galileo
// C...Beidou
// J...QZSS
// if your receiver is compatible with all kind of gnss satellites : GRECJ
// if your receiver is compatible with GPS and QZSS : GJ
gnss_id = G

//Random noise [m]
nr_stddev_eci(0) = 10000.0
Expand Down
30 changes: 30 additions & 0 deletions data/SampleSat/ini/component/RW.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,37 @@
// prescaler defines update period of thie component
// update period = prescaler * step sec
prescaler = 1
// prescaler for calculation of RW jitter
// To calculate the jitter, set the update cycle to about 0.1 ms.
fast_prescaler = 1
//Inertia of the RW [kgm^2]
inertia = 1.0e-4
//Maximum torque [Nm]
max_torque = 0.001
//Maximum angular velocity [rpm]
//The RW can drive (-max_angular_velocity,+max_angular_velocity)
max_angular_velocity = 6000.0

// How to determine the direction of RW (DIRECTION or QUATERNION)
// If you want to consider the phase of RW strictly (e.g. RW jitter), specify QUATERNION.
// If you do not need to consider the phase of the RW rotation, specify DIRECTION.
direction_determination_mode = QUATERNION
// Quaternion from body frame to component frame
// Definition of component frame : wheel rotation axis = (0 0 1)^T. plus means direction of rotation (output torque is minus direction)
q_b2c(0) = 0
q_b2c(1) = 0.70710678118
q_b2c(2) = 0
q_b2c(3) = 0.70710678118
// Direction of axis of the RW at the body fixied frame
// plus means direction of rotation (output torque is minus direction)
direction_b(0) = 1.0
direction_b(1) = 0.0
direction_b(2) = 0.0

// Position of RW at body frame [m]
pos_b(0) = 1.0
pos_b(1) = 0.0
pos_b(2) = 0.0
//The control deray[s]
dead_time = 1.0
//Coefficient of first order lag for driving case
Expand All @@ -29,6 +48,17 @@ coasting_lag_coef(2) = 0.0
motor_drive_init = 0
angular_velocity_init = 0.0

//Parameters for calculate RW jitter
jitter_calculation = DISABLE
jitter_logging = DISABLE
radial_force_harmonics_coef_path = ../../data/SampleSat/ini/component/RWDisturbance/radial_force_harmonics_coef.csv
radial_torque_harmonics_coef_path = ../../data/SampleSat/ini/component/RWDisturbance/radial_torque_harmonics_coef.csv
harmonics_degree = 12
considers_structural_resonance = DISABLE
structural_resonance_freq = 585.0 //[Hz]
damping_factor = 0.1 //[ ]
bandwidth = 0.001 //[ ]

// Power Port
minimum_voltage = 3.3 // V
assumed_power_consumption = 1.0 //W
Loading

0 comments on commit 6c52fca

Please sign in to comment.