Skip to content

Commit

Permalink
Merge pull request #452 from ut-issl/develop
Browse files Browse the repository at this point in the history
Main update for v6.2.0
  • Loading branch information
200km authored Jul 15, 2023
2 parents 7ad2897 + bbfc485 commit f196679
Show file tree
Hide file tree
Showing 70 changed files with 2,023 additions and 653 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ on:

env:
# datasource=github-releases depName=ut-issl/c2a-core
C2A_CORE_VERSION: v3.8.0
C2A_CORE_VERSION: v3.9.2

jobs:
build_s2e_win:
Expand Down
33 changes: 31 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ cmake_policy(SET CMP0048 NEW)
project(S2E
LANGUAGES CXX
DESCRIPTION "S2E: Spacecraft Simulation Environment"
VERSION 6.1.1
VERSION 6.2.0
)

cmake_minimum_required(VERSION 3.13)
Expand All @@ -13,6 +13,13 @@ option(USE_C2A "Use C2A" OFF)
option(BUILD_64BIT "Build 64bit" OFF)
option(GOOGLE_TEST "Execute GoogleTest" OFF)

# Mac user setting
option(APPLE_SILICON "Build with Apple Silicon" OFF)
# Force build with 64bit for APPLE
if(APPLE)
option(BUILD_64BIT "Build 64bit" ON)
endif()

# preprocessor
if(WIN32)
add_definitions(-DWIN32)
Expand All @@ -32,6 +39,19 @@ if(NOT DEFINED C2A_NAME)
set(C2A_NAME "c2a_oss")
endif()

## Directory path for ini files
if(NOT DEFINED INI_FILE_DIR_FROM_EXE)
set(INI_FILE_DIR_FROM_EXE ../../data/sample/initialize_files)
endif()

if(NOT DEFINED EXT_LIB_DIR_FROM_EXE)
set(EXT_LIB_DIR_FROM_EXE ../../${EXT_LIB_DIR})
endif()

if(NOT DEFINED CORE_DIR_FROM_EXE)
set(CORE_DIR_FROM_EXE ../../../s2e-core)
endif()

## options to use C2A
if(USE_C2A)
option(BUILD_64BIT OFF) # force to build with 32bit
Expand Down Expand Up @@ -83,7 +103,15 @@ set(SOURCE_FILES
add_executable(${PROJECT_NAME} ${SOURCE_FILES})

## cspice library
if(CYGWIN)
if(APPLE)
if(APPLE_SILICON)
# APPLE Silicon
set(CSPICE_LIB_DIR ${CSPICE_DIR}/cspice_apple_silicon64/lib)
else()
# APPLE Intel
set(CSPICE_LIB_DIR ${CSPICE_DIR}/cspice_apple_intel64/lib)
endif()
elseif(CYGWIN)
SET (CMAKE_FIND_LIBRARY_SUFFIXES ".so" ".a")
set(CSPICE_LIB_DIR ${CSPICE_DIR}/cspice_cygwin/lib)
elseif(UNIX)
Expand Down Expand Up @@ -204,6 +232,7 @@ if(GOOGLE_TEST)
src/library/math/test_matrix.cpp
src/library/math/test_matrix_vector.cpp
src/library/math/test_s2e_math.cpp
src/library/numerical_integration/test_runge_kutta.cpp
)
add_executable(${TEST_PROJECT_NAME} ${TEST_FILES})
target_link_libraries(${TEST_PROJECT_NAME} gtest gtest_main)
Expand Down
7 changes: 7 additions & 0 deletions ExtLibraries/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ cmake_minimum_required(VERSION 3.18)
# build config
option(BUILD_64BIT "Build 64bit" OFF)

# Mac user setting
option(APPLE_SILICON "Build with Apple Silicon" OFF)
# Force build with 64bit for APPLE
if(APPLE)
option(BUILD_64BIT "Build 64bit" ON)
endif()

if(NOT DEFINED EXT_LIB_DIR)
set(EXT_LIB_DIR "${CMAKE_CURRENT_LIST_DIR}/../../ExtLibraries/")
endif()
Expand Down
25 changes: 24 additions & 1 deletion ExtLibraries/cspice/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,19 @@ if(WIN32)
set(CSPICE_SHA256 "bc566e6a975c888fc5fd89d76554329501446bda88c8bab937c0725faead170f")
set(CSPICE_BUILD_COMMAND "")
endif()
elseif(APPLE)
# APPLE
if(APPLE_SILICON)
# APPLE Silicon
set(CSPICE_URL https://naif.jpl.nasa.gov/pub/naif/toolkit//C/MacM1_OSX_clang_64bit/packages/cspice.tar.Z)
set(CSPICE_SHA256 "0deae048443e11ca4d093cac651d9785d4f2594631a183d85a3d58949f4d0aa9")
set(CSPICE_BUILD_COMMAND "")
else()
# APPLE Intel
set(CSPICE_URL https://naif.jpl.nasa.gov/pub/naif/toolkit//C/MacIntel_OSX_AppleC_64bit/packages/cspice.tar.Z)
set(CSPICE_SHA256 "6f4980445fee4d363dbce6f571819f4a248358d2c1bebca47e0743eedfe9935e")
set(CSPICE_BUILD_COMMAND "")
endif()
else()
# Linux
if(BUILD_64BIT)
Expand Down Expand Up @@ -56,6 +69,15 @@ if(WIN32)
else()
set(CSPICE_LIB_DEST "cspice_msvs")
endif()
elseif(APPLE)
# APPLE
if(APPLE_SILICON)
# APPLE Silicon
set(CSPICE_LIB_DEST "cspice_apple_silicon64")
else()
# APPLE Intel
set(CSPICE_LIB_DEST "cspice_apple_intel64")
endif()
else()
# Linux
if(BUILD_64BIT)
Expand Down Expand Up @@ -89,9 +111,10 @@ download_generic_kernel(pck pck00010.tpc "59468328349aa730d18bf1f8d7e86efe6e40b7
download_generic_kernel(spk/planets de430.bsp "6e1b277c5f07135a84950604b83e56b736be696a7f3560bcddb1d4aeb944fca1")

# move generic kernel
file(RENAME
configure_file(
${CMAKE_CURRENT_BINARY_DIR}/generic_kernels/lsk/a_old_versions/naif0010.tls
${CMAKE_CURRENT_BINARY_DIR}/generic_kernels/lsk/naif0010.tls
COPYONLY
)

install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/generic_kernels
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,11 @@
## How to use S2E
- Please see [s2e-documents' getting started page](https://github.com/ut-issl/s2e-documents/blob/develop/Tutorials/GettingStarted.md).
- Support compiler
- The following compilers are supported. The details are shown in GitHub Actions' results.
- gcc/g++
- clang++
- Visual Studio C++s
## Examples of User side
Expand Down
5 changes: 5 additions & 0 deletions common.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ set_target_properties(${PROJECT_NAME} PROPERTIES CXX_EXTENSIONS FALSE)
target_include_directories(${PROJECT_NAME} PUBLIC ${S2E_DIR}/src)
target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})

# Directory path setting
target_compile_definitions(${PROJECT_NAME} PRIVATE "INI_FILE_DIR_FROM_EXE=\"${INI_FILE_DIR_FROM_EXE}\"")
target_compile_definitions(${PROJECT_NAME} PRIVATE "EXT_LIB_DIR_FROM_EXE=\"${EXT_LIB_DIR_FROM_EXE}\"")
target_compile_definitions(${PROJECT_NAME} PRIVATE "CORE_DIR_FROM_EXE=\"${CORE_DIR_FROM_EXE}\"")

# Compile option
if(MSVC)
target_compile_options(${PROJECT_NAME} PUBLIC "/MP") # multi process build
Expand Down
2 changes: 1 addition & 1 deletion data/sample/initialize_files/sample_disturbance.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
calculation = DISABLE
logging = ENABLE
degree = 4
coefficients_file_path = ../../../ExtLibraries/GeoPotential/egm96_to360.ascii
coefficients_file_path = EXT_LIB_DIR_FROM_EXE/GeoPotential/egm96_to360.ascii


[MAGNETIC_DISTURBANCE]
Expand Down
2 changes: 1 addition & 1 deletion data/sample/initialize_files/sample_gnss.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[GNSS_SATELLIES]
directory_path = ../../../ExtLibraries/sp3/
directory_path = EXT_LIB_DIR_FROM_EXE/sp3/
calculation = DISABLE

true_position_file_sort = IGS
Expand Down
4 changes: 2 additions & 2 deletions data/sample/initialize_files/sample_ground_station.ini
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ height_m = 3.4
elevation_limit_angle_deg = 5.0

[COMPONENT_FILES]
ground_station_antenna_file = ../../data/sample/initialize_files/components/ground_station_antenna.ini
ground_station_calculator_file = ../../data/sample/initialize_files/components/ground_station_calculator.ini
ground_station_antenna_file = INI_FILE_DIR_FROM_EXE/components/ground_station_antenna.ini
ground_station_calculator_file = INI_FILE_DIR_FROM_EXE/components/ground_station_calculator.ini
8 changes: 5 additions & 3 deletions data/sample/initialize_files/sample_local_environment.ini
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[MAGNETIC_FIELD_ENVIRONMENT]
calculation = ENABLE
logging = ENABLE
coefficient_file = ../../../s2e-core/src/library/external/igrf/igrf13.coef
coefficient_file = CORE_DIR_FROM_EXE/src/library/external/igrf/igrf13.coef
magnetic_field_random_walk_standard_deviation_nT = 10.0
magnetic_field_random_walk_limit_nT = 400.0
magnetic_field_white_noise_standard_deviation_nT = 50.0
Expand All @@ -17,9 +17,11 @@ calculation = ENABLE
logging = ENABLE

// Atmosphere model
// STANDARD: Model using scale height, NRLMSISE00: NRLMSISE00 model
// STANDARD: Model using scale height
// NRLMSISE00: NRLMSISE00 model
// HARRIS_PRIESTER: Harris-Priester model
model = STANDARD
nrlmsise00_table_file = ../../../ExtLibraries/nrlmsise00/table/SpaceWeather-v1.2.txt
nrlmsise00_table_file = EXT_LIB_DIR_FROM_EXE/nrlmsise00/table/SpaceWeather-v1.2.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
Expand Down
30 changes: 15 additions & 15 deletions data/sample/initialize_files/sample_satellite.ini
Original file line number Diff line number Diff line change
Expand Up @@ -126,22 +126,22 @@ error_tolerance = 0.0001
calculation = DISABLE
debug = DISABLE
solar_calc_setting = DISABLE
thermal_file_directory = ../../data/sample/initialize_files/thermal_csv_files/
thermal_file_directory = INI_FILE_DIR_FROM_EXE/thermal_csv_files/

[SETTING_FILES]
local_environment_file = ../../data/sample/initialize_files/sample_local_environment.ini
disturbance_file = ../../data/sample/initialize_files/sample_disturbance.ini
structure_file = ../../data/sample/initialize_files/sample_structure.ini
local_environment_file = INI_FILE_DIR_FROM_EXE/sample_local_environment.ini
disturbance_file = INI_FILE_DIR_FROM_EXE/sample_disturbance.ini
structure_file = INI_FILE_DIR_FROM_EXE/sample_structure.ini

[COMPONENT_FILES]
gyro_file = ../../data/sample/initialize_files/components/gyro_sensor.ini
magnetometer_file = ../../data/sample/initialize_files/components/magnetometer.ini
stt_file = ../../data/sample/initialize_files/components/star_sensor.ini
ss_file = ../../data/sample/initialize_files/components/sun_sensor.ini
gnss_file = ../../data/sample/initialize_files/components/gnss_receiver.ini
magetorquer_file = ../../data/sample/initialize_files/components/magnetorquer.ini
rw_file = ../../data/sample/initialize_files/components/reaction_wheel.ini
thruster_file = ../../data/sample/initialize_files/components/thruster.ini
force_generator_file = ../../data/sample/initialize_files/components/force_generator.ini
torque_generator_file = ../../data/sample/initialize_files/components/torque_generator.ini
antenna_file = ../../data/sample/initialize_files/components/spacecraft_antenna.ini
gyro_file = INI_FILE_DIR_FROM_EXE/components/gyro_sensor.ini
magnetometer_file = INI_FILE_DIR_FROM_EXE/components/magnetometer.ini
stt_file = INI_FILE_DIR_FROM_EXE/components/star_sensor.ini
ss_file = INI_FILE_DIR_FROM_EXE/components/sun_sensor.ini
gnss_file = INI_FILE_DIR_FROM_EXE/components/gnss_receiver.ini
magetorquer_file = INI_FILE_DIR_FROM_EXE/components/magnetorquer.ini
rw_file = INI_FILE_DIR_FROM_EXE/components/reaction_wheel.ini
thruster_file = INI_FILE_DIR_FROM_EXE/components/thruster.ini
force_generator_file = INI_FILE_DIR_FROM_EXE/components/force_generator.ini
torque_generator_file = INI_FILE_DIR_FROM_EXE/components/torque_generator.ini
antenna_file = INI_FILE_DIR_FROM_EXE/components/spacecraft_antenna.ini
18 changes: 9 additions & 9 deletions data/sample/initialize_files/sample_simulation_base.ini
Original file line number Diff line number Diff line change
Expand Up @@ -105,15 +105,15 @@ selected_body_name(10) = PLUTO

[CSPICE_KERNELS]
// 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
tls = EXT_LIB_DIR_FROM_EXE/cspice/generic_kernels/lsk/naif0010.tls
tpc1 = EXT_LIB_DIR_FROM_EXE/cspice/generic_kernels/pck/de-403-masses.tpc
tpc2 = EXT_LIB_DIR_FROM_EXE/cspice/generic_kernels/pck/gm_de431.tpc
tpc3 = EXT_LIB_DIR_FROM_EXE/cspice/generic_kernels/pck/pck00010.tpc
bsp = EXT_LIB_DIR_FROM_EXE/cspice/generic_kernels/spk/planets/de430.bsp


[HIPPARCOS_CATALOGUE]
catalogue_file_path = ../../../ExtLibraries/HipparcosCatalogue/hip_main.csv
catalogue_file_path = EXT_LIB_DIR_FROM_EXE/HipparcosCatalogue/hip_main.csv
max_magnitude = 3.0 // Max magnitude to read from Hip catalog
calculation = DISABLE
logging = DISABLE
Expand All @@ -134,7 +134,7 @@ save_initialize_files = ENABLE
// If you want to add a ground station, create the corresponding ground_station.ini, and specify it as ground_station_file(1), ground_station_file(2), ect.
number_of_simulated_spacecraft = 1
number_of_simulated_ground_station = 1
spacecraft_file(0) = ../../data/sample/initialize_files/sample_satellite.ini
ground_station_file(0) = ../../data/sample/initialize_files/sample_ground_station.ini
gnss_file = ../../data/sample/initialize_files/sample_gnss.ini
spacecraft_file(0) = INI_FILE_DIR_FROM_EXE/sample_satellite.ini
ground_station_file(0) = INI_FILE_DIR_FROM_EXE/sample_ground_station.ini
gnss_file = INI_FILE_DIR_FROM_EXE/sample_gnss.ini
log_file_save_directory = ../../data/sample/logs/
4 changes: 2 additions & 2 deletions scripts/Plot/Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ name = "pypi"

[packages]
basemap = "==1.3.7"
matplotlib = "==3.7.1"
matplotlib = "==3.7.2"
numpy = "==1.24.3"
pandas = "==2.0.2"
pandas = "==2.0.3"
numpy-stl = "==3.0.1"
numpy-quaternion = "*"
python-utils = "*"
Expand Down
Loading

0 comments on commit f196679

Please sign in to comment.