From 155f4c6e7257069c987b0077cb4ec9222a6c62d9 Mon Sep 17 00:00:00 2001 From: bert hubert Date: Tue, 21 Sep 2021 17:26:32 +0200 Subject: [PATCH 1/4] fix galileo/gps time offset calculations for week number rollovers --- galileo.hh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/galileo.hh b/galileo.hh index 6d6ad65..32326d8 100644 --- a/galileo.hh +++ b/galileo.hh @@ -226,7 +226,7 @@ struct GalileoMessage : GPSLikeEphemeris { int dw = (int)(wn%64) - (int)(wn0g%64); if(dw > 31) - dw = 31- dw; + dw = dw - 64; int delta = dw*7*86400 + tow - getT0g(); // NOT ephemeris age tricks // 2^-35 2^-51 3600 From 95a41e9612304e0e0ed95a6a8719a891afb80123 Mon Sep 17 00:00:00 2001 From: bert hubert Date: Tue, 21 Sep 2021 17:30:57 +0200 Subject: [PATCH 2/4] ok --- galmonmon.cc | 33 +++++++++++++++++---------------- navparse.cc | 8 ++++---- septool.cc | 6 +++++- zstdwrap.cc | 7 +++++-- 4 files changed, 31 insertions(+), 23 deletions(-) diff --git a/galmonmon.cc b/galmonmon.cc index 51cb0d9..9b56300 100644 --- a/galmonmon.cc +++ b/galmonmon.cc @@ -257,7 +257,8 @@ int main(int argc, char **argv) res = mc.getURL(url+"svs.json"); j = nlohmann::json::parse(res); - bool first=true; + bool first=true; + bool globalOsnma=false; for(const auto& sv : j) { if(!sv.count("gnssid") || !sv.count("fullName") || !sv.count("sigid")) { cout<<"Skipping "<< sv.count("gnssid") <<", "<< sv.count("fullName") <<", " < tooOldChange; @@ -343,8 +335,6 @@ int main(int argc, char **argv) */ ostringstream out; - if(osnmachange) - out<<"OSNMA state change: "<< (*osnmachange) <<" "; if(healthchange) out<< *healthchange<<" "; @@ -408,6 +398,17 @@ int main(int argc, char **argv) cout<second.completeIOD() && iter->second.liveIOD().getIOD() == ed.iod && nmm.sourceid()==300) + if(iter != g_svstats.end() && iter->second.completeIOD() && iter->second.liveIOD().getIOD() == ed.iod && nmm.sourceid()==302) iter->second.rtcmEphDelta = ed; idb.addValue(ed.id, "rtcm-eph-correction", { @@ -2658,7 +2658,7 @@ try for(const auto& cd : rm.d_clocks) { auto iter = g_svstats.find(cd.id); - if(iter != g_svstats.end() && nmm.sourceid()==300) /// XXX wrong + if(iter != g_svstats.end() && nmm.sourceid()==302) /// XXX wrong iter->second.rtcmClockDelta = cd; idb.addValue(cd.id, "rtcm-clock-correction", { @@ -2686,7 +2686,7 @@ try else if(rm.type == 1060 || rm.type == 1243) { for(const auto& ed : rm.d_ephs) { auto iter = g_svstats.find(ed.id); - if(iter != g_svstats.end() && iter->second.completeIOD() && iter->second.liveIOD().getIOD() == ed.iod && nmm.sourceid()==300) + if(iter != g_svstats.end() && iter->second.completeIOD() && iter->second.liveIOD().getIOD() == ed.iod && nmm.sourceid()==302) iter->second.rtcmEphDelta = ed; idb.addValue(ed.id, "rtcm-eph-correction", { @@ -2754,7 +2754,7 @@ try for(const auto& cd : rm.d_clocks) { auto iter = g_svstats.find(cd.id); - if(iter != g_svstats.end() && nmm.sourceid()==300) + if(iter != g_svstats.end() && nmm.sourceid()==302) iter->second.rtcmClockDelta = cd; idb.addValue(cd.id, "rtcm-clock-correction", { diff --git a/septool.cc b/septool.cc index 3a7be20..46f73f5 100644 --- a/septool.cc +++ b/septool.cc @@ -133,9 +133,11 @@ try bool doVERSION{false}, doSTDOUT{false}; CLI::App app(program); string sourceaddr; + bool quiet{false}; app.add_option("--source", sourceaddr, "Connect to this IP address:port to source SBF (otherwise stdin)"); app.add_option("--destination,-d", destinations, "Send output to this IPv4/v6 address"); app.add_option("--station", g_srcid, "Station id")->required(); + app.add_option("--quiet", quiet, "Don't emit noise"); app.add_flag("--version", doVERSION, "show program version and copyright"); app.add_flag("--stdout", doSTDOUT, "Emit output to stdout"); try { @@ -181,7 +183,8 @@ try for(;;) { double to=1000; auto res = getSEPMessage(srcfd, &to); - cerr< Date: Tue, 21 Sep 2021 17:31:40 +0200 Subject: [PATCH 3/4] enhance GGTO logging somewhat --- navdump.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/navdump.cc b/navdump.cc index c3ed38a..ba210d4 100644 --- a/navdump.cc +++ b/navdump.cc @@ -421,6 +421,8 @@ try if(wtype == 4) { // 2^-34 2^-46 cout <<" iodnav "< Date: Wed, 22 Sep 2021 20:09:07 +0200 Subject: [PATCH 4/4] -pthread should unfuck the testsuite --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 3949ec2..d277d79 100644 --- a/Makefile +++ b/Makefile @@ -137,7 +137,7 @@ septool: navmon.pb.o septool.o bits.o ext/fmt-6.1.2/src/format.o galileo.o gps. testrunner: navmon.pb.o testrunner.o ubx.o bits.o ext/fmt-6.1.2/src/format.o galileo.o gps.o beidou.o ephemeris.o sp3.o osen.o navmon.o rinex.o githash.o - $(CXX) -std=gnu++17 $^ -o $@ -L/usr/local/lib -lprotobuf -lz + $(CXX) -std=gnu++17 $^ -o $@ -L/usr/local/lib -lprotobuf -lz -pthread gndate: gndate.o githash.o ext/fmt-6.1.2/src/format.o navmon.o $(CXX) -std=gnu++17 $^ -o $@ -L/usr/local/lib