Skip to content
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

Refactor GNSS receiver #599

Merged
merged 139 commits into from
Mar 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
139 commits
Select commit Hold shift + click to select a range
32ad26e
Delete estimated GNSS position value
200km Dec 19, 2023
8a34119
Delete debug output
200km Dec 19, 2023
3c128ca
Remove true prefix
200km Dec 19, 2023
46631c0
Replace GNSS satellite number/index convert function
200km Dec 19, 2023
8dee587
Fix int to size_t
200km Dec 19, 2023
e17cf62
Rename function to show GNSS satellite functions
200km Dec 19, 2023
b068c99
Rename satellite clock offset getter functions
200km Dec 19, 2023
bfd1bbe
Rename satellite clock offset getter functions
200km Dec 19, 2023
9f4b7b7
Rename satellite position getter functions
200km Dec 19, 2023
abd73dd
Change to inline function
200km Dec 19, 2023
c60e397
Rename pseudorange functions
200km Dec 19, 2023
ab24b26
Rename carrier phase functions
200km Dec 19, 2023
badeac0
Rename receiver position
200km Dec 19, 2023
6bdeabc
Rename frequency argument name
200km Dec 19, 2023
2822357
Rename receiver clock name argument name
200km Dec 19, 2023
0c032b6
Add frame information for argument name
200km Dec 19, 2023
606ad59
Merge pull request #558 from ut-issl/feature/remove-gnss-estimation
200km Jan 16, 2024
7b7200e
Merge pull request #559 from ut-issl/feature/replace-functions-in-gns…
200km Jan 16, 2024
ad3b4d6
Merge pull request #560 from ut-issl/feature/fix-gnss-function-name
200km Jan 16, 2024
4fd3fee
Merge branch 'develop' into feature/refactor-gnss
200km Jan 29, 2024
00c30df
Remove rapid/ultra rapid GNSS solution
200km Jan 29, 2024
1884063
Remove unused ECI/ECEF enum
200km Jan 29, 2024
11b27b3
Delete undefined function
200km Jan 29, 2024
106b233
Delete redundant assertion
200km Jan 29, 2024
665fe4e
Delete redundant assertion
200km Jan 29, 2024
caf44a7
Delete redundant assertion
200km Jan 29, 2024
e04c735
Delete redundant assertion
200km Jan 29, 2024
97af748
Fix assertion in getter functoins in GNSS
200km Jan 29, 2024
0f27171
Delete GnssSatelliteInformation
200km Jan 29, 2024
abe07f0
Move simple functions to inline functions
200km Jan 29, 2024
3dd3d19
Remove unused header includes
200km Jan 29, 2024
e3e3c41
Merge pull request #581 from ut-issl/feature/remove-rapid-solution
200km Jan 30, 2024
d515b94
Merge pull request #582 from ut-issl/feature/summarize-gnss-functions
200km Jan 30, 2024
bf40d7b
Merge pull request #583 from ut-issl/feature/remove-unused-include
200km Jan 30, 2024
94b58a9
Add directory for GNSS final products
200km Jan 30, 2024
6fd9228
Rename default directory path for GNSS
200km Jan 30, 2024
43a76b9
Add logging setting for GNSS
200km Jan 30, 2024
b8ae3df
Summerize GNSS product file limitations
200km Jan 30, 2024
5776367
fix small
200km Jan 30, 2024
797bda7
Modify duration of GNSS input file
200km Jan 30, 2024
eaccc0e
Remove interpolation settings
200km Jan 30, 2024
fae7f70
fix small
200km Jan 30, 2024
7696139
fix small
200km Jan 30, 2024
83bbfa8
Remove unused interpolation_method variables
200km Jan 30, 2024
caa735b
Use constant number for interpolation because it is usually fixed
200km Jan 30, 2024
ee7e9d3
Add log enable flag in InitGnss
200km Jan 30, 2024
fdb2979
Modify InitGnssSatellite to suit with the updated ini file
200km Jan 30, 2024
8f6624b
Add const
200km Jan 30, 2024
a9d5a23
Fix footer input data
200km Jan 30, 2024
5d899e8
Add IGS file name handling functions
200km Jan 30, 2024
093ebf6
Add reference
200km Jan 30, 2024
5b5b73b
Implement SP3 file name calculation
200km Jan 30, 2024
8c84180
fix small
200km Jan 30, 2024
37272dc
Delete old functions
200km Jan 30, 2024
25dc79c
Add test codes for igs_product_name_handling
200km Jan 30, 2024
cd61061
Fix test name
200km Jan 30, 2024
3fc4f69
Add test codes for MergeYearDoy
200km Jan 30, 2024
99762be
Add test codes for PerseFromYearDoy
200km Jan 30, 2024
0150515
Add test codes for IncrementYearDoy
200km Jan 30, 2024
3222dbc
Move InitGnssSatellites function
200km Jan 31, 2024
7a3168e
Delete Initialize function file for GNSS and CLK file reading function
200km Jan 31, 2024
1912852
fix small
200km Jan 31, 2024
92a5edd
Merge pull request #587 from ut-issl/feature/modify-gnss-file-input
200km Feb 1, 2024
cdffab2
Merge pull request #588 from ut-issl/feature/modify-sp3-reading
200km Feb 1, 2024
f488564
Merge pull request #589 from ut-issl/feature/remove-clk-file-reading
200km Feb 1, 2024
878a08d
Remove unnecessary classes and functions
200km Feb 5, 2024
83f271e
Fix directory path of GNSS product files
200km Feb 5, 2024
d4753da
Merge branch 'develop' into feature/refactor-gnss
200km Feb 5, 2024
9ff3d8e
Merge branch 'feature/refactor-gnss' into feature/implement-sp3-orbit…
200km Feb 5, 2024
83402dc
Add nearest epoch search function for SP3 file
200km Feb 5, 2024
6f67443
Implement update function for GNSS satellites
200km Feb 5, 2024
3cf520d
Add Getter functions
200km Feb 5, 2024
dc03fd0
Fix log output unit info
200km Feb 5, 2024
c779fc4
Add comments for GNSS satelite
200km Feb 5, 2024
1529859
Fix for the initial data
200km Feb 5, 2024
e8baad7
Delete unused setup function
200km Feb 5, 2024
c718205
Delete unused valid function
200km Feb 5, 2024
e3b85e0
Add ECI conversion for GNSS satellites
200km Feb 5, 2024
a539e8f
Fix GetEarthRotation
200km Feb 5, 2024
ee76f5c
Fix log output
200km Feb 5, 2024
2c5490c
Move long inline function to cpp
200km Feb 5, 2024
4ed9aaf
Add assertion
200km Feb 5, 2024
80cdaa5
Fix small
200km Feb 5, 2024
09d4031
Fix default value
200km Feb 5, 2024
30c8f1e
Fix bug
200km Feb 5, 2024
3af72fc
Fix unit
200km Feb 5, 2024
6360ee1
Switch for place
200km Feb 5, 2024
e16bf09
Add file change sequence
200km Feb 6, 2024
0aba406
Fix to get access all satellite information
200km Feb 6, 2024
76f0420
Fix comment
200km Feb 6, 2024
d1c3669
Fix comment
200km Feb 6, 2024
396a99c
Fix to use size_t for component ID
200km Feb 6, 2024
e08a4e7
Fix to use size_t for visible sat number
200km Feb 6, 2024
c1f2cc2
Fix to use size_t instead of int
200km Feb 6, 2024
5876eb0
Fix to use bool instead of int
200km Feb 6, 2024
e8f81b6
Add const to function arguments
200km Feb 6, 2024
73360ed
Fix typos
200km Feb 6, 2024
068a374
Fix initial value of bool
200km Feb 6, 2024
3c9db6f
Small refactors
200km Feb 6, 2024
d9e3841
Fix function name to suit with the coding rule
200km Feb 6, 2024
30eaeef
Simplify the internal function
200km Feb 6, 2024
f17ebf1
Fix argument unit
200km Feb 6, 2024
85dc2f3
Fix internal variables name suit with the naming rule
200km Feb 6, 2024
de05d4d
Fix internal variables name suit with the naming rule
200km Feb 6, 2024
6e0c63d
Fix comment
200km Feb 6, 2024
c79ae7a
Fix unit of harf width angle
200km Feb 6, 2024
92e5374
Fix to use normalize function
200km Feb 6, 2024
d9a89e8
Fix variable name to suit with coding rule
200km Feb 6, 2024
e2f8d3d
Fix to use geodetic position
200km Feb 6, 2024
1204b94
Fix to add noise for the geodetic position
200km Feb 6, 2024
564d956
Fix comments in ini file
200km Feb 6, 2024
9df6917
Rename gnss_id to gnss_system_id
200km Feb 6, 2024
0ad7095
Fix comment
200km Feb 6, 2024
538acf8
Remove max channel because it is not used
200km Feb 6, 2024
c53946d
Clean up local variables definition
200km Feb 6, 2024
598c40b
Modify antenna model interface
200km Feb 6, 2024
d59b95b
Merge pull request #593 from ut-issl/feature/fix-int-size_t-conversion
200km Feb 7, 2024
eb93772
Merge pull request #594 from ut-issl/feature/fix-functions-gnss-receiver
200km Feb 7, 2024
093afc7
Merge pull request #596 from ut-issl/feature/use-geodetic-position
200km Feb 7, 2024
3a666c0
Add description comment
200km Feb 7, 2024
827ec0c
Modify to use ECEF frame for noise definition and Add velocity noise
200km Feb 7, 2024
45e63fd
Fix small
200km Feb 7, 2024
075b8d2
Fix comments
200km Feb 7, 2024
c7eeacb
Remove ECI observation information
200km Feb 7, 2024
2bee223
Add comment
200km Feb 7, 2024
9e4f68d
Fix comment
200km Feb 7, 2024
d45cf2c
Fix GNSS visibility threhold to 4
200km Feb 7, 2024
53bcd76
Modify to use GNSS satellite calculated number
200km Feb 7, 2024
5357837
Delete GNSS system ID because it should be defined in GnssSatellites
200km Feb 7, 2024
7d47089
Add comment
200km Feb 7, 2024
7249e7a
Fix python plot for GnssReceiver
200km Feb 7, 2024
e285179
Fix visible satellite detection method for cone antenna model
200km Feb 7, 2024
df0fe71
Add ECEF position log
200km Feb 7, 2024
463c032
Uncomment ECEF position log read in plot gnss receiver
200km Feb 7, 2024
f08f45b
Fix warning
200km Feb 7, 2024
787d23e
Merge pull request #604 from ut-issl/feature/add-ecef-position-log
200km Mar 6, 2024
5505198
Merge pull request #597 from ut-issl/feature/fix-gnss-receiver-ini-file
200km Mar 12, 2024
37153dd
Merge pull request #601 from ut-issl/feature/fix-visibility-threshold
200km Mar 12, 2024
0e9eafc
Merge pull request #602 from ut-issl/feature/final-check-gnss-receiver
200km Mar 12, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 15 additions & 20 deletions data/sample/initialize_files/components/gnss_receiver.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,37 +6,32 @@ antenna_position_b_m(0) = 0.0125
antenna_position_b_m(1) = 0.0000
antenna_position_b_m(2) = 0.1815

// Quaternion from body frame to component frame
// Quaternion from body frame to component frame of the antenna
// Note: The antenna boresight direction is +Z direction at the component frame
quaternion_b2c(0) = 0.0
quaternion_b2c(1) = 0.0
quaternion_b2c(2) = 0.0
quaternion_b2c(3) = 1.0

// Antenna model
// 0... simple model : GNSS sats are visible when antenna directs anti-earth direction
// 1... cone model : GNSS sats visible when a sat is in a cone
antenna_model = 0
// SIMPLE: We assume that GNSS satellites are visible when antenna directs anti-earth direction
// CONE: We calculate the number of GNSS satellites in the antenna,
// and the position is observable when more than 4 satellites are in the antenna.
// Note : We need to enable the GNSS satellite calculation when we use this mode.
// All satellites managed in the GnssSatellite class are used in this model.
antenna_model = SIMPLE

// Antenna half width [deg]
antenna_half_width_deg = 60

// Number of channels
maximum_channel = 8
// Random noise for simple position observation
white_noise_standard_deviation_position_ecef_m(0) = 2000.0
white_noise_standard_deviation_position_ecef_m(1) = 1000.0
white_noise_standard_deviation_position_ecef_m(2) = 1500.0

// GNSS ID
// G...GPS
// R...GLONASS
// E...Galileo
// C...Beidou
// J...QZSS
// if your receiver is compatible with all kind of gnss satellites : GRECJ
// if your receiver is compatible with GPS and QZSS : GJ
gnss_id = G

//Random noise [m]
white_noise_standard_deviation_eci_m(0) = 10000.0
white_noise_standard_deviation_eci_m(1) = 1000.0
white_noise_standard_deviation_eci_m(2) = 1000.0
white_noise_standard_deviation_velocity_ecef_m_s(0) = 1.0
white_noise_standard_deviation_velocity_ecef_m_s(1) = 1.5
white_noise_standard_deviation_velocity_ecef_m_s(2) = 2.0

[POWER_PORT]
minimum_voltage_V = 3.3
Expand Down
Empty file.
99 changes: 34 additions & 65 deletions data/sample/initialize_files/sample_gnss.ini
Original file line number Diff line number Diff line change
@@ -1,67 +1,36 @@
[GNSS_SATELLITES]
directory_path = EXT_LIB_DIR_FROM_EXE/sp3/
directory_path = INI_FILE_DIR_FROM_EXE/gnss/final_products/
calculation = DISABLE

// Choose from IGS, CODE_Final, JAXA_Final, QZSS_Final
true_position_file_sort = IGS

// As small as possible within the range.
true_position_first = igs21610.sp3
true_position_last = igs21613.sp3

// Choose from 0: Lagrange, 1: Trigonometric : temporarily, only Trigonometric is valid, Lagrange is not yet implemented.
true_position_interpolation_method = 1

// If you chose Trigonometric as interpolation method, you must choose odds number here.
true_position_interpolation_number = 9

// Choose frome .sp3, .clk_30s or .clk
true_clock_file_extension = .clk_30s

// Choose from IGS, CODE_Final, JAXA_Final, QZSS_Final
// If you choose clk_30s, should choose the one equivalent to final, if you choose clk should choose the one equivalent to rapid.
true_clock_file_sort = IGS

// As small as possible within the range.
true_clock_first = igs21610.clk_30s
true_clock_last = igs21613.clk_30s
// The method is fixed with Lagrange interpolation, 3 (quadratic) recommended
true_clock_interpolation_number = 3

//
// Estimated value
//
// choose from IGS, IGR, IGU,
// CODE_Final, CODE_Rapid
// JAXA_Final, JAXA_Rapid, JAXA_Ultra_rapid, madocaRT,
// QZSS_Final, QZSS_Rapid, QZSS_Ultra_rapid
estimate_position_file_sort = madocaRT

// As small as possible within the range.
estimate_position_first = madoca21610.sp3
estimate_position_last = madoca21613.sp3

// choose from 0: Lagrange, 1: Trigonometric : temporarily, only Trigonometric is valid, Lagrange is not yet implemented.
estimate_position_interpolation_method = 1

// if you chose Trigonometric as interpolation method, you must choose odds number here.
estimate_position_interpolation_number = 9

// choose from IGS, IGR, IGU,
// CODE_Final, CODE_Rapid
// JAXA_Final, JAXA_Rapid, JAXA_Ultra_rapid, madocaRT,
// QZSS_Final, QZSS_Rapid, QZSS_Ultra_rapid
estimate_clock_file_sort = madocaRT

// choose frome .sp3, .clk_30s or .clk
estimate_clock_file_extension = .sp3

// As small as possible within the range.
estimate_clock_first = madoca21610.sp3
estimate_clock_last = madoca21613.sp3

// The method is fixed with Lagrange interpolation, 3 (quadratic) recommended
estimate_clock_interpolation_number = 3

// when you use Ultra Rapid Product, you can choose "observe" or "predict"
estimate_ur_observe_or_predict = observe
logging = DISABLE

// Supporting the following products
// - IGS precise orbits and clocks final products for GPS and GLONASS
// - https://igs.org/products/#orbits_clocks
// - MGEX precise orbits and clocks final products for all navigation satellite systems
// - https://igs.org/mgex/data-products/#orbit_clock
// We use new long file name.
// - Orbit file: [file_name_header]_YYYYDDD0000_01D_[orbit_data_period]_ORB.SP3
// - Clock file: [file_name_header]_YYYYDDD0000_01D_[clock_file_name_hooter]
// - Users can also use clock information in the orbit SP3 file

// Header information of the reference files
// Choose from ***0OPSFIN or ***0MGXFIN
// ***: ID of the analysis center or IGS
file_name_header = IGS0OPSFIN

// Data period in the orbit reference files
// - bbb: Period of the data in the file (ex. 15M = 15 mins.)
orbit_data_period = 15M

// Footer information of the clock reference files
// bbb_ccc.ddd
// - bbb: Period of the data in the file (ex. 15M = 15 mins.)
// - ccc.ddd: ORB.SP3 or CLK.CLK
clock_file_name_footer = 15M_ORB.SP3 // or 30S_CLK.CLK or 05M_CLK.CLK

// Duration of the input product files
// YYYYDDD
// - YYYY: Year
// - DDD: Day of year
start_date = 2023126
end_date = 2023129
20 changes: 10 additions & 10 deletions scripts/Plot/plot_gnss_receiver.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,14 @@
# Read S2E CSV
time = read_scalar_from_csv(read_file_name, 'elapsed_time[s]')

measured_position_eci_m = read_3d_vector_from_csv(read_file_name, 'gnss_receiver1_measured_position_eci', 'm')
true_position_eci_m = read_3d_vector_from_csv(read_file_name, 'spacecraft_position_i', 'm')
measured_position_ecef_m = read_3d_vector_from_csv(read_file_name, 'gnss_receiver1_measured_position_ecef', 'm')
true_position_ecef_m = read_3d_vector_from_csv(read_file_name, 'spacecraft_position_ecef', 'm')

number_of_visible_satellites = read_scalar_from_csv(read_file_name, 'gnss_receiver1_number_of_visible_satellites')
satellite_visible_flag = read_scalar_from_csv(read_file_name, 'gnss_receiver1_satellite_visible_flag')

# Statistics
error_m = measured_position_eci_m[:, 1:] - true_position_eci_m[:, 1:]
error_m = measured_position_ecef_m[:, 1:] - true_position_ecef_m[:, 1:]
average = [0.0, 0.0, 0.0]
standard_deviation = [0.0, 0.0, 0.0]
for i in range(3):
Expand All @@ -68,20 +68,20 @@
#
unit = ' m'
fig, axis = plt.subplots(5, 1, squeeze = False, tight_layout = True, sharex = True)
axis[0, 0].plot(time[0], measured_position_eci_m[0], marker=".", c="red", label="MEASURED-X")
axis[0, 0].plot(time[0], true_position_eci_m[0], marker=".", c="orange", label="TRUE-X")
axis[0, 0].plot(time[0], measured_position_ecef_m[0], marker=".", c="red", label="MEASURED-X")
axis[0, 0].plot(time[0], true_position_ecef_m[0], marker=".", c="orange", label="TRUE-X")
axis[0, 0].text(0.01, 0.99, "Error average:" + format(average[0], '+.2e') + unit, verticalalignment = 'top', transform = axis[0, 0].transAxes)
axis[0, 0].text(0.01, 0.79, "Standard deviation:" + format(standard_deviation[0], '+.2e') + unit, verticalalignment = 'top', transform = axis[0, 0].transAxes)
axis[0, 0].legend(loc = 'upper right')

axis[1, 0].plot(time[0], measured_position_eci_m[1], marker=".", c="green", label="MEASURED-Y")
axis[1, 0].plot(time[0], true_position_eci_m[1], marker=".", c="yellow", label="TRUE-Y")
axis[1, 0].plot(time[0], measured_position_ecef_m[1], marker=".", c="green", label="MEASURED-Y")
axis[1, 0].plot(time[0], true_position_ecef_m[1], marker=".", c="yellow", label="TRUE-Y")
axis[1, 0].text(0.01, 0.99, "Error average:" + format(average[1], '+.2e') + unit, verticalalignment = 'top', transform = axis[1, 0].transAxes)
axis[1, 0].text(0.01, 0.79, "Standard deviation:" + format(standard_deviation[1], '+.2e') + unit, verticalalignment = 'top', transform = axis[1, 0].transAxes)
axis[1, 0].legend(loc = 'upper right')

axis[2, 0].plot(time[0], measured_position_eci_m[2], marker=".", c="blue", label="MEASURED-Z")
axis[2, 0].plot(time[0], true_position_eci_m[2], marker=".", c="purple", label="TRUE-Z")
axis[2, 0].plot(time[0], measured_position_ecef_m[2], marker=".", c="blue", label="MEASURED-Z")
axis[2, 0].plot(time[0], true_position_ecef_m[2], marker=".", c="purple", label="TRUE-Z")
axis[2, 0].text(0.01, 0.99, "Error average:" + format(average[2], '+.2e') + unit, verticalalignment = 'top', transform = axis[2, 0].transAxes)
axis[2, 0].text(0.01, 0.79, "Standard deviation:" + format(standard_deviation[2], '+.2e') + unit, verticalalignment = 'top', transform = axis[2, 0].transAxes)
axis[2, 0].legend(loc = 'upper right')
Expand All @@ -94,7 +94,7 @@
axis[4, 0].legend(loc = 'upper right')
axis[4, 0].set_ylim(0, max(number_of_visible_satellites[0]) + 2)

fig.suptitle("GNSS Receiver Spacecraft position @ ECI")
fig.suptitle("GNSS Receiver Spacecraft position @ ECEF")
fig.supylabel("Position [m]")
fig.supxlabel("Time [s]")

Expand Down
4 changes: 2 additions & 2 deletions scripts/Plot/plot_gnss_satellites.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,12 @@
plt.figure(1)
for gps_idx in range(32):
gps_str = 'GPS' + str(gps_idx)
clock = read_scalar_from_csv(read_file_name, gps_str + '_clock_offset[m]')
clock = read_scalar_from_csv(read_file_name, gps_str + '_clock_offset[s]')
plt.plot(time[0], clock[0], marker=".", label=gps_str)

plt.title("GPS Clock Offset")
plt.xlabel("Time [s]")
plt.ylabel("Clock Offset [m]")
plt.ylabel("Clock Offset [s]")
plt.legend(fontsize=7, loc="upper right")

# Data save
Expand Down
Loading
Loading