generated from ut-issl/repository-template
-
Notifications
You must be signed in to change notification settings - Fork 20
Add GNSS receiver pseudorange calculation #730
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
fukudakazuya
merged 18 commits into
feature/gnss-receiver-update
from
feature/gnss-receiver-update-pseudorange
Jan 10, 2025
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
aa2a3d8
Add pseudorange calculation
fukudakazuya b61e5de
Add pseudorange plot
fukudakazuya 3b86b44
Modify significant digits, add comments
fukudakazuya ccaa99c
Fix format
fukudakazuya 3ab2ba9
Fix small
fukudakazuya 2032f85
Modify significant digits
fukudakazuya 951eeb9
Delete pseudorange calculation
fukudakazuya 1f6d31e
Modify logging
fukudakazuya b693e5f
Modify pseudorange calculation
fukudakazuya b18e9ea
Modify pseudorange calculation
fukudakazuya 0f8e2f3
Modify pseudorange calculation
fukudakazuya 7413a69
Modify pseudorange calculation
fukudakazuya 0221d27
Modify pseudorange calculation
fukudakazuya 1914899
Modify pseudorange calculation
fukudakazuya 3fe25d2
Modify pseudorange calculation
fukudakazuya 48e6d6d
Modify scatter
fukudakazuya 1c28bc6
Modify pseudorange calculation
fukudakazuya ff9a039
Add unit
fukudakazuya File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
# | ||
# Plot GNSS Receiver Pseudorange | ||
# | ||
# arg[1] : read_file_tag : time tag for default CSV output log file. ex. 220627_142946 | ||
# | ||
|
||
# | ||
# Import | ||
# | ||
# plots | ||
import matplotlib.pyplot as plt | ||
# numpy | ||
import numpy as np | ||
# local function | ||
from common import find_latest_log_tag | ||
from common import add_log_file_arguments | ||
from common import read_3d_vector_from_csv | ||
from common import read_scalar_from_csv | ||
# arguments | ||
import argparse | ||
|
||
# Arguments | ||
aparser = argparse.ArgumentParser() | ||
aparser = add_log_file_arguments(aparser) | ||
aparser.add_argument('--no-gui', action='store_true') | ||
args = aparser.parse_args() | ||
|
||
# | ||
# Read Arguments | ||
# | ||
# log file path | ||
path_to_logs = args.logs_dir | ||
|
||
read_file_tag = args.file_tag | ||
if read_file_tag == None: | ||
print("file tag does not found. use latest.") | ||
read_file_tag = find_latest_log_tag(path_to_logs) | ||
|
||
print("log: " + read_file_tag) | ||
|
||
# | ||
# CSV file name | ||
# | ||
read_file_name = path_to_logs + '/' + 'logs_' + read_file_tag + '/' + read_file_tag + '_default.csv' | ||
|
||
# | ||
# Data read and edit | ||
# | ||
# Read S2E CSV | ||
time = read_scalar_from_csv(read_file_name, 'elapsed_time[s]') | ||
|
||
plt.figure(0) | ||
for gps_idx in range(32): | ||
gps_str = 'GPS' + str(gps_idx) | ||
pseudorange = read_scalar_from_csv(read_file_name, gps_str + '_pseudorange[m]') | ||
plt.scatter(time[0][1:], pseudorange[0][1:], marker=".", label=gps_str) | ||
|
||
plt.title("GPS Psuedorange") | ||
plt.xlabel("Time [s]") | ||
plt.ylabel("Psuedorange [m]") | ||
plt.legend(fontsize=7, loc="upper right") | ||
|
||
|
||
plt.figure(1) | ||
spacecraft_position_ecef_m = read_3d_vector_from_csv(read_file_name, 'spacecraft_position_ecef', 'm')[:, :-1] | ||
for gps_idx in range(32): | ||
gps_str = 'GPS' + str(gps_idx) | ||
pseudorange = read_scalar_from_csv(read_file_name, gps_str + '_pseudorange[m]')[:, 1:] | ||
gps_position = read_3d_vector_from_csv(read_file_name, gps_str + '_position_ecef', 'm')[:, 1:] | ||
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) | ||
|
||
plt.title("GPS Pseudorange Error") | ||
plt.xlabel("Time [s]") | ||
plt.ylabel("Pseudorange Error [m]") | ||
plt.legend(fontsize=7, loc="upper right") | ||
|
||
# Data save | ||
if args.no_gui: | ||
plt.savefig(read_file_tag + "_gnss_receiver_pseudorange.png") # save last figure only | ||
else: | ||
plt.show() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.