add lat/lon/h output to NAV-SVIN

pull/86/head
bert hubert 2020-01-18 12:48:06 +00:00
parent 1401eb0257
commit 00924f697f
4 changed files with 20 additions and 3 deletions

View File

@ -1,6 +1,6 @@
CFLAGS = -O3 -Wall -ggdb
CXXFLAGS:= -std=gnu++17 -Wall -O3 -MMD -MP -ggdb -fno-omit-frame-pointer -Iext/CLI11 \
CXXFLAGS:= -std=gnu++17 -Wall -O0 -MMD -MP -fno-omit-frame-pointer -Iext/CLI11 \
-Iext/fmt-5.2.1/include/ -Iext/powerblog/ext/simplesocket -Iext/powerblog/ext/ \
-I/usr/local/opt/openssl/include/ \
-Iext/sgp4/libsgp4/ \

View File

@ -1,9 +1,21 @@
#pragma once
#include "minivec.hh"
#include <iostream>
#include <tuple>
// lat, lon, height (rad, rad, meters)
std::tuple<double, double, double> ecefToWGS84(double x, double y, double z);
// lat, lon, height (deg, deg, meters)
inline std::tuple<double, double, double> ecefToWGS84Deg(double x, double y, double z)
{
auto ret = ecefToWGS84(x, y, z);
std::get<0>(ret) /= (M_PI / 180);
std::get<1>(ret) /= (M_PI / 180);
return ret;
}
double ephAge(double tow, int t0e);
template<typename T>

@ -1 +1 @@
Subproject commit bb78d2f67c5db647f32e1c958ac55a914386cad8
Subproject commit 9f53fbba7d910ca06f73149d5ec375f73a85e5ac

View File

@ -1632,7 +1632,12 @@ int main(int argc, char** argv)
NS.iTow = 0;
if(memcmp(&NS, &lastNS, sizeof(NS))) {
cerr<<humanTimeNow()<<" NAV-SVIN ver "<<(int)NS.ver<< " valid "<< (int)NS.valid<<" active " << (int)NS.active<<" duration "<<NS.dur<<"s meanAcc " <<NS.meanAcc /100<< "cm obs "<<NS.obs<<" ";
cerr<<std::fixed<<" ( "<<NS.meanXCM + 0.01*NS.meanXHP<<", "<<NS.meanYCM + 0.01*NS.meanYHP<<", "<<NS.meanZCM + 0.01*NS.meanZHP<<")"<<endl;
cerr<<std::fixed<<" ("<<NS.meanXCM + 0.01*NS.meanXHP<<", "<<NS.meanYCM + 0.01*NS.meanYHP<<", "<<NS.meanZCM + 0.01*NS.meanZHP<<")";
auto latlonh = ecefToWGS84Deg((NS.meanXCM +0.01*NS.meanXHP)/100.0,
(NS.meanYCM +0.01*NS.meanYHP)/100.0,
(NS.meanZCM +0.01*NS.meanZHP)/100.0);
cerr<<" lat "<< get<0>(latlonh)<<" lon "<< get<1>(latlonh) << " h " << get<2>(latlonh) << endl;
}
lastNS = NS;
}