Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update s2e-core v6.0.0 #51

Merged
merged 20 commits into from
Apr 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion s2e-core
Submodule s2e-core updated 700 files
75 changes: 17 additions & 58 deletions s2e-ff/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,55 +32,16 @@ set(NRLMSISE00_DIR ${EXT_LIB_DIR}/nrlmsise00)
include_directories(${CSPICE_DIR}/include)
include_directories(${NRLMSISE00_DIR}/src)
include_directories(${S2E_CORE_DIR}/src)
include_directories(${S2E_CORE_DIR}/src/Library/math)
include_directories(${S2E_CORE_DIR}/src/Library/utils)
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/Interface/SpacecraftInOut/Ports)
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)
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)
include_directories(${S2E_CORE_DIR}/src/RelativeInformation)

## 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/Library/Orbit S2E_CORE/Orbit)
add_subdirectory(${S2E_CORE_DIR}/src/Library/Geodesy S2E_CORE/Geodesy)
add_subdirectory(${S2E_CORE_DIR}/src/Simulation S2E_CORE/Simulation)
add_subdirectory(${S2E_CORE_DIR}/src/components s2e_core/components)
add_subdirectory(${S2E_CORE_DIR}/src/disturbances s2e_core/disturbances)
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/library s2e_core/library)
add_subdirectory(${S2E_CORE_DIR}/src/simulation s2e_core/simulation)


set(SOURCE_FILES
src/S2eFf.cpp
Expand Down Expand Up @@ -163,22 +124,20 @@ set(S2E_LIBRARIES
IGRF WRAPPER_NRLMSISE00 INIH SGP4 UTIL OPTICS RELATIVE_ORBIT_MODELS ORBIT_MODELS GEODESY MATH
)
# Initialize link
target_link_libraries(COMPONENT DYNAMICS GLOBAL_ENVIRONMENT LOCAL_ENVIRONMENT SC_IO RELATIVE_INFO ${S2E_LIBRARIES})
target_link_libraries(DYNAMICS GLOBAL_ENVIRONMENT LOCAL_ENVIRONMENT SIMULATION ${S2E_LIBRARIES})
target_link_libraries(DISTURBANCE DYNAMICS GLOBAL_ENVIRONMENT LOCAL_ENVIRONMENT ${S2E_LIBRARIES})
target_link_libraries(SIMULATION DYNAMICS GLOBAL_ENVIRONMENT LOCAL_ENVIRONMENT DISTURBANCE ${S2E_LIBRARIES})
target_link_libraries(GLOBAL_ENVIRONMENT ${CSPICE_LIB} ${S2E_LIBRARIES})
target_link_libraries(LOCAL_ENVIRONMENT GLOBAL_ENVIRONMENT ${CSPICE_LIB} ${S2E_LIBRARIES})
target_link_libraries(WRAPPER_NRLMSISE00 ${NRLMSISE00_LIB})
target_link_libraries(COMPONENT DYNAMICS GLOBAL_ENVIRONMENT LOCAL_ENVIRONMENT LIBRARY)
target_link_libraries(DYNAMICS GLOBAL_ENVIRONMENT LOCAL_ENVIRONMENT SIMULATION LIBRARY)
target_link_libraries(DISTURBANCE DYNAMICS GLOBAL_ENVIRONMENT LOCAL_ENVIRONMENT LIBRARY)
target_link_libraries(SIMULATION DYNAMICS GLOBAL_ENVIRONMENT LOCAL_ENVIRONMENT DISTURBANCE LIBRARY)
target_link_libraries(GLOBAL_ENVIRONMENT ${CSPICE_LIB} LIBRARY)
target_link_libraries(LOCAL_ENVIRONMENT GLOBAL_ENVIRONMENT ${CSPICE_LIB} LIBRARY)
target_link_libraries(LIBRARY ${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)


## Cmake debug
message("Cspice_LIB: " ${CSPICE_LIB})
Expand Down Expand Up @@ -220,7 +179,7 @@ if(GOOGLE_TEST)
)
add_executable(${TEST_PROJECT_NAME} ${TEST_FILES})
target_link_libraries(${TEST_PROJECT_NAME} gtest gtest_main)
target_link_libraries(${TEST_PROJECT_NAME} MATH)
target_link_libraries(${TEST_PROJECT_NAME} LIBRARY)
include_directories(${TEST_PROJECT_NAME})
add_test(NAME s2e-test COMMAND ${TEST_PROJECT_NAME})
enable_testing()
Expand Down
151 changes: 73 additions & 78 deletions s2e-ff/data/ini/FfSat.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,30 @@
// CONTROLLED : Attitude Calculation with Controlled Attitude mode. All disturbances and control torque are ignored.
propagate_mode = CONTROLLED

// 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]
// Initialize Attitude mode
// MANUAL : Initialize Quaternion_i2b manually below
// CONTROLLED : Initialize attitude with given condition. Valid only when Attitude propagation mode is RK4.
initialize_mode = CONTROLLED

// Initial angular velocity at body frame [rad/s]
initial_angular_velocity_b_rad_s(0) = 0.0
initial_angular_velocity_b_rad_s(1) = 0.0
initial_angular_velocity_b_rad_s(2) = 0.0

// Initial quaternion inertial frame to body frame (real part, imaginary part)
// This value also used in INERTIAL_STABILIZE mode of ControlledAttitude
initial_quaternion_i2b(0) = 0.0
initial_quaternion_i2b(1) = 0.0
initial_quaternion_i2b(2) = 0.0
initial_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
initial_torque_b_Nm(0) = +0.000
initial_torque_b_Nm(1) = -0.000
initial_torque_b_Nm(2) = 0.000

[ControlledAttitude]
[CONTROLLED_ATTITUDE]
// Mode definitions
// INERTIAL_STABILIZE
// SUN_POINTING
Expand All @@ -32,16 +38,15 @@ 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
main_pointing_direction_b(0) = 0.707
main_pointing_direction_b(1) = 0.707
main_pointing_direction_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

// main_pointing_direction_b and sub_pointing_direction_b should separate larger than 30 degrees.
sub_pointing_direction_b(0) = 0.0
sub_pointing_direction_b(1) = 0.0
sub_pointing_direction_b(2) = 1.0

[ORBIT]
calculation = ENABLE
Expand All @@ -55,28 +60,42 @@ logging = ENABLE
// ENCKE : Encke orbit propagation with disturbances and thruster maneuver
propagate_mode = SGP4

// Orbit initialize mode for RK4, KEPLER, and ENCKE
// DEFAULT : Use default initialize method (RK4 and ENCKE use pos/vel, KEPLER uses init_mode_kepler)
// POSITION_VELOCITY_I : Initialize with position and velocity in the inertial frame
// ORBITAL_ELEMENTS : Initialize with orbital elements
initialize_mode = POSITION_VELOCITY_I

// Initial value definition for POSITION_VELOCITY_I initialize mode ////////
initial_position_i_m(0) = -2111769.7723711144
initial_position_i_m(1) = -5360353.2254375768
initial_position_i_m(2) = 3596181.6497774957

initial_velocity_i_m_s(0) = 4200.4344740455268
initial_velocity_i_m_s(1) = -4637.540129059361
initial_velocity_i_m_s(2) = -4429.2361258448807
///////////////////////////////////////////////////////////////////////////

// Initial value definition for ORBITAL_ELEMENTS initialize mode ////////
semi_major_axis_m = 6794500.0
eccentricity = 0.0015
inclination_rad = 0.9012
raan_rad = 0.1411
argument_of_perigee_rad = 1.7952
epoch_jday = 2.458940966402607e6
///////////////////////////////////////////////////////////////////////////////


// 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
// World Geodetic System
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//////////////////////////////
// Settings 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)
Expand All @@ -86,57 +105,33 @@ relative_dynamics_model_type = 0
// 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
// * The coordinate system is defined at [PLANET_SELECTION] in SampleSimBase.ini
initial_relative_position_lvlh_m(0) = 0.0
initial_relative_position_lvlh_m(1) = 100.0
initial_relative_position_lvlh_m(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
initial_relative_velocity_lvlh_m_s(0) = 0.0
initial_relative_velocity_lvlh_m_s(1) = 0.0
initial_relative_velocity_lvlh_m_s(2) = 0.0
// information of reference satellite
reference_sat_id = 1
reference_satellite_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 ///////////
// Settings for Encke mode ///////////
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/FfSatLocalEnvironment.ini

[THERMAL]
calculation = DISABLE
debug = 0

[DISTURBANCE]
dist_file = ../../data/ini/FfSatDisturbance.ini


[STRUCTURE_FILE]
[SETTING_FILES]
local_environment_file = ../../data/ini/FfSatLocalEnvironment.ini
disturbance_file = ../../data/ini/FfSatDisturbance.ini
structure_file = ../../data/ini/FfSatStructure.ini


[COMPONENTS_FILE]
[COMPONENT_FILES]
// Users can add the path for component initialize files here.
relative_distance_sensor_file = ../../data/ini/Components/RelativeDistanceSensor.ini
relative_position_sensor_file = ../../data/ini/Components/RelativePositionSensor.ini
Expand Down
Loading