From a43dc4795030ebe4eafa7881177504a8c7106086 Mon Sep 17 00:00:00 2001 From: Satoshi Ikari Date: Tue, 18 Jul 2023 16:19:32 +0200 Subject: [PATCH 1/6] Define rotation mode when the center object is not the earth --- src/environment/global/celestial_rotation.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/environment/global/celestial_rotation.cpp b/src/environment/global/celestial_rotation.cpp index 83bfaf155..8f4607bd3 100644 --- a/src/environment/global/celestial_rotation.cpp +++ b/src/environment/global/celestial_rotation.cpp @@ -24,6 +24,10 @@ CelestialRotation::CelestialRotation(const RotationMode rotation_mode, const std dcm_teme_to_xcxf_ = dcm_j2000_to_xcxf_; if (center_body_name == "EARTH") { InitCelestialRotationAsEarth(rotation_mode, center_body_name); + } else { + // If the center object is not defined rotation calculation and make the DCM a unit matrix + rotation_mode_ = RotationMode::kIdle; + dcm_j2000_to_xcxf_ = libra::MakeIdentityMatrix<3>(); } } @@ -160,6 +164,7 @@ void CelestialRotation::Update(const double JulianDate) { dcm_j2000_to_xcxf_ = W * R * N * P; } else if (rotation_mode_ == RotationMode::kSimple) { // In this case, only Axial Rotation is executed, with its argument replaced from G'A'ST to G'M'ST + // FIXME: Not suitable when the center body is not the earth dcm_j2000_to_xcxf_ = AxialRotation(gmst_rad); } else { // Leave the DCM as unit Matrix(diag{1,1,1}) From 0cb712083d6d800de151708dc458cbaf869f3c77 Mon Sep 17 00:00:00 2001 From: Satoshi Ikari Date: Tue, 18 Jul 2023 16:21:25 +0200 Subject: [PATCH 2/6] Fix typo --- src/environment/global/celestial_rotation.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/environment/global/celestial_rotation.cpp b/src/environment/global/celestial_rotation.cpp index 8f4607bd3..b5882d1f6 100644 --- a/src/environment/global/celestial_rotation.cpp +++ b/src/environment/global/celestial_rotation.cpp @@ -133,7 +133,7 @@ void CelestialRotation::Update(const double JulianDate) { if (rotation_mode_ == RotationMode::kFull) { // Compute Julian date for terestrial time - double jdTT_day = JulianDate + kDtUt1Utc_ * kSec2Day_; // TODO: Check the correctness. Problem is thtat S2E doesn't have Gregorian calendar. + double jdTT_day = JulianDate + kDtUt1Utc_ * kSec2Day_; // TODO: Check the correctness. Problem is that S2E doesn't have Gregorian calendar. // Compute nth power of julian century for terrestrial time the actual unit of tTT_century is [century^(i+1)], i is the index of the array double tTT_century[4]; @@ -153,9 +153,9 @@ void CelestialRotation::Update(const double JulianDate) { // Axial Rotation double Eq_rad = d_psi_rad_ * cos(epsilon_rad_ + d_epsilon_rad_); // Equation of equinoxes [rad] - double gast_rad = gmst_rad + Eq_rad; // Greenwitch 'Appearent' Sidereal Time [rad] + double gast_rad = gmst_rad + Eq_rad; // Greenwitch 'Apparent' Sidereal Time [rad] R = AxialRotation(gast_rad); - // Polar motion (isnot considered so far, even without polar motion, the result agrees well with the matlab reference) + // Polar motion (is not considered so far, even without polar motion, the result agrees well with the matlab reference) double Xp = 0.0; double Yp = 0.0; W = PolarMotion(Xp, Yp); From 374b0de98579cb56bd478989c6d6b24fdb56fc27 Mon Sep 17 00:00:00 2001 From: Satoshi Ikari Date: Tue, 18 Jul 2023 16:22:12 +0200 Subject: [PATCH 3/6] Fix typo --- src/environment/global/celestial_rotation.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/environment/global/celestial_rotation.cpp b/src/environment/global/celestial_rotation.cpp index b5882d1f6..ee9f2fc37 100644 --- a/src/environment/global/celestial_rotation.cpp +++ b/src/environment/global/celestial_rotation.cpp @@ -149,7 +149,7 @@ void CelestialRotation::Update(const double JulianDate) { // Nutation + Precession P = Precession(tTT_century); N = Nutation(tTT_century); // epsilon_rad_, d_epsilon_rad_, d_psi_rad_ are - // updated in this proccedure + // updated in this procedure // Axial Rotation double Eq_rad = d_psi_rad_ * cos(epsilon_rad_ + d_epsilon_rad_); // Equation of equinoxes [rad] From ad0aea1d620d54f9d8431495a85f4b21a753dee2 Mon Sep 17 00:00:00 2001 From: Satoshi Ikari Date: Tue, 18 Jul 2023 16:22:59 +0200 Subject: [PATCH 4/6] Fix typo --- src/environment/global/celestial_rotation.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/environment/global/celestial_rotation.cpp b/src/environment/global/celestial_rotation.cpp index ee9f2fc37..846f38dac 100644 --- a/src/environment/global/celestial_rotation.cpp +++ b/src/environment/global/celestial_rotation.cpp @@ -132,7 +132,7 @@ void CelestialRotation::Update(const double JulianDate) { double gmst_rad = gstime(JulianDate); // It is a bit different with 長沢(Nagasawa)'s algorithm. TODO: Check the correctness if (rotation_mode_ == RotationMode::kFull) { - // Compute Julian date for terestrial time + // Compute Julian date for terrestrial time double jdTT_day = JulianDate + kDtUt1Utc_ * kSec2Day_; // TODO: Check the correctness. Problem is that S2E doesn't have Gregorian calendar. // Compute nth power of julian century for terrestrial time the actual unit of tTT_century is [century^(i+1)], i is the index of the array From 2c7edc1dd5ff39cbe01e0ca80b468918a7717609 Mon Sep 17 00:00:00 2001 From: Satoshi Ikari Date: Tue, 18 Jul 2023 16:24:12 +0200 Subject: [PATCH 5/6] Patch update to v6.2.2 --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3bdd833d5..23c963ace 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,7 +2,7 @@ cmake_policy(SET CMP0048 NEW) project(S2E LANGUAGES CXX DESCRIPTION "S2E: Spacecraft Simulation Environment" - VERSION 6.2.1 + VERSION 6.2.2 ) cmake_minimum_required(VERSION 3.13) From fc71152864bb804230379cdeb949a73034164128 Mon Sep 17 00:00:00 2001 From: Satoshi Ikari Date: Tue, 18 Jul 2023 16:44:24 +0200 Subject: [PATCH 6/6] Add warning message --- src/environment/global/celestial_rotation.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/environment/global/celestial_rotation.cpp b/src/environment/global/celestial_rotation.cpp index 846f38dac..bb3e9f1d1 100644 --- a/src/environment/global/celestial_rotation.cpp +++ b/src/environment/global/celestial_rotation.cpp @@ -25,7 +25,10 @@ CelestialRotation::CelestialRotation(const RotationMode rotation_mode, const std if (center_body_name == "EARTH") { InitCelestialRotationAsEarth(rotation_mode, center_body_name); } else { - // If the center object is not defined rotation calculation and make the DCM a unit matrix + // If the center object is not defined for rotation calculation, make the DCM as a unit matrix + std::cerr << "WARNINGS: The rotation calculation for the center object " << center_body_name; + std::cerr << " is not supported yet." << std::endl; + std::cerr << "The rotation matrix is set as a identity matrix" << std::endl; rotation_mode_ = RotationMode::kIdle; dcm_j2000_to_xcxf_ = libra::MakeIdentityMatrix<3>(); }