Skip to content

Commit

Permalink
Merge pull request #596 from ut-issl/feature/use-geodetic-position
Browse files Browse the repository at this point in the history
Use geodetic position in GnssReceiver
  • Loading branch information
200km authored Feb 7, 2024
2 parents eb93772 + 1204b94 commit 093afc7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
8 changes: 4 additions & 4 deletions src/components/real/aocs/gnss_receiver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ void GnssReceiver::MainRoutine(const int time_count) {
if (is_gnss_visible_) {
// Antenna of GNSS-R can detect GNSS signal
position_ecef_m_ = dynamics_->GetOrbit().GetPosition_ecef_m();
position_llh_ = dynamics_->GetOrbit().GetLatLonAlt();
velocity_ecef_m_s_ = dynamics_->GetOrbit().GetVelocity_ecef_m_s();
AddNoise(position_true_eci_, position_ecef_m_);
geodetic_position_.UpdateFromEcef(position_ecef_m_);
} else {
// position information will not be updated in this case
utc_ = simulation_time_->GetCurrentUtc();
Expand Down Expand Up @@ -229,9 +229,9 @@ std::string GnssReceiver::GetLogValue() const // For logs
str_tmp += WriteScalar(utc_.second);
str_tmp += WriteVector(position_eci_m_, 10);
str_tmp += WriteVector(velocity_ecef_m_s_, 10);
str_tmp += WriteScalar(position_llh_[0], 10);
str_tmp += WriteScalar(position_llh_[1], 10);
str_tmp += WriteScalar(position_llh_[2], 10);
str_tmp += WriteScalar(geodetic_position_.GetLatitude_rad(), 10);
str_tmp += WriteScalar(geodetic_position_.GetLongitude_rad(), 10);
str_tmp += WriteScalar(geodetic_position_.GetAltitude_m(), 10);
str_tmp += WriteScalar(is_gnss_visible_);
str_tmp += WriteScalar(visible_satellite_number_);

Expand Down
7 changes: 2 additions & 5 deletions src/components/real/aocs/gnss_receiver.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,7 @@ class GnssReceiver : public Component, public ILoggable {
* @fn GetMeasuredGeodeticPosition
* @brief Return Observed position in the LLH frame [m]
*/
inline const GeodeticPosition GetMeasuredGeodeticPosition(void) const {
GeodeticPosition geodetic_position(position_llh_[0], position_llh_[1], position_llh_[2]);
return geodetic_position;
}
inline const GeodeticPosition GetMeasuredGeodeticPosition(void) const { return geodetic_position_; }
/**
* @fn GetMeasuredVelocity_eci_m_s
* @brief Return Observed velocity in the ECI frame [m/s]
Expand Down Expand Up @@ -158,7 +155,7 @@ class GnssReceiver : public Component, public ILoggable {
libra::Vector<3> velocity_eci_m_s_{0.0}; //!< Observed velocity in the ECI frame [m/s]
libra::Vector<3> position_ecef_m_{0.0}; //!< Observed position in the ECEF frame [m]
libra::Vector<3> velocity_ecef_m_s_{0.0}; //!< Observed velocity in the ECEF frame [m/s]
libra::Vector<3> position_llh_{0.0}; //!< Observed position in the geodetic frame [rad,rad,m] TODO: use GeodeticPosition class
GeodeticPosition geodetic_position_; //!< Observed position in the geodetic frame
UTC utc_ = {2000, 1, 1, 0, 0, 0.0}; //!< Observed time in UTC [year, month, day, hour, min, sec]
unsigned int gps_time_week_ = 0; //!< Observed GPS time week part
double gps_time_s_ = 0.0; //!< Observed GPS time second part
Expand Down

0 comments on commit 093afc7

Please sign in to comment.