Skip to content

Commit

Permalink
Merge pull request #463 from ut-issl/main
Browse files Browse the repository at this point in the history
Merge main to develop for #461
  • Loading branch information
200km authored Jul 19, 2023
2 parents cfbe384 + 5bdb22a commit ca49352
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion 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.2.1
VERSION 6.2.2
)

cmake_minimum_required(VERSION 3.13)
Expand Down
18 changes: 13 additions & 5 deletions src/environment/global/celestial_rotation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@ 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 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>();
}
}

Expand Down Expand Up @@ -128,8 +135,8 @@ 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
double jdTT_day = JulianDate + kDtUt1Utc_ * kSec2Day_; // TODO: Check the correctness. Problem is thtat S2E doesn't have Gregorian calendar.
// 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
double tTT_century[4];
Expand All @@ -145,13 +152,13 @@ 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]
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);
Expand All @@ -160,6 +167,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})
Expand Down

0 comments on commit ca49352

Please sign in to comment.