Skip to content

Commit

Permalink
Add gnss namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
200km committed Jul 20, 2024
1 parent fa7a41a commit 1e52b2e
Show file tree
Hide file tree
Showing 16 changed files with 51 additions and 3 deletions.
2 changes: 2 additions & 0 deletions src/environment/global/gnss_satellites.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<Sp3FileReader>& sp3_files, const EpochTime start_time) {
Expand Down
6 changes: 3 additions & 3 deletions src/environment/global/gnss_satellites.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<Sp3FileReader>& sp3_files, const EpochTime start_time);
void Initialize(const std::vector<gnss::Sp3FileReader>& sp3_files, const EpochTime start_time);

/**
* @fn IsCalcEnabled
Expand Down Expand Up @@ -113,7 +113,7 @@ class GnssSatellites : public ILoggable {
private:
bool is_calc_enabled_ = false; //!< Flag to manage the GNSS satellite position calculation

std::vector<Sp3FileReader> sp3_files_; //!< List of SP3 files
std::vector<gnss::Sp3FileReader> 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
Expand All @@ -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
Expand Down
4 changes: 4 additions & 0 deletions src/math_physics/gnss/antex_file_reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
#include <iostream>
#include <math_physics/gnss/gnss_satellite_number.hpp>

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,
Expand Down Expand Up @@ -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
4 changes: 4 additions & 0 deletions src/math_physics/gnss/antex_file_reader.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
#include <string>
#include <vector>

namespace gnss {

/**
* @class AntexGridDefinition
* @brief grid data definition in ANTEX file
Expand Down Expand Up @@ -343,4 +345,6 @@ class AntexFileReader {
DateTime ReadDateTime(std::string line);
};

} // namespace gnss

#endif // S2E_LIBRARY_ANTEX_FILE_READER_HPP_
4 changes: 4 additions & 0 deletions src/math_physics/gnss/bias_sinex_file_reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
#include <fstream>
#include <iostream>

namespace gnss {

bool BiasSinexFileReader::ReadFile(const std::string file_name) {
// File open
std::ifstream bias_sinex_file(file_name);
Expand Down Expand Up @@ -242,3 +244,5 @@ void BiasSolutionData::SetTargetSignal(const std::string signal1, const std::str
target_signal_ = BiasTargetSignal::kError;
}
}

} // namespace gnss
4 changes: 4 additions & 0 deletions src/math_physics/gnss/bias_sinex_file_reader.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
#include <string>
#include <vector>

namespace gnss {

/**
* @enum BiasIdentifier
* @brief Bias Identifier
Expand Down Expand Up @@ -184,4 +186,6 @@ class BiasSinexFileReader {
void ReadBiasSolution(std::ifstream& bias_sinex_file);
};

} // namespace gnss

#endif // S2E_LIBRARY_BIAS_SINEX_FILE_READER_HPP_
4 changes: 4 additions & 0 deletions src/math_physics/gnss/gnss_satellite_number.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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':
Expand Down Expand Up @@ -58,3 +60,5 @@ std::string ConvertIndexToGnssSatelliteNumber(const size_t index) {

return output;
}

} // namespace gnss
4 changes: 4 additions & 0 deletions src/math_physics/gnss/gnss_satellite_number.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

#include <string>

namespace gnss {

// GNSS satellite number definition
// TODO: Move to initialized file?
const size_t kNumberOfGpsSatellite = 32; //!< Number of GPS satellites
Expand Down Expand Up @@ -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_
4 changes: 4 additions & 0 deletions src/math_physics/gnss/igs_product_name_handling.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

#include <string>

namespace gnss {

/**
* @fn GetOrbitClockFileName
* @brief Return IGS orbit and clock final product file name
Expand Down Expand Up @@ -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_
4 changes: 4 additions & 0 deletions src/math_physics/gnss/sp3_file_reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
#include <fstream>
#include <iostream>

namespace gnss {

Sp3FileReader::Sp3FileReader(const std::string file_name) { ReadFile(file_name); }

DateTime Sp3FileReader::GetEpochData(const size_t epoch_id) const {
Expand Down Expand Up @@ -419,3 +421,5 @@ Sp3VelocityClockRateCorrelation Sp3FileReader::DecodeVelocityClockRateCorrelatio

return correlation;
}

} // namespace gnss
4 changes: 4 additions & 0 deletions src/math_physics/gnss/sp3_file_reader.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
#include <string>
#include <vector>

namespace gnss {

#define SP3_BAD_CLOCK_VALUE (999999.999999)
#define SP3_BAD_POSITION_VALUE (0.000000)

Expand Down Expand Up @@ -234,4 +236,6 @@ class Sp3FileReader {
Sp3VelocityClockRateCorrelation DecodeVelocityClockRateCorrelation(std::string line);
};

} // namespace gnss

#endif // S2E_LIBRARY_GNSS_SP3_FILE_READER_HPP_
2 changes: 2 additions & 0 deletions src/math_physics/gnss/test_antex_file_reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

#include "antex_file_reader.hpp"

using namespace gnss;

/**
* @brief Test Constructor
*/
Expand Down
2 changes: 2 additions & 0 deletions src/math_physics/gnss/test_bias_sinex_file_reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
2 changes: 2 additions & 0 deletions src/math_physics/gnss/test_gnss_satellite_number.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

#include "gnss_satellite_number.hpp"

using namespace gnss;

/**
* @brief Test satellite number to index
*/
Expand Down
2 changes: 2 additions & 0 deletions src/math_physics/gnss/test_igs_product_name_handling.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

#include "igs_product_name_handling.hpp"

using namespace gnss;

/**
* @brief Test GetOrbitClockFinalFileName
*/
Expand Down
2 changes: 2 additions & 0 deletions src/math_physics/gnss/test_sp3_file_reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

#include "sp3_file_reader.hpp"

using namespace gnss;

/**
* @brief Test Constructor
*/
Expand Down

0 comments on commit 1e52b2e

Please sign in to comment.