diff --git a/src/dynamics/orbit/encke_orbit_propagation.cpp b/src/dynamics/orbit/encke_orbit_propagation.cpp index a5a839d5c..9b67322f2 100644 --- a/src/dynamics/orbit/encke_orbit_propagation.cpp +++ b/src/dynamics/orbit/encke_orbit_propagation.cpp @@ -90,8 +90,8 @@ void EnckeOrbitPropagation::Initialize(double current_time_jd, math::Vector<3> r // reference orbit reference_position_i_m_ = reference_position_i_m; reference_velocity_i_m_s_ = reference_velocity_i_m_s; - OrbitalElements oe_ref(gravity_constant_m3_s2_, current_time_jd, reference_position_i_m, reference_velocity_i_m_s); - reference_kepler_orbit = KeplerOrbit(gravity_constant_m3_s2_, oe_ref); + orbit::OrbitalElements oe_ref(gravity_constant_m3_s2_, current_time_jd, reference_position_i_m, reference_velocity_i_m_s); + reference_kepler_orbit = orbit::KeplerOrbit(gravity_constant_m3_s2_, oe_ref); // difference orbit difference_position_i_m_.FillUp(0.0); diff --git a/src/dynamics/orbit/encke_orbit_propagation.hpp b/src/dynamics/orbit/encke_orbit_propagation.hpp index a6abce7e8..a32052e2b 100644 --- a/src/dynamics/orbit/encke_orbit_propagation.hpp +++ b/src/dynamics/orbit/encke_orbit_propagation.hpp @@ -65,7 +65,7 @@ class EnckeOrbitPropagation : public Orbit, public math::OrdinaryDifferentialEqu // reference orbit math::Vector<3> reference_position_i_m_; //!< Reference orbit position in the inertial frame [m] math::Vector<3> reference_velocity_i_m_s_; //!< Reference orbit velocity in the inertial frame [m/s] - KeplerOrbit reference_kepler_orbit; //!< Reference Kepler orbital element + orbit::KeplerOrbit reference_kepler_orbit; //!< Reference Kepler orbital element // difference orbit math::Vector<3> difference_position_i_m_; //!< Difference orbit position in the inertial frame [m] diff --git a/src/dynamics/orbit/initialize_orbit.cpp b/src/dynamics/orbit/initialize_orbit.cpp index 9921da134..8ce7ab313 100644 --- a/src/dynamics/orbit/initialize_orbit.cpp +++ b/src/dynamics/orbit/initialize_orbit.cpp @@ -46,8 +46,8 @@ Orbit* InitOrbit(const CelestialInformation* celestial_information, std::string // initialize orbit for relative dynamics of formation flying RelativeOrbit::RelativeOrbitUpdateMethod update_method = (RelativeOrbit::RelativeOrbitUpdateMethod)(conf.ReadInt(section_, "relative_orbit_update_method")); - RelativeOrbitModel relative_dynamics_model_type = (RelativeOrbitModel)(conf.ReadInt(section_, "relative_dynamics_model_type")); - StmModel stm_model_type = (StmModel)(conf.ReadInt(section_, "stm_model_type")); + orbit::RelativeOrbitModel relative_dynamics_model_type = (orbit::RelativeOrbitModel)(conf.ReadInt(section_, "relative_dynamics_model_type")); + orbit::StmModel stm_model_type = (orbit::StmModel)(conf.ReadInt(section_, "stm_model_type")); math::Vector<3> init_relative_position_lvlh; conf.ReadVector<3>(section_, "initial_relative_position_lvlh_m", init_relative_position_lvlh); @@ -62,7 +62,7 @@ Orbit* InitOrbit(const CelestialInformation* celestial_information, std::string init_relative_velocity_lvlh, update_method, relative_dynamics_model_type, stm_model_type, relative_information); } else if (propagate_mode == "KEPLER") { // initialize orbit for Kepler propagation - OrbitalElements oe; + orbit::OrbitalElements oe; // TODO: init_mode_kepler should be removed in the next major update if (initialize_mode == OrbitInitializeMode::kInertialPositionAndVelocity) { // initialize with position and velocity @@ -70,7 +70,7 @@ Orbit* InitOrbit(const CelestialInformation* celestial_information, std::string conf.ReadVector<3>(section_, "initial_position_i_m", init_pos_m); math::Vector<3> init_vel_m_s; conf.ReadVector<3>(section_, "initial_velocity_i_m_s", init_vel_m_s); - oe = OrbitalElements(gravity_constant_m3_s2, current_time_jd, init_pos_m, init_vel_m_s); + oe = orbit::OrbitalElements(gravity_constant_m3_s2, current_time_jd, init_pos_m, init_vel_m_s); } else { // initialize with orbital elements double semi_major_axis_m = conf.ReadDouble(section_, "semi_major_axis_m"); @@ -79,9 +79,9 @@ Orbit* InitOrbit(const CelestialInformation* celestial_information, std::string double raan_rad = conf.ReadDouble(section_, "raan_rad"); double arg_perigee_rad = conf.ReadDouble(section_, "argument_of_perigee_rad"); double epoch_jday = conf.ReadDouble(section_, "epoch_jday"); - oe = OrbitalElements(epoch_jday, semi_major_axis_m, eccentricity, inclination_rad, raan_rad, arg_perigee_rad); + oe = orbit::OrbitalElements(epoch_jday, semi_major_axis_m, eccentricity, inclination_rad, raan_rad, arg_perigee_rad); } - KeplerOrbit kepler_orbit(gravity_constant_m3_s2, oe); + orbit::KeplerOrbit kepler_orbit(gravity_constant_m3_s2, oe); orbit = new KeplerOrbitPropagation(celestial_information, current_time_jd, kepler_orbit); } else if (propagate_mode == "ENCKE") { // initialize orbit for Encke's method @@ -130,8 +130,8 @@ math::Vector<6> InitializePosVel(std::string initialize_file, double current_tim double raan_rad = conf.ReadDouble(section_, "raan_rad"); double arg_perigee_rad = conf.ReadDouble(section_, "argument_of_perigee_rad"); double epoch_jday = conf.ReadDouble(section_, "epoch_jday"); - OrbitalElements oe(epoch_jday, semi_major_axis_m, eccentricity, inclination_rad, raan_rad, arg_perigee_rad); - KeplerOrbit kepler_orbit(gravity_constant_m3_s2, oe); + orbit::OrbitalElements oe(epoch_jday, semi_major_axis_m, eccentricity, inclination_rad, raan_rad, arg_perigee_rad); + orbit::KeplerOrbit kepler_orbit(gravity_constant_m3_s2, oe); kepler_orbit.CalcOrbit(current_time_jd); position_i_m = kepler_orbit.GetPosition_i_m(); diff --git a/src/dynamics/orbit/kepler_orbit_propagation.hpp b/src/dynamics/orbit/kepler_orbit_propagation.hpp index f2421003e..ec93197ab 100644 --- a/src/dynamics/orbit/kepler_orbit_propagation.hpp +++ b/src/dynamics/orbit/kepler_orbit_propagation.hpp @@ -13,7 +13,7 @@ * @class KeplerOrbitPropagation * @brief Class to propagate spacecraft orbit with Kepler equation */ -class KeplerOrbitPropagation : public Orbit, public KeplerOrbit { +class KeplerOrbitPropagation : public Orbit, public orbit::KeplerOrbit { public: // Initialize with orbital elements /** @@ -23,7 +23,7 @@ class KeplerOrbitPropagation : public Orbit, public KeplerOrbit { * @param [in] current_time_jd: Current Julian day [day] * @param [in] kepler_orbit: Kepler orbit */ - KeplerOrbitPropagation(const CelestialInformation* celestial_information, const double current_time_jd, KeplerOrbit kepler_orbit); + KeplerOrbitPropagation(const CelestialInformation* celestial_information, const double current_time_jd, orbit::KeplerOrbit kepler_orbit); /** * @fn ~KeplerOrbitPropagation * @brief Destructor diff --git a/src/dynamics/orbit/relative_orbit.cpp b/src/dynamics/orbit/relative_orbit.cpp index 5bf3270e3..f60f52682 100644 --- a/src/dynamics/orbit/relative_orbit.cpp +++ b/src/dynamics/orbit/relative_orbit.cpp @@ -10,8 +10,8 @@ RelativeOrbit::RelativeOrbit(const CelestialInformation* celestial_information, double gravity_constant_m3_s2, double time_step_s, int reference_spacecraft_id, math::Vector<3> relative_position_lvlh_m, math::Vector<3> relative_velocity_lvlh_m_s, - RelativeOrbitUpdateMethod update_method, RelativeOrbitModel relative_dynamics_model_type, StmModel stm_model_type, - RelativeInformation* relative_information) + RelativeOrbitUpdateMethod update_method, orbit::RelativeOrbitModel relative_dynamics_model_type, + orbit::StmModel stm_model_type, RelativeInformation* relative_information) : Orbit(celestial_information), math::OrdinaryDifferentialEquation<6>(time_step_s), gravity_constant_m3_s2_(gravity_constant_m3_s2), @@ -66,12 +66,12 @@ void RelativeOrbit::InitializeState(math::Vector<3> relative_position_lvlh_m, ma TransformEcefToGeodetic(); } -void RelativeOrbit::CalculateSystemMatrix(RelativeOrbitModel relative_dynamics_model_type, const Orbit* reference_sat_orbit, +void RelativeOrbit::CalculateSystemMatrix(orbit::RelativeOrbitModel relative_dynamics_model_type, const Orbit* reference_sat_orbit, double gravity_constant_m3_s2) { switch (relative_dynamics_model_type) { - case RelativeOrbitModel::kHill: { + case orbit::RelativeOrbitModel::kHill: { double reference_sat_orbit_radius = reference_sat_orbit->GetPosition_i_m().CalcNorm(); - system_matrix_ = CalcHillSystemMatrix(reference_sat_orbit_radius, gravity_constant_m3_s2); + system_matrix_ = orbit::CalcHillSystemMatrix(reference_sat_orbit_radius, gravity_constant_m3_s2); } default: { // NOT REACHED @@ -80,11 +80,12 @@ void RelativeOrbit::CalculateSystemMatrix(RelativeOrbitModel relative_dynamics_m } } -void RelativeOrbit::CalculateStm(StmModel stm_model_type, const Orbit* reference_sat_orbit, double gravity_constant_m3_s2, double elapsed_sec) { +void RelativeOrbit::CalculateStm(orbit::StmModel stm_model_type, const Orbit* reference_sat_orbit, double gravity_constant_m3_s2, + double elapsed_sec) { switch (stm_model_type) { - case StmModel::kHcw: { + case orbit::StmModel::kHcw: { double reference_sat_orbit_radius = reference_sat_orbit->GetPosition_i_m().CalcNorm(); - stm_ = CalcHcwStm(reference_sat_orbit_radius, gravity_constant_m3_s2, elapsed_sec); + stm_ = orbit::CalcHcwStm(reference_sat_orbit_radius, gravity_constant_m3_s2, elapsed_sec); } default: { // NOT REACHED diff --git a/src/dynamics/orbit/relative_orbit.hpp b/src/dynamics/orbit/relative_orbit.hpp index 82560566c..3aae6e104 100644 --- a/src/dynamics/orbit/relative_orbit.hpp +++ b/src/dynamics/orbit/relative_orbit.hpp @@ -41,7 +41,7 @@ class RelativeOrbit : public Orbit, public math::OrdinaryDifferentialEquation<6> */ RelativeOrbit(const CelestialInformation* celestial_information, double gravity_constant_m3_s2, double time_step_s, int reference_spacecraft_id, math::Vector<3> relative_position_lvlh_m, math::Vector<3> relative_velocity_lvlh_m_s, RelativeOrbitUpdateMethod update_method, - RelativeOrbitModel relative_dynamics_model_type, StmModel stm_model_type, RelativeInformation* relative_information); + orbit::RelativeOrbitModel relative_dynamics_model_type, orbit::StmModel stm_model_type, RelativeInformation* relative_information); /** * @fn ~RelativeOrbit * @brief Destructor @@ -80,10 +80,10 @@ class RelativeOrbit : public Orbit, public math::OrdinaryDifferentialEquation<6> math::Vector<3> relative_position_lvlh_m_; //!< Relative position in the LVLH frame math::Vector<3> relative_velocity_lvlh_m_s_; //!< Relative velocity in the LVLH frame - RelativeOrbitUpdateMethod update_method_; //!< Update method - RelativeOrbitModel relative_dynamics_model_type_; //!< Relative dynamics model type - StmModel stm_model_type_; //!< State Transition Matrix model type - RelativeInformation* relative_information_; //!< Relative information + RelativeOrbitUpdateMethod update_method_; //!< Update method + orbit::RelativeOrbitModel relative_dynamics_model_type_; //!< Relative dynamics model type + orbit::StmModel stm_model_type_; //!< State Transition Matrix model type + RelativeInformation* relative_information_; //!< Relative information /** * @fn InitializeState @@ -102,7 +102,7 @@ class RelativeOrbit : public Orbit, public math::OrdinaryDifferentialEquation<6> * @param [in] reference_sat_orbit: Orbit information of reference satellite * @param [in] gravity_constant_m3_s2: Gravity constant of the center body [m3/s2] */ - void CalculateSystemMatrix(RelativeOrbitModel relative_dynamics_model_type, const Orbit* reference_sat_orbit, double gravity_constant_m3_s2); + void CalculateSystemMatrix(orbit::RelativeOrbitModel relative_dynamics_model_type, const Orbit* reference_sat_orbit, double gravity_constant_m3_s2); /** * @fn CalculateStm * @brief Calculate State Transition Matrix @@ -111,7 +111,7 @@ class RelativeOrbit : public Orbit, public math::OrdinaryDifferentialEquation<6> * @param [in] gravity_constant_m3_s2: Gravity constant of the center body [m3/s2] * @param [in] elapsed_sec: Elapsed time [sec] */ - void CalculateStm(StmModel stm_model_type, const Orbit* reference_sat_orbit, double gravity_constant_m3_s2, double elapsed_sec); + void CalculateStm(orbit::StmModel stm_model_type, const Orbit* reference_sat_orbit, double gravity_constant_m3_s2, double elapsed_sec); /** * @fn PropagateRk4 * @brief Propagate relative orbit with RK4 diff --git a/src/environment/global/gnss_satellites.cpp b/src/environment/global/gnss_satellites.cpp index d68216ea2..c3af068f2 100644 --- a/src/environment/global/gnss_satellites.cpp +++ b/src/environment/global/gnss_satellites.cpp @@ -15,6 +15,8 @@ #include "setting_file_reader/initialize_file_access.hpp" #include "utilities/macros.hpp" +using namespace gnss; + const size_t kNumberOfInterpolation = 9; void GnssSatellites::Initialize(const std::vector& sp3_files, const EpochTime start_time) { @@ -38,7 +40,7 @@ void GnssSatellites::Initialize(const std::vector& sp3_files, con reference_time_ = EpochTime(initial_sp3_file.GetEpochData(reference_interpolation_id_)); // Initialize orbit - orbit_.assign(number_of_calculated_gnss_satellites_, InterpolationOrbit(kNumberOfInterpolation)); + orbit_.assign(number_of_calculated_gnss_satellites_, orbit::InterpolationOrbit(kNumberOfInterpolation)); // Initialize clock std::vector temp; diff --git a/src/environment/global/gnss_satellites.hpp b/src/environment/global/gnss_satellites.hpp index a3021e64c..0aa46ef38 100644 --- a/src/environment/global/gnss_satellites.hpp +++ b/src/environment/global/gnss_satellites.hpp @@ -54,7 +54,7 @@ class GnssSatellites : public ILoggable { * @param [in] sp3_files: List of SP3 files * @param [in] start_time: The simulation start time */ - void Initialize(const std::vector& sp3_files, const EpochTime start_time); + void Initialize(const std::vector& sp3_files, const EpochTime start_time); /** * @fn IsCalcEnabled @@ -113,15 +113,15 @@ class GnssSatellites : public ILoggable { private: bool is_calc_enabled_ = false; //!< Flag to manage the GNSS satellite position calculation - std::vector sp3_files_; //!< List of SP3 files + std::vector sp3_files_; //!< List of SP3 files size_t number_of_calculated_gnss_satellites_; //!< Number of calculated GNSS satellites size_t sp3_file_id_; //!< Current SP3 file ID EpochTime reference_time_; //!< Reference start time of the SP3 handling size_t reference_interpolation_id_ = 0; //!< Reference epoch ID of the interpolation EpochTime current_epoch_time_; //!< The last updated time - std::vector orbit_; //!< GNSS satellite orbit with interpolation - std::vector clock_; //!< GNSS satellite clock offset with interpolation + std::vector orbit_; //!< GNSS satellite orbit with interpolation + std::vector clock_; //!< GNSS satellite clock offset with interpolation // References const EarthRotation& earth_rotation_; //!< Earth rotation @@ -133,7 +133,7 @@ class GnssSatellites : public ILoggable { * @param [in] current_time: Target time * @return true means no error, false means the time argument is out of range */ - bool GetCurrentSp3File(Sp3FileReader& current_sp3_file, const EpochTime current_time); + bool GetCurrentSp3File(gnss::Sp3FileReader& current_sp3_file, const EpochTime current_time); /** * @fn UpdateInterpolationInformation diff --git a/src/math_physics/gnss/antex_file_reader.cpp b/src/math_physics/gnss/antex_file_reader.cpp index e9c379787..1547a3cf4 100644 --- a/src/math_physics/gnss/antex_file_reader.cpp +++ b/src/math_physics/gnss/antex_file_reader.cpp @@ -10,6 +10,8 @@ #include #include +namespace gnss { + #define ANTEX_LINE_TYPE_POSITION (60) AntexGridDefinition::AntexGridDefinition(const double zenith_start_angle_deg, const double zenith_end_angle_deg, const double zenith_step_angle_deg, @@ -196,3 +198,5 @@ DateTime AntexFileReader::ReadDateTime(std::string line) { sscanf(line.c_str(), "%zu %2zu %2zu %2zu %2zu %10lf", &year, &month, &day, &hour, &minute, &second); return DateTime(year, month, day, hour, minute, second); } + +} // namespace gnss diff --git a/src/math_physics/gnss/antex_file_reader.hpp b/src/math_physics/gnss/antex_file_reader.hpp index ef2ef64c4..e730b09c2 100644 --- a/src/math_physics/gnss/antex_file_reader.hpp +++ b/src/math_physics/gnss/antex_file_reader.hpp @@ -16,6 +16,8 @@ #include #include +namespace gnss { + /** * @class AntexGridDefinition * @brief grid data definition in ANTEX file @@ -343,4 +345,6 @@ class AntexFileReader { DateTime ReadDateTime(std::string line); }; +} // namespace gnss + #endif // S2E_LIBRARY_ANTEX_FILE_READER_HPP_ diff --git a/src/math_physics/gnss/bias_sinex_file_reader.cpp b/src/math_physics/gnss/bias_sinex_file_reader.cpp index ebb47913a..252523ebf 100644 --- a/src/math_physics/gnss/bias_sinex_file_reader.cpp +++ b/src/math_physics/gnss/bias_sinex_file_reader.cpp @@ -9,6 +9,8 @@ #include #include +namespace gnss { + bool BiasSinexFileReader::ReadFile(const std::string file_name) { // File open std::ifstream bias_sinex_file(file_name); @@ -242,3 +244,5 @@ void BiasSolutionData::SetTargetSignal(const std::string signal1, const std::str target_signal_ = BiasTargetSignal::kError; } } + +} // namespace gnss diff --git a/src/math_physics/gnss/bias_sinex_file_reader.hpp b/src/math_physics/gnss/bias_sinex_file_reader.hpp index 49d85e91e..20e591d0c 100644 --- a/src/math_physics/gnss/bias_sinex_file_reader.hpp +++ b/src/math_physics/gnss/bias_sinex_file_reader.hpp @@ -10,6 +10,8 @@ #include #include +namespace gnss { + /** * @enum BiasIdentifier * @brief Bias Identifier @@ -184,4 +186,6 @@ class BiasSinexFileReader { void ReadBiasSolution(std::ifstream& bias_sinex_file); }; +} // namespace gnss + #endif // S2E_LIBRARY_BIAS_SINEX_FILE_READER_HPP_ \ No newline at end of file diff --git a/src/math_physics/gnss/gnss_satellite_number.cpp b/src/math_physics/gnss/gnss_satellite_number.cpp index b3c53efba..6eb8861a5 100644 --- a/src/math_physics/gnss/gnss_satellite_number.cpp +++ b/src/math_physics/gnss/gnss_satellite_number.cpp @@ -5,6 +5,8 @@ #include "gnss_satellite_number.hpp" +namespace gnss { + size_t ConvertGnssSatelliteNumberToIndex(const std::string satellite_number) { switch (satellite_number.front()) { case 'G': @@ -58,3 +60,5 @@ std::string ConvertIndexToGnssSatelliteNumber(const size_t index) { return output; } + +} // namespace gnss diff --git a/src/math_physics/gnss/gnss_satellite_number.hpp b/src/math_physics/gnss/gnss_satellite_number.hpp index 08fd91576..35087c537 100644 --- a/src/math_physics/gnss/gnss_satellite_number.hpp +++ b/src/math_physics/gnss/gnss_satellite_number.hpp @@ -10,6 +10,8 @@ #include +namespace gnss { + // GNSS satellite number definition // TODO: Move to initialized file? const size_t kNumberOfGpsSatellite = 32; //!< Number of GPS satellites @@ -44,4 +46,6 @@ size_t ConvertGnssSatelliteNumberToIndex(const std::string satellite_number); */ std::string ConvertIndexToGnssSatelliteNumber(const size_t index); +} // namespace gnss + #endif // S2E_LIBRARY_GNSS_GNSS_SATELLITE_NUMBER_HPP_ diff --git a/src/math_physics/gnss/igs_product_name_handling.hpp b/src/math_physics/gnss/igs_product_name_handling.hpp index 7f2644e8d..e2352f76c 100644 --- a/src/math_physics/gnss/igs_product_name_handling.hpp +++ b/src/math_physics/gnss/igs_product_name_handling.hpp @@ -10,6 +10,8 @@ #include +namespace gnss { + /** * @fn GetOrbitClockFileName * @brief Return IGS orbit and clock final product file name @@ -83,4 +85,6 @@ size_t IncrementYearDoy(const size_t year_doy) { return output; } +} // namespace gnss + #endif // S2E_LIBRARY_GNSS_IGS_PRODUCT_NAME_HANDLING_HPP_ diff --git a/src/math_physics/gnss/sp3_file_reader.cpp b/src/math_physics/gnss/sp3_file_reader.cpp index 10043e10d..8106ba9cc 100644 --- a/src/math_physics/gnss/sp3_file_reader.cpp +++ b/src/math_physics/gnss/sp3_file_reader.cpp @@ -11,6 +11,8 @@ #include #include +namespace gnss { + Sp3FileReader::Sp3FileReader(const std::string file_name) { ReadFile(file_name); } DateTime Sp3FileReader::GetEpochData(const size_t epoch_id) const { @@ -419,3 +421,5 @@ Sp3VelocityClockRateCorrelation Sp3FileReader::DecodeVelocityClockRateCorrelatio return correlation; } + +} // namespace gnss diff --git a/src/math_physics/gnss/sp3_file_reader.hpp b/src/math_physics/gnss/sp3_file_reader.hpp index 4b7a017eb..e904b6050 100644 --- a/src/math_physics/gnss/sp3_file_reader.hpp +++ b/src/math_physics/gnss/sp3_file_reader.hpp @@ -17,6 +17,8 @@ #include #include +namespace gnss { + #define SP3_BAD_CLOCK_VALUE (999999.999999) #define SP3_BAD_POSITION_VALUE (0.000000) @@ -234,4 +236,6 @@ class Sp3FileReader { Sp3VelocityClockRateCorrelation DecodeVelocityClockRateCorrelation(std::string line); }; +} // namespace gnss + #endif // S2E_LIBRARY_GNSS_SP3_FILE_READER_HPP_ diff --git a/src/math_physics/gnss/test_antex_file_reader.cpp b/src/math_physics/gnss/test_antex_file_reader.cpp index d5d392f19..320c598af 100644 --- a/src/math_physics/gnss/test_antex_file_reader.cpp +++ b/src/math_physics/gnss/test_antex_file_reader.cpp @@ -7,6 +7,8 @@ #include "antex_file_reader.hpp" +using namespace gnss; + /** * @brief Test Constructor */ diff --git a/src/math_physics/gnss/test_bias_sinex_file_reader.cpp b/src/math_physics/gnss/test_bias_sinex_file_reader.cpp index 99c52c8d7..a681eedcc 100644 --- a/src/math_physics/gnss/test_bias_sinex_file_reader.cpp +++ b/src/math_physics/gnss/test_bias_sinex_file_reader.cpp @@ -2,6 +2,8 @@ #include "bias_sinex_file_reader.hpp" +using namespace gnss; + TEST(BiasSinex, Constructor) { // File read error check BiasSinexFileReader bias_sinex_file_fault("false_file_path.BSX"); diff --git a/src/math_physics/gnss/test_gnss_satellite_number.cpp b/src/math_physics/gnss/test_gnss_satellite_number.cpp index 5bbf535ee..259920e29 100644 --- a/src/math_physics/gnss/test_gnss_satellite_number.cpp +++ b/src/math_physics/gnss/test_gnss_satellite_number.cpp @@ -6,6 +6,8 @@ #include "gnss_satellite_number.hpp" +using namespace gnss; + /** * @brief Test satellite number to index */ diff --git a/src/math_physics/gnss/test_igs_product_name_handling.cpp b/src/math_physics/gnss/test_igs_product_name_handling.cpp index b674af7dc..f1af19529 100644 --- a/src/math_physics/gnss/test_igs_product_name_handling.cpp +++ b/src/math_physics/gnss/test_igs_product_name_handling.cpp @@ -7,6 +7,8 @@ #include "igs_product_name_handling.hpp" +using namespace gnss; + /** * @brief Test GetOrbitClockFinalFileName */ diff --git a/src/math_physics/gnss/test_sp3_file_reader.cpp b/src/math_physics/gnss/test_sp3_file_reader.cpp index 4a017894e..9ef514d41 100644 --- a/src/math_physics/gnss/test_sp3_file_reader.cpp +++ b/src/math_physics/gnss/test_sp3_file_reader.cpp @@ -6,6 +6,8 @@ #include "sp3_file_reader.hpp" +using namespace gnss; + /** * @brief Test Constructor */ diff --git a/src/math_physics/numerical_integration/test_runge_kutta.cpp b/src/math_physics/numerical_integration/test_runge_kutta.cpp index fd2438ec6..376406850 100644 --- a/src/math_physics/numerical_integration/test_runge_kutta.cpp +++ b/src/math_physics/numerical_integration/test_runge_kutta.cpp @@ -416,8 +416,8 @@ TEST(NUMERICAL_INTEGRATION, Integrate2dTwoBodyOrbitSmallEccentricity) { initial_position[1] = initial_state[1]; initial_velocity[0] = initial_state[2]; initial_velocity[1] = initial_state[3]; - OrbitalElements oe(1.0, 0.0, initial_position, initial_velocity); - KeplerOrbit kepler(1.0, oe); + orbit::OrbitalElements oe(1.0, 0.0, initial_position, initial_velocity); + orbit::KeplerOrbit kepler(1.0, oe); kepler.CalcOrbit((double)(step_num * step_width_s) / (24.0 * 60.0 * 60.0)); double error_tolerance = 2e-4; @@ -486,8 +486,8 @@ TEST(NUMERICAL_INTEGRATION, Integrate2dTwoBodyOrbitLargeEccentricity) { initial_position[1] = initial_state[1]; initial_velocity[0] = initial_state[2]; initial_velocity[1] = initial_state[3]; - OrbitalElements oe(1.0, 0.0, initial_position, initial_velocity); - KeplerOrbit kepler(1.0, oe); + orbit::OrbitalElements oe(1.0, 0.0, initial_position, initial_velocity); + orbit::KeplerOrbit kepler(1.0, oe); kepler.CalcOrbit((double)(step_num * step_width_s) / (24.0 * 60.0 * 60.0)); double error_tolerance = 2e-1; @@ -551,8 +551,8 @@ TEST(NUMERICAL_INTEGRATION, Interpolation2dTwoBodyOrbitSmallEccentricity) { initial_position[1] = initial_state[1]; initial_velocity[0] = initial_state[2]; initial_velocity[1] = initial_state[3]; - OrbitalElements oe(1.0, 0.0, initial_position, initial_velocity); - KeplerOrbit kepler(1.0, oe); + orbit::OrbitalElements oe(1.0, 0.0, initial_position, initial_velocity); + orbit::KeplerOrbit kepler(1.0, oe); kepler.CalcOrbit((double)(step_num * step_width_s) / (24.0 * 60.0 * 60.0)); double error_tolerance = 5e-2; @@ -646,8 +646,8 @@ TEST(NUMERICAL_INTEGRATION, Interpolation2dTwoBodyOrbitLargeEccentricity) { initial_position[1] = initial_state[1]; initial_velocity[0] = initial_state[2]; initial_velocity[1] = initial_state[3]; - OrbitalElements oe(1.0, 0.0, initial_position, initial_velocity); - KeplerOrbit kepler(1.0, oe); + orbit::OrbitalElements oe(1.0, 0.0, initial_position, initial_velocity); + orbit::KeplerOrbit kepler(1.0, oe); kepler.CalcOrbit((double)(step_num * step_width_s) / (24.0 * 60.0 * 60.0)); double error_tolerance = 1e-5; diff --git a/src/math_physics/orbit/interpolation_orbit.cpp b/src/math_physics/orbit/interpolation_orbit.cpp index c7d26302a..33d2843a5 100644 --- a/src/math_physics/orbit/interpolation_orbit.cpp +++ b/src/math_physics/orbit/interpolation_orbit.cpp @@ -5,6 +5,8 @@ #include "interpolation_orbit.hpp" +namespace orbit { + InterpolationOrbit::InterpolationOrbit(const size_t degree) { std::vector time; time.assign(degree, -1.0); @@ -34,3 +36,5 @@ math::Vector<3> InterpolationOrbit::CalcPositionWithTrigonometric(const double t } return output_position; } + +} // namespace orbit diff --git a/src/math_physics/orbit/interpolation_orbit.hpp b/src/math_physics/orbit/interpolation_orbit.hpp index 10a60ed6b..cf83660ab 100644 --- a/src/math_physics/orbit/interpolation_orbit.hpp +++ b/src/math_physics/orbit/interpolation_orbit.hpp @@ -10,6 +10,8 @@ #include #include +namespace orbit { + /** * @class InterpolationOrbit * @brief Orbit calculation with mathematical interpolation @@ -69,4 +71,6 @@ class InterpolationOrbit { std::vector interpolation_position_; // 3D vector of interpolation }; +} // namespace orbit + #endif // S2E_LIBRARY_ORBIT_INTERPOLATION_ORBIT_HPP_ diff --git a/src/math_physics/orbit/kepler_orbit.cpp b/src/math_physics/orbit/kepler_orbit.cpp index ca7458152..2b3878703 100644 --- a/src/math_physics/orbit/kepler_orbit.cpp +++ b/src/math_physics/orbit/kepler_orbit.cpp @@ -7,6 +7,8 @@ #include "../math/matrix_vector.hpp" #include "../math/s2e_math.hpp" +namespace orbit { + KeplerOrbit::KeplerOrbit() {} // Initialize with orbital elements KeplerOrbit::KeplerOrbit(const double gravity_constant_m3_s2, const OrbitalElements oe) : gravity_constant_m3_s2_(gravity_constant_m3_s2), oe_(oe) { @@ -97,3 +99,5 @@ double KeplerOrbit::SolveKeplerNewtonMethod(const double eccentricity, const dou } return u_rad; } + +} // namespace orbit diff --git a/src/math_physics/orbit/kepler_orbit.hpp b/src/math_physics/orbit/kepler_orbit.hpp index a19784a0d..fec55f130 100644 --- a/src/math_physics/orbit/kepler_orbit.hpp +++ b/src/math_physics/orbit/kepler_orbit.hpp @@ -10,6 +10,8 @@ #include "../math/vector.hpp" #include "./orbital_elements.hpp" +namespace orbit { + /** * @class KeplerOrbit * @brief Class to calculate Kepler orbit calculation @@ -87,4 +89,6 @@ class KeplerOrbit { double SolveKeplerNewtonMethod(const double eccentricity, const double mean_anomaly_rad, const double angle_limit_rad, const int iteration_limit); }; +} // namespace orbit + #endif // S2E_LIBRARY_ORBIT_KEPLER_ORBIT_HPP_ diff --git a/src/math_physics/orbit/orbital_elements.cpp b/src/math_physics/orbit/orbital_elements.cpp index dbd3e89d8..3fd2920b7 100644 --- a/src/math_physics/orbit/orbital_elements.cpp +++ b/src/math_physics/orbit/orbital_elements.cpp @@ -9,6 +9,8 @@ #include "../math/s2e_math.hpp" +namespace orbit { + OrbitalElements::OrbitalElements() {} // initialize with OE @@ -85,3 +87,5 @@ void OrbitalElements::CalcOeFromPosVel(const double gravity_constant_m3_s2, cons double dt_s = (u_rad - eccentricity_ * sin(u_rad)) / n_rad_s; epoch_jday_ = time_jday - dt_s / (24.0 * 60.0 * 60.0); } + +} // namespace orbit diff --git a/src/math_physics/orbit/orbital_elements.hpp b/src/math_physics/orbit/orbital_elements.hpp index 9b813ac5a..27424653e 100644 --- a/src/math_physics/orbit/orbital_elements.hpp +++ b/src/math_physics/orbit/orbital_elements.hpp @@ -8,6 +8,8 @@ #include "../math/vector.hpp" +namespace orbit { + /** * @class OrbitalElements * @brief Class for classical orbital elements @@ -104,4 +106,6 @@ class OrbitalElements { const math::Vector<3> velocity_i_m_s); }; +} // namespace orbit + #endif // S2E_LIBRARY_ORBIT_ORBITAL_ELEMENTS_HPP_ diff --git a/src/math_physics/orbit/relative_orbit_models.cpp b/src/math_physics/orbit/relative_orbit_models.cpp index e7c83ca9a..a291e4633 100644 --- a/src/math_physics/orbit/relative_orbit_models.cpp +++ b/src/math_physics/orbit/relative_orbit_models.cpp @@ -4,6 +4,8 @@ */ #include "relative_orbit_models.hpp" +namespace orbit { + math::Matrix<6, 6> CalcHillSystemMatrix(double orbit_radius_m, double gravity_constant_m3_s2) { math::Matrix<6, 6> system_matrix; @@ -91,3 +93,5 @@ math::Matrix<6, 6> CalcHcwStm(double orbit_radius_m, double gravity_constant_m3_ stm[5][5] = cos(n * t); return stm; } + +} // namespace orbit diff --git a/src/math_physics/orbit/relative_orbit_models.hpp b/src/math_physics/orbit/relative_orbit_models.hpp index ff120823d..881d73bfb 100644 --- a/src/math_physics/orbit/relative_orbit_models.hpp +++ b/src/math_physics/orbit/relative_orbit_models.hpp @@ -9,6 +9,8 @@ #include "../math/matrix.hpp" #include "../math/vector.hpp" +namespace orbit { + /** * @enum RelativeOrbitModel * @brief Relative orbit model @@ -42,4 +44,6 @@ math::Matrix<6, 6> CalcHillSystemMatrix(const double orbit_radius_m, const doubl */ math::Matrix<6, 6> CalcHcwStm(const double orbit_radius_m, const double gravity_constant_m3_s2, const double elapsed_time_s); +} // namespace orbit + #endif // S2E_LIBRARY_ORBIT_RELATIVE_ORBIT_MODEL_HPP_ diff --git a/src/math_physics/orbit/test_interpolation_orbit.cpp b/src/math_physics/orbit/test_interpolation_orbit.cpp index 22439c87e..d7fe51c67 100644 --- a/src/math_physics/orbit/test_interpolation_orbit.cpp +++ b/src/math_physics/orbit/test_interpolation_orbit.cpp @@ -8,6 +8,8 @@ #include "interpolation_orbit.hpp" +using namespace orbit; + /** * @brief Test for Constructor function */