Skip to content

Commit

Permalink
Add patch in case GLONASS N_T is not available in RTCM3 stream
Browse files Browse the repository at this point in the history
  • Loading branch information
fenrir-naru committed Mar 27, 2024
1 parent 537ab89 commit 9035b8f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/gps_pvt/receiver/extension.rb
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,10 @@ def F_T_index
f_t = send(:F_T)
(f_t < 0) ? -1 : F_T_TABLE.find_index{|v| f_t <= v}
end
def NA
# based on TimeProperties::date2raw
self.day_of_year + [1, 367, 732, 1097][(self.year - 1996) % 4]
end
end

[
Expand Down
1 change: 1 addition & 0 deletions lib/gps_pvt/receiver/rtcm3.rb
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ def parse_rtcm3(src, opt = {}, &b)
? date_src \
: [(ref_time + 3 * 60 * 60).c_tm(leap_sec)])) # UTC -> Moscow time
}.call([:N_4, :NA].collect{|k| params[k]})
eph.N_T = params[:NA] || eph.NA unless params[:N_T] # N_T is available only for GLONASS-M
eph.rehash(leap_sec)
critical{
@solver.glonass_space_node.register_ephemeris(eph.svid, eph)
Expand Down

0 comments on commit 9035b8f

Please sign in to comment.