Skip to content

Commit

Permalink
Fix small
Browse files Browse the repository at this point in the history
  • Loading branch information
fukudakazuya committed Dec 31, 2024
1 parent ccaa99c commit 3ab2ba9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
3 changes: 1 addition & 2 deletions scripts/Plot/plot_gnss_receiver_pseudorange.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,7 @@
geometric_range = np.linalg.norm(gps_position - spacecraft_position_ecef_m, axis=0)
pseudorange_error = pseudorange - geometric_range
plt.scatter(time[0][:-1], pseudorange_error, marker=".", label=gps_str)
print(spacecraft_position_ecef_m[0])
print(geometric_range[0])

plt.title("GPS Pseudorange Error")
plt.xlabel("Time [s]")
plt.ylabel("Pseudorange Error [m]")
Expand Down
7 changes: 3 additions & 4 deletions src/components/real/aocs/gnss_receiver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,8 @@ void GnssReceiver::MainRoutine(const int time_count) {
size_t number_of_calculated_gnss_satellites = gnss_satellites_->GetNumberOfCalculatedSatellite();
for (size_t i = 0; i < number_of_calculated_gnss_satellites; i++) {
math::Vector<3> gnss_satellite_position_ecef_m = gnss_satellites_->GetPosition_ecef_m(i);
math::Vector<3> receiver_position_ecef_m = dynamics_->GetOrbit().GetPosition_ecef_m();
math::Vector<3> a = gnss_satellite_position_ecef_m - receiver_position_ecef_m;
double geometric_distance_m = a.CalcNorm();
math::Vector<3> position_true_ecef_m = dynamics_->GetOrbit().GetPosition_ecef_m();
double geometric_distance_m = (gnss_satellite_position_ecef_m - position_true_ecef_m).CalcNorm();
randomization::NormalRand pseudorange_random_noise_m;
pseudorange_random_noise_m.SetParameters(0.0, pseudorange_noise_standard_deviation_m_, randomization::global_randomization.MakeSeed());
double pseudorange_m = geometric_distance_m + pseudorange_random_noise_m;
Expand Down Expand Up @@ -258,7 +257,7 @@ std::string GnssReceiver::GetLogValue() const // For logs
str_tmp += logger::WriteScalar(is_gnss_visible_);
str_tmp += logger::WriteScalar(visible_satellite_number_);
for (size_t gps_index = 0; gps_index < kNumberOfGpsSatellite; gps_index++) {
str_tmp += logger::WriteScalar(pseudorange_list_m_[gps_index], 16);
str_tmp += logger::WriteScalar(pseudorange_list_m_[gps_index], 10);
}

return str_tmp;
Expand Down

0 comments on commit 3ab2ba9

Please sign in to comment.