From 10f84bb045b98bec33597e4a0ea98d31546ba5d0 Mon Sep 17 00:00:00 2001 From: Satoshi Ikari Date: Thu, 11 May 2023 07:42:01 +0200 Subject: [PATCH 1/6] Fix default SpaceWeather file name --- .../data/initialize_files/user_satellite_local_environment.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tutorials/SampleCodes/s2e-user/data/initialize_files/user_satellite_local_environment.ini b/Tutorials/SampleCodes/s2e-user/data/initialize_files/user_satellite_local_environment.ini index 88e5aece..09921765 100644 --- a/Tutorials/SampleCodes/s2e-user/data/initialize_files/user_satellite_local_environment.ini +++ b/Tutorials/SampleCodes/s2e-user/data/initialize_files/user_satellite_local_environment.ini @@ -19,7 +19,7 @@ logging = ENABLE // Atmosphere model // STANDARD: Model using scale height, NRLMSISE00: NRLMSISE00 model model = STANDARD -nrlmsise00_table_file = ../../../ExtLibraries/nrlmsise00/table/SpaceWeather.txt +nrlmsise00_table_file = ../../../ExtLibraries/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 From c9f79f18024b6c2b3be5c2f625c18bc3fdeb26c2 Mon Sep 17 00:00:00 2001 From: Satoshi Ikari Date: Mon, 21 Aug 2023 16:19:56 +0200 Subject: [PATCH 2/6] Rename to hpp --- ...2a_core_sample_components.h => c2a_core_sample_components.hpp} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename Tutorials/SampleCodes/c2a_integration/s2e_src/simulation/spacecraft/{c2a_core_sample_components.h => c2a_core_sample_components.hpp} (100%) 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.hpp similarity index 100% rename from Tutorials/SampleCodes/c2a_integration/s2e_src/simulation/spacecraft/c2a_core_sample_components.h rename to Tutorials/SampleCodes/c2a_integration/s2e_src/simulation/spacecraft/c2a_core_sample_components.hpp From 4a0328114ea5352d7faabfec22bb21cd1e3da138 Mon Sep 17 00:00:00 2001 From: Satoshi Ikari Date: Mon, 21 Aug 2023 16:21:06 +0200 Subject: [PATCH 3/6] Fix Sample codes for c2a integration --- .../spacecraft/c2a_core_sample_components.cpp | 22 +++++--- .../spacecraft/c2a_core_sample_components.hpp | 53 +++++++++++++++---- 2 files changed, 60 insertions(+), 15 deletions(-) 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 index 82474f8c..ff3ed0b7 100644 --- 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 @@ -1,4 +1,9 @@ -#include "c2a_core_sample_components.h" +/** + * @file c2a_core_sample_components.cpp + * @brief User side components management installed on a spacecraft for C2A-CORE + */ + +#include "c2a_core_sample_components.hpp" #include @@ -6,12 +11,17 @@ #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 SimulationConfiguration* config, ClockGenerator* clock_gen) - : dynamics_(dynamics), structure_(structure), local_env_(local_env), glo_env_(glo_env), config_(config) { +C2aCoreSampleComponents::C2aCoreSampleComponents(const Dynamics* dynamics, Structure* structure, const LocalEnvironment* local_environment, + const GlobalEnvironment* global_environment, const SimulationConfiguration* configuration, + ClockGenerator* clock_generator) + : dynamics_(dynamics), + structure_(structure), + local_environment_(local_environment), + global_environment_(global_environment), + configuration_(configuration) { #ifdef USE_C2A - obc_ = new ObcWithC2a(clock_gen, 100); - exp_serial_communication_ = new ExampleSerialCommunicationWithObc(clock_gen, 1, 1, obc_); + obc_ = new ObcWithC2a(clock_generator, 100); + exp_serial_communication_ = new ExampleSerialCommunicationWithObc(clock_generator, 1, 1, obc_); obc_->ConnectComPort(PORT_CH_RS422_MOBC_EXT, 1024, 1024); // UART通信用にとりあえず繋いでおく #endif diff --git a/Tutorials/SampleCodes/c2a_integration/s2e_src/simulation/spacecraft/c2a_core_sample_components.hpp b/Tutorials/SampleCodes/c2a_integration/s2e_src/simulation/spacecraft/c2a_core_sample_components.hpp index 1053a662..b4e6713d 100644 --- a/Tutorials/SampleCodes/c2a_integration/s2e_src/simulation/spacecraft/c2a_core_sample_components.hpp +++ b/Tutorials/SampleCodes/c2a_integration/s2e_src/simulation/spacecraft/c2a_core_sample_components.hpp @@ -1,4 +1,10 @@ -#pragma once +/** + * @file c2a_core_sample_components.hpp + * @brief User side components management installed on a spacecraft for C2A-CORE + */ + +#ifndef S2E_SIMULATION_SPACECRAFT_C2A_CORE_SAMPLE_COMPONENTS_HPP_ +#define S2E_SIMULATION_SPACECRAFT_C2A_CORE_SAMPLE_COMPONENTS_HPP_ #include #include @@ -10,24 +16,53 @@ #include #include +/** + * @class C2aCoreSampleComponents + * @brief User side components management installed on a spacecraft for C2A-CORE + */ class C2aCoreSampleComponents : public InstalledComponents { public: - C2aCoreSampleComponents(const Dynamics* dynamics, const Structure* structure, const LocalEnvironment* local_env, const GlobalEnvironment* glo_env, - const SimulationConfiguration* config, ClockGenerator* clock_gen); + /** + * @fn C2aCoreSampleComponents + * @brief Constructor + */ + C2aCoreSampleComponents(const Dynamics* dynamics, Structure* structure, const LocalEnvironment* local_environment, + const GlobalEnvironment* global_environment, const SimulationConfiguration* configuration, ClockGenerator* clock_generator); + + /** + * @fn ~C2aCoreSampleComponents + * @brief Destructor + */ ~C2aCoreSampleComponents(); + + // Override functions for InstalledComponents + /** + * @fn GenerateForce_b_N + * @brief Return force generated by components in unit Newton in body fixed frame + */ libra::Vector<3> GenerateForce_b_N(); + /** + * @fn GenerateTorque_b_Nm + * @brief Return torque generated by components in unit Newton-meter in body fixed frame + */ libra::Vector<3> GenerateTorque_b_Nm(); + /** + * @fn LogSetup + * @brief Setup the logger for components + */ void LogSetup(Logger& logger); private: // Components - ObcWithC2a* obc_; + ObcWithC2a* obc_; //!< Onboard Computer with C2A ExampleSerialCommunicationWithObc* exp_serial_communication_; // References - const Dynamics* dynamics_; - const Structure* structure_; - const LocalEnvironment* local_env_; - const GlobalEnvironment* glo_env_; - const SimulationConfiguration* config_; + const Dynamics* dynamics_; //!< Dynamics information of the spacecraft + const Structure* structure_; //!< Structure information of the spacecraft + const LocalEnvironment* local_environment_; //!< Local environment information around the spacecraft + const GlobalEnvironment* global_environment_; //!< Global environment information around the spacecraft + const SimulationConfiguration* configuration_; //!< Simulation settings }; + +#endif // S2E_SIMULATION_SPACECRAFT_C2A_CORE_SAMPLE_COMPONENTS_HPP_ From b46911a58f0e22611418985c58809f4a9451e6ec Mon Sep 17 00:00:00 2001 From: Satoshi Ikari Date: Mon, 21 Aug 2023 16:22:15 +0200 Subject: [PATCH 4/6] small fix --- Tutorials/HowToIntegrateC2A.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tutorials/HowToIntegrateC2A.md b/Tutorials/HowToIntegrateC2A.md index 10d5b1f8..3d14af9b 100644 --- a/Tutorials/HowToIntegrateC2A.md +++ b/Tutorials/HowToIntegrateC2A.md @@ -90,7 +90,7 @@ - Users can use the [ExampleSerialCommunicationWithObc](https://github.com/ut-issl/s2e-core/blob/v6.0.0/src/components/examples/example_serial_communication_with_obc.hpp) class in `s2e-core` as a test component to communicate with C2A. - Please refer the sample codes in `Tutorials/SampleCodes/c2a_integration/s2e_src`. - The directory structure of `s2e_src` is same with that of `s2e-user-for-c2a-core`. - - Add `ExampleSerialCommunicationWithObc` as a component in `c2a_core_sample_components.cpp and .h`. + - Add `ExampleSerialCommunicationWithObc` as a component in `c2a_core_sample_components.cpp and .hpp`. - Or simply just copy the source codes in `c2a_integration/s2e_src` to `s2e-user-for-c2a-core`. - In this example, the `ObcWithC2a` is executed as 1kHz, and the `ExampleSerialCommunicationWithObc` is executed as 1Hz. - Modification of the C2A side From cb8d3d7ca7d6d4f85c72343fd1ccb4f741a81265 Mon Sep 17 00:00:00 2001 From: Hiro-0110 Date: Thu, 12 Oct 2023 13:38:38 +0900 Subject: [PATCH 5/6] fix minor mistake --- Tutorials/HowToAddComponents.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Tutorials/HowToAddComponents.md b/Tutorials/HowToAddComponents.md index 60ca78dc..493308d3 100644 --- a/Tutorials/HowToAddComponents.md +++ b/Tutorials/HowToAddComponents.md @@ -78,7 +78,7 @@ 2. Add the following descriptions at the one line below of `GyroSensor *gyro_sensor_;` ```c++ - GyroSensor *gyro_sensor2_; //!< Gyro sensor 2 + GyroSensor *gyro_sensor_2_; //!< Gyro sensor 2 ``` 3. Open `user_components.cpp` @@ -111,7 +111,7 @@ 8. Add the following descriptions at the bottom line of `[COMPONENT_FILES]` to set the initialize file for the gyro sensor ```c++ - gyro_file_2 = ../../data/ini/components/GyroYyy.ini + gyro_file_2 = ../../data/initialize_files/components/gyro_sensor_yyy.ini ``` 9. Copy the `data/initialize_files/components/gyro_sensor_xxx.ini` file and rename it as `gyro_sensor_yyy.ini` From 5fd8a2169cf4e35bfeb650b41ec51840f4a8aeff Mon Sep 17 00:00:00 2001 From: Satoshi Ikari Date: Tue, 19 Dec 2023 10:01:34 +0100 Subject: [PATCH 6/6] Delete s2e sample codes --- .../spacecraft/c2a_core_sample_components.cpp | 48 ------------- .../spacecraft/c2a_core_sample_components.hpp | 68 ------------------- 2 files changed, 116 deletions(-) delete mode 100644 Tutorials/SampleCodes/c2a_integration/s2e_src/simulation/spacecraft/c2a_core_sample_components.cpp delete mode 100644 Tutorials/SampleCodes/c2a_integration/s2e_src/simulation/spacecraft/c2a_core_sample_components.hpp 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 ff3ed0b7..00000000 --- a/Tutorials/SampleCodes/c2a_integration/s2e_src/simulation/spacecraft/c2a_core_sample_components.cpp +++ /dev/null @@ -1,48 +0,0 @@ -/** - * @file c2a_core_sample_components.cpp - * @brief User side components management installed on a spacecraft for C2A-CORE - */ - -#include "c2a_core_sample_components.hpp" - -#include - -#ifdef USE_C2A -#include "src_user/Settings/port_config.h" -#endif - -C2aCoreSampleComponents::C2aCoreSampleComponents(const Dynamics* dynamics, Structure* structure, const LocalEnvironment* local_environment, - const GlobalEnvironment* global_environment, const SimulationConfiguration* configuration, - ClockGenerator* clock_generator) - : dynamics_(dynamics), - structure_(structure), - local_environment_(local_environment), - global_environment_(global_environment), - configuration_(configuration) { -#ifdef USE_C2A - obc_ = new ObcWithC2a(clock_generator, 100); - exp_serial_communication_ = new ExampleSerialCommunicationWithObc(clock_generator, 1, 1, obc_); - - obc_->ConnectComPort(PORT_CH_RS422_MOBC_EXT, 1024, 1024); // UART通信用にとりあえず繋いでおく -#endif -} - -C2aCoreSampleComponents::~C2aCoreSampleComponents() { - delete exp_serial_communication_; - // OBC must be deleted the last since it has com ports - delete obc_; -} - -Vector<3> C2aCoreSampleComponents::GenerateForce_b_N() { - // There is no orbit control component, so it remains 0 - Vector<3> force_b_N(0.0); - return force_b_N; -} - -Vector<3> C2aCoreSampleComponents::GenerateTorque_b_Nm() { - // No attitude control component - Vector<3> torque_b_Nm(0.0); - return torque_b_Nm; -} - -void C2aCoreSampleComponents::LogSetup(Logger& logger) { UNUSED(logger); } diff --git a/Tutorials/SampleCodes/c2a_integration/s2e_src/simulation/spacecraft/c2a_core_sample_components.hpp b/Tutorials/SampleCodes/c2a_integration/s2e_src/simulation/spacecraft/c2a_core_sample_components.hpp deleted file mode 100644 index b4e6713d..00000000 --- a/Tutorials/SampleCodes/c2a_integration/s2e_src/simulation/spacecraft/c2a_core_sample_components.hpp +++ /dev/null @@ -1,68 +0,0 @@ -/** - * @file c2a_core_sample_components.hpp - * @brief User side components management installed on a spacecraft for C2A-CORE - */ - -#ifndef S2E_SIMULATION_SPACECRAFT_C2A_CORE_SAMPLE_COMPONENTS_HPP_ -#define S2E_SIMULATION_SPACECRAFT_C2A_CORE_SAMPLE_COMPONENTS_HPP_ - -#include -#include -#include -#include -#include - -// include for components -#include -#include - -/** - * @class C2aCoreSampleComponents - * @brief User side components management installed on a spacecraft for C2A-CORE - */ -class C2aCoreSampleComponents : public InstalledComponents { - public: - /** - * @fn C2aCoreSampleComponents - * @brief Constructor - */ - C2aCoreSampleComponents(const Dynamics* dynamics, Structure* structure, const LocalEnvironment* local_environment, - const GlobalEnvironment* global_environment, const SimulationConfiguration* configuration, ClockGenerator* clock_generator); - - /** - * @fn ~C2aCoreSampleComponents - * @brief Destructor - */ - ~C2aCoreSampleComponents(); - - // Override functions for InstalledComponents - /** - * @fn GenerateForce_b_N - * @brief Return force generated by components in unit Newton in body fixed frame - */ - libra::Vector<3> GenerateForce_b_N(); - /** - * @fn GenerateTorque_b_Nm - * @brief Return torque generated by components in unit Newton-meter in body fixed frame - */ - libra::Vector<3> GenerateTorque_b_Nm(); - /** - * @fn LogSetup - * @brief Setup the logger for components - */ - void LogSetup(Logger& logger); - - private: - // Components - ObcWithC2a* obc_; //!< Onboard Computer with C2A - ExampleSerialCommunicationWithObc* exp_serial_communication_; - - // References - const Dynamics* dynamics_; //!< Dynamics information of the spacecraft - const Structure* structure_; //!< Structure information of the spacecraft - const LocalEnvironment* local_environment_; //!< Local environment information around the spacecraft - const GlobalEnvironment* global_environment_; //!< Global environment information around the spacecraft - const SimulationConfiguration* configuration_; //!< Simulation settings -}; - -#endif // S2E_SIMULATION_SPACECRAFT_C2A_CORE_SAMPLE_COMPONENTS_HPP_