Skip to content
Snippets Groups Projects
Commit 23c66367 authored by Pep Martí Saumell's avatar Pep Martí Saumell
Browse files

Merge branch 'revert-e964b446' into 'master'

Revert "Merge branch '2-enable-standard-point-positioning-spp-computation' into 'master'"

See merge request mobile_robotics/gauss_project/gnss_utils!3
parents e964b446 fcff9242
No related branches found
No related tags found
2 merge requests!21merge back,!3Revert "Merge branch '2-enable-standard-point-positioning-spp-computation' into 'master'"
Showing
with 212 additions and 954 deletions
#Ignore build, bin and lib folders
bin/
build/
lib/
[submodule "deps/RTKLIB"]
path = deps/RTKLIB
url = https://github.com/tomojitakasu/RTKLIB.git
...@@ -28,17 +28,13 @@ CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X) ...@@ -28,17 +28,13 @@ CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
if(COMPILER_SUPPORTS_CXX11) if(COMPILER_SUPPORTS_CXX11)
message(STATUS "The compiler ${CMAKE_CXX_COMPILER} has C++11 support.") message(STATUS "The compiler ${CMAKE_CXX_COMPILER} has C++11 support.")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c99")
elseif(COMPILER_SUPPORTS_CXX0X) elseif(COMPILER_SUPPORTS_CXX0X)
message(STATUS "The compiler ${CMAKE_CXX_COMPILER} has C++0x support.") message(STATUS "The compiler ${CMAKE_CXX_COMPILER} has C++0x support.")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c99")
else() else()
message(STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.") message(STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.")
endif() endif()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fpermissive")
ADD_SUBDIRECTORY(src) ADD_SUBDIRECTORY(src)
FIND_PACKAGE(Doxygen) FIND_PACKAGE(Doxygen)
......
#edit the following line to add the librarie's header files #edit the following line to add the librarie's header files
FIND_PATH(gnss_utils_INCLUDE_DIR observations.h navigation.h /usr/include/iridrivers /usr/local/include) FIND_PATH(gnss_utils_INCLUDE_DIR gnss_utils.h obervation.h /usr/include/iridrivers /usr/local/lib)
FIND_LIBRARY(gnss_utils_LIBRARY FIND_LIBRARY(gnss_utils_LIBRARY
NAMES gnss_utils NAMES gnss_utils
PATHS /usr/lib /usr/local/lib) PATHS /usr/lib /usr/local/lib /usr/local/lib)
IF (gnss_utils_INCLUDE_DIR AND gnss_utils_LIBRARY) IF (gnss_utils_INCLUDE_DIR AND gnss_utils_LIBRARY)
SET(gnss_utils_FOUND TRUE) SET(gnss_utils_FOUND TRUE)
...@@ -18,3 +18,4 @@ ELSE (gnss_utils_FOUND) ...@@ -18,3 +18,4 @@ ELSE (gnss_utils_FOUND)
MESSAGE(FATAL_ERROR "Could not find gnss_utils") MESSAGE(FATAL_ERROR "Could not find gnss_utils")
ENDIF (gnss_utils_FIND_REQUIRED) ENDIF (gnss_utils_FIND_REQUIRED)
ENDIF (gnss_utils_FOUND) ENDIF (gnss_utils_FOUND)
#edit the following line to add the librarie's header files
FIND_PATH(RTKLIB_INCLUDE_DIR rtklib.h /usr/include /usr/local/include ~/RTKLIB/src)
GET_FILENAME_COMPONENT(RTK_LIB_PATH ${RTKLIB_INCLUDE_DIR} DIRECTORY)
IF (RTKLIB_INCLUDE_DIR)
SET(RTKLIB_FOUND TRUE)
ENDIF (RTKLIB_INCLUDE_DIR)
IF (RTKLIB_FOUND)
IF (NOT RTKLIB_FOUND_QUIETLY)
MESSAGE(STATUS "Found RTKLIB: ${RTKLIB_INCLUDE_DIR}")
ENDIF (NOT RTKLIB_FOUND_QUIETLY)
ELSE (RTKLIB_FOUND)
IF (RTKLIB_FIND_REQUIRED)
MESSAGE(FATAL_ERROR "Could not find RTKLIB")
ENDIF (RTKLIB_FIND_REQUIRED)
ENDIF (RTKLIB_FOUND)
Subproject commit 71db0ffa0d9735697c6adfd06fdf766d0e5ce807
#ifndef GNSS_UTILS_H
#define GNSS_UTILS_H
#include <vector>
#include <iostream>
#include <memory>
#include "observation.h"
extern "C"
{
#include "/home/jlaplaza/RTKLIB/src/rtklib.h"
}
namespace GNSSUtils
{
class Receiver
{
public:
// Constructor & Destructor
Receiver();
~Receiver();
// Public objects
// Public methods
/* - Observations - */
void clearObservations();
void pushObservation(obsd_t obs);
std::vector<obsd_t> getObservations();
/* - Navigation - */
void clearNavigation();
void pushNavigation(nav_t nav);
std::vector<nav_t> getNavigation();
/* - Processing Options - */
void clearOptions();
void pushOption(prcopt_t opt);
std::vector<prcopt_t> getOptions();
/* - Solution - */
/* - Satellite status - */
/* - Compute Fix - */
int computeSPP(double *azel, char *msg);
private:
// rtklib-like attribute to represent the different observation msgs for a given epoch
std::vector<obsd_t> _obsVector;
// rtklib-like attribute to represent the different navigation msgs for a given epoch
std::vector<nav_t> _navVector;
// rtklib-like attribute to represent the different options for a given epoch
std::vector<prcopt_t> _opt;
// rtklib-like attribute to represent the solution for a given epoch
std::Vector<sol_t> _sol;
// rtklib-like attribute to represent the satellite status for a given epoch
std::vector<ssat_t> _ssat;
};
}
#endif
#ifndef GNSS_UTILS_H
#define GNSS_UTILS_H
#include <vector>
#include <iostream>
#include <memory>
#include <eigen3/Eigen/Dense>
#include <eigen3/Eigen/Geometry>
#include <eigen3/Eigen/Sparse>
#include "observations.h"
#include "navigation.h"
extern "C"
{
#include "../deps/RTKLIB/src/rtklib.h"
}
namespace GNSSUtils
{
struct getPosOutput{
time_t time;
double sec;
Eigen::Vector3d pos; // position (m)
Eigen::Vector3d vel; // velocity (m/s)
Eigen::Matrix3d pos_covar; // position covariance (m^2)
// {c_xx,c_yy,c_zz,c_xy,c_yz,c_zx}
Eigen::VectorXd rcv_bias; // receiver clock bias to time systems (s)
int type; // type (0:xyz-ecef,1:enu-baseline)
int stat; // solution status (SOLQ_???)
int ns; // number of valid satellites
double age; // age of differential (s)
double ratio; // AR ratio factor for valiation
int pos_stat; // return from pntpos
Eigen::Vector3d lat_lon; // latitude_longitude_altitude
};
GNSSUtils::getPosOutput getPos(const std::shared_ptr<Observations> & _observations,
const std::shared_ptr<Navigation> & _navigation);
Eigen::Vector3d ecefToLatLon(const Eigen::Vector3d & _ecef);
}
#endif
#ifndef NAVIGATION_H
#define NAVIGATION_H
#include <vector>
#include <iostream>
#include <memory>
extern "C"
{
#include "../deps/RTKLIB/src/rtklib.h"
}
namespace GNSSUtils
{
class Navigation
{
public:
// Constructor & Destructor
Navigation();
~Navigation();
// Public objects
// Public methods
void clearNavigation();
void setNavigation(nav_t nav);
const nav_t & getNavigation() const;
nav_t & getNavigation();
/****************** Array memory management ******************/
// Ephemeris
void allocateEphemeris(int n_sat = MAXSAT);
void deleteEphemeris();
void allocateGLONASSEphemeris(int n_sat = NSATGLO);
void deleteGLONASSEphemeris();
void allocateSBASEphemeris(int n_sat = NSATSBS*2); //SBAS
void deleteSBASEphemeris();
void allocateAlmanac(int n_sat = MAXSAT);
void deleteAlmanac();
private:
// rtklib-like attribute to represent the different navigation msgs for a given epoch
nav_t nav_;
// Private methods
};
}
#endif
#ifndef OBSEVATIONS_H
#define OBSERVATIONS_H
#include <vector>
#include <iostream>
#include <memory>
extern "C"
{
#include "../deps/RTKLIB/src/rtklib.h"
}
namespace GNSSUtils
{
class Observations
{
public:
// Constructor & Destructor
Observations();
~Observations();
// Public objects
// Public methods
/* - Observations - */
void clearObservations();
void pushObservation(obsd_t obs);
std::vector<obsd_t> getObservations();
private:
// Private objects
// rtklib-like attribute to represent the different observation msgs for a given epoch
std::vector<obsd_t> obs_vector_;
// Private methods
};
}
#endif
# rtklib path
SET(RTKLIB_DIR ../deps/RTKLIB)
SET(RTKLIB_SRC_DIR ${RTKLIB_DIR}/src)
# driver source files # driver source files
SET(SOURCES SET(sources gnss_utils.cpp observation.cpp)
gnss_utils.cpp
observations.cpp
navigation.cpp)
SET(RTKLIB_SRC
${RTKLIB_SRC_DIR}/pntpos.c
${RTKLIB_SRC_DIR}/rtkcmn.c
${RTKLIB_SRC_DIR}/sbas.c
${RTKLIB_SRC_DIR}/ephemeris.c
${RTKLIB_SRC_DIR}/preceph.c
${RTKLIB_SRC_DIR}/qzslex.c
${RTKLIB_SRC_DIR}/rtcm.c
${RTKLIB_SRC_DIR}/rtcm2.c
${RTKLIB_SRC_DIR}/rtcm3.c
${RTKLIB_SRC_DIR}/rtcm3e.c
${RTKLIB_SRC_DIR}/ionex.c
${RTKLIB_SRC_DIR}/rinex.c)
# application header files # application header files
SET(HEADERS SET(headers ../include/gnss_utils.h ../include/observation.h)
../include/gnss_utils/gnss_utils.h
../include/gnss_utils/observations.h # RTKLIB
../include/gnss_utils/navigation.h) INCLUDE (${PROJECT_SOURCE_DIR}/cmake_modules/FindRTKLIB.cmake)
# Eigen ####### # Eigen #######
FIND_PACKAGE(Eigen3 REQUIRED) FIND_PACKAGE(Eigen3 REQUIRED)
...@@ -42,10 +20,10 @@ FIND_PACKAGE(Boost REQUIRED) ...@@ -42,10 +20,10 @@ FIND_PACKAGE(Boost REQUIRED)
link_directories(/usr/lib/x86_64-linux-gnu/) link_directories(/usr/lib/x86_64-linux-gnu/)
# Adding include directories # Adding include directories
INCLUDE_DIRECTORIES(../include/ ${EIGEN3_INCLUDE_DIR} ${Boost_INCLUDE_DIRS} ${RTK_LIB_PATH}) INCLUDE_DIRECTORIES(. ${EIGEN3_INCLUDE_DIR} ${Boost_INCLUDE_DIRS} ${RTK_LIB_PATH})
# create the shared library # create the shared library
ADD_LIBRARY(gnss_utils SHARED ${SOURCES} ${RTKLIB_SRC}) ADD_LIBRARY(gnss_utils SHARED ${sources})
TARGET_LINK_LIBRARIES(gnss_utils ${Boost_LIBRARIES}) TARGET_LINK_LIBRARIES(gnss_utils ${Boost_LIBRARIES})
# Installing # Installing
...@@ -53,7 +31,7 @@ INSTALL(TARGETS gnss_utils ...@@ -53,7 +31,7 @@ INSTALL(TARGETS gnss_utils
RUNTIME DESTINATION bin RUNTIME DESTINATION bin
LIBRARY DESTINATION /usr/local/lib LIBRARY DESTINATION /usr/local/lib
ARCHIVE DESTINATION lib) ARCHIVE DESTINATION lib)
INSTALL(FILES ${HEADERS} DESTINATION include/gnss_utils) INSTALL(FILES ${headers} DESTINATION include/gnss_utils)
# INSTALL(FILES ../gnss_utils.cmake DESTINATION ${CMAKE_ROOT}/Modules/) # INSTALL(FILES ../gnss_utils.cmake DESTINATION ${CMAKE_ROOT}/Modules/)
INSTALL(FILES ../Findgnss_utils.cmake DESTINATION ${CMAKE_ROOT}/Modules/) INSTALL(FILES ../Findgnss_utils.cmake DESTINATION ${CMAKE_ROOT}/Modules/)
ADD_SUBDIRECTORY(examples) ADD_SUBDIRECTORY(examples)
# include headers
INCLUDE_DIRECTORIES(../../include)
# create an example application # create an example application
ADD_EXECUTABLE(gnss_utils_test gnss_utils_test.cpp) ADD_EXECUTABLE(gnss_utils_test gnss_utils_test.cpp)
# link necessary libraries # link necessary libraries
TARGET_LINK_LIBRARIES(gnss_utils_test gnss_utils) TARGET_LINK_LIBRARIES(gnss_utils_test gnss_utils)
#include "gnss_utils/observations.h" #include "../../include/gnss_utils.h"
#include "gnss_utils/navigation.h" #include "../../include/observation.h"
#include <typeinfo>
#include <boost/typeof/typeof.hpp>
#include <iostream> #include <iostream>
extern "C"
{
#include "../deps/RTKLIB/src/rinex.c"
}
using namespace GNSSUtils; using namespace GNSSUtils;
int createObsAndNav(Observations* observations, char* obs_path, Navigation* navigation, char* nav_path)
{
// Time
double ts_d[] = {2018, 5, 17, 14, 1, 2};
gtime_t ts = epoch2time(ts_d);
double te_d[] = {2018, 5, 17, 14, 42, 8};
gtime_t te = epoch2time(te_d);
double tint = 0.1;
// Create options container
char* opt = "-SYS=G";
// Create receiver identifier
int rcv = 1;
// Create object types
rnxopt_t rnx_opt;
// Create obsd_t object to hold the observations
obs_t obs;
obs.data = (obsd_t *) malloc(sizeof(obsd_t)*MAXSAT);
/* header */
std::cout << "------------" << std::endl;
std::cout << "Observations" << std::endl;
std::cout << "------------" << std::endl;
if (readrnx(obs_path, rcv, opt, &obs, NULL, NULL))
{
sortobs(&obs);
obs.data[0].P[0] = 21597659.275;
obs.data[1].P[0] = 22348322.550;
obs.data[2].P[0] = 20873167.574;
obs.data[3].P[0] = 20920707.830;
std::cout << "Obs number: " << obs.n << std::endl;
}
else
{
std::cout << "Couldn't load provided observation file" << std::endl;
return 0;
}
for (int i=0; i < obs.n; i++)
{
std::cout << "time: " << time_str(obs.data[i].time, 3) << " | sat: " << int(obs.data[i].sat) << " | rcv: " << obs.data[i].rcv <<
" | SNR: " << obs.data[i].SNR[0] << " | LLI: " << obs.data[i].LLI[0] << " | code: " << obs.data[i].code[0] <<
" | L: " << obs.data[i].L[0] << " | P: " << obs.data[i].P[0] << " | D: " << obs.data[i].D[0] << std::endl;
observations->pushObservation(obs.data[i]);
}
free(obs.data);
/* header */
std::cout << "----------" << std::endl;
std::cout << "Navigation" << std::endl;
std::cout << "----------" << std::endl;
/* Load _nav attribute into nav variable */
nav_t nav = navigation->getNavigation();
if (readrnx(nav_path, rcv, opt, NULL, &nav, NULL))
{
std::cout << "Navigation file loaded." << std::endl;
std::cout << "GPS satellites in navigation file: " << nav.n << std::endl;
std::cout << "GLONASS satellites in navigation file: " << nav.ng << std::endl;
std::cout << "SBAS satellites in navigation file: " << nav.ns << std::endl;
std::cout << "Almanac satellites in navigation file: " << nav.na << std::endl;
uniqnav(&nav);
}
else
{
std::cout << "Couldn't load provided navigation file" << std::endl;
return 0;
}
/* Print Constellation Satellites ids */
for (int i=0;i<nav.n;i++)
{
std::cout << i << " GPS Sat Id: " << nav.eph[i].sat << std::endl;
}
for (int i=0;i<nav.ng;i++)
{
std::cout << i << " GLONASS Sat Id: " << nav.geph[i].sat << std::endl;
}
for (int i=0;i<nav.ns;i++)
{
std::cout << i << " SBAS Sat Id: " << nav.seph[i].sat << std::endl;
}
/* Load nav into Navigation object*/
navigation->setNavigation(nav);
std::cout << "Navigation message loaded to Navigation class." << std::endl;
return 1;
}
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
/* header */ // header
std::cout << "--------------------------" << std::endl; std::cout << "--------------------------" << std::endl;
std::cout << "GNSS Utils Library Example" << std::endl; std::cout << "GNSS Utils Library Example" << std::endl;
std::cout << "--------------------------" << std::endl; std::cout << "--------------------------" << std::endl;
// create a Receiver object
GNSSUtils::Receiver test_rcv;
// create Observations object
Observations observations; // create a Observation object
gtime_t ts={0};
// create Navigation object unsigned char q=1, w=2, e=3;
Navigation navigation; std::vector<unsigned char> vu({q, w, e});
std::vector<double> vd({1., 2., 3.});
createObsAndNav(&observations, "../src/examples/raw_201805171357.obs", &navigation, "../src/examples/raw_201805171357.nav"); std::vector<float> vf({1., 2., 3.});
Observation test_obs(ts, 1, 1, vu, vu, vu, vd, vd, vf);
nav_t nav = navigation.getNavigation();
// Display current Observation
std::cout << "Navigation eph number " << nav.n << std::endl; std::cout << "Current observation (sat): " << "(" << test_obs.getSat() << ")" << std::endl;
std::cout << "Current observation (SNR): " << "(" ;
/* Set processing options */
/* header */
std::cout << "------------------" << std::endl; for (unsigned char i=0; i < 3; ++i)
std::cout << "Processing options" << std::endl; std::cout << test_obs.getSNR()[i] << ", ";
std::cout << "------------------" << std::endl; std::cout << ")" << std::endl;
prcopt_t prcopt = prcopt_default;
prcopt.mode = PMODE_SINGLE; obsd_t obs = test_obs.convert2rtk();
prcopt.soltype = 0; std::cout << "Observation SNR in RTKLIB format: " << "(";
prcopt.nf = 1; for (unsigned char i=0; i < 3; ++i)
prcopt.navsys = SYS_GPS; std::cout << obs.SNR[i] << ", ";
//prcopt.elmin = 1.05; // 60 degrees = 1.05 rad std::cout << ")" << std::endl;
prcopt.sateph = EPHOPT_BRDC;
prcopt.ionoopt = IONOOPT_OFF;
prcopt.tropopt = TROPOPT_OFF;
prcopt.dynamics = 0;
prcopt.tidecorr = 0;
prcopt.sbascorr = SBSOPT_FCORR;
prcopt.ru[0] = 4789374.0336;
prcopt.ru[1] = 177048.3292;
prcopt.ru[2] = 4194542.6444;
std::cout << "Processing options defined" << std::endl;
//Compute spp
/* header */
std::cout << "-----------" << std::endl;
std::cout << "pntpos call" << std::endl;
std::cout << "-----------" << std::endl;
int stat;
sol_t solb={{0}};
char msg[128]="";
std::vector<obsd_t> obs = observations.getObservations();
for (int i=0; i < obs.size(); i++)
{
std::cout << "time: " << time_str(obs[i].time, 3) << " | sat: " << int(obs[i].sat) << " | rcv: " << obs[i].rcv <<
" | SNR: " << obs[i].SNR[0] << " | LLI: " << obs[i].LLI[0] << " | code: " << obs[i].code[0] <<
" | L: " << obs[i].L[0] << " | P: " << obs[i].P[0] << " | D: " << obs[i].D[0] << std::endl;
}
std::cout << "obs.size(): " << obs.size() << std::endl;
stat = pntpos(&obs[0], obs.size(), &nav, &prcopt, &solb, NULL, NULL, msg);
std::cout << "msg: " << msg << std::endl;
std::cout << "sol.stat: " << solb.stat << std::endl;
std::cout << "Position: " << solb.rr[0] << ", " << solb.rr[1] << ", " << solb.rr[2] << std::endl;
} }
3.03 N: GNSS NAV DATA M: Mixed RINEX VERSION / TYPE
RTKCONV-QT 2.4.3 Eml 20180518 083005 UTC PGM / RUN BY / DATE
log: /home/fherrero/Desktop/rtk_data/may17_street/rover/ra COMMENT
format: u-blox COMMENT
END OF HEADER
G21 2018 5 17 16 0 0 -.393872614950E-03 .488853402203E-11 .000000000000E+00
.180000000000E+02 -.716562500000E+02 .427089218552E-08 .277512804670E+01
-.366568565369E-05 .243949498981E-01 .127293169498E-04 .515371633720E+04
.403200000000E+06 .251457095146E-06 -.255327447920E+01 -.633299350739E-07
.943966348285E+00 .117093750000E+03 -.155820813323E+01 -.742388066300E-08
.232509684962E-09 .100000000000E+01 .200100000000E+04 .000000000000E+00
.200000000000E+01 .000000000000E+00 -.102445483208E-07 .180000000000E+02
.396066000000E+06 .400000000000E+01
S23 2018 5 17 14 0 0 .000000000000E+00 .000000000000E+00 .396084000000E+06
.359446000000E+05 .000000000000E+00 .000000000000E+00 .100000000000E+01
.220441400000E+05 .000000000000E+00 .000000000000E+00 .819200000000E+04
.000000000000E+00 .000000000000E+00 .000000000000E+00 .000000000000E+00
R11 2018 5 17 14 15 0 -.290172174573E-04 -.909494701773E-12 .396060000000E+06
.236135693359E+05 .480520248413E+00 .465661287308E-08 .000000000000E+00
.897833935547E+04 .531091690063E-01 -.279396772385E-08 .000000000000E+00
.336017822266E+04 -.353190040588E+01 .279396772385E-08 .000000000000E+00
G 4 2018 5 17 16 0 0 .617303885520E-04 .318323145621E-11 .000000000000E+00
.490000000000E+02 .813125000000E+02 .586095841816E-08 .168147704406E+01
.409968197346E-05 .984852679539E-02 .142678618431E-05 .515369743729E+04
.403200000000E+06 -.257045030594E-06 .171283210665E+01 -.856816768646E-07
.978868924311E+00 .363875000000E+03 .925765003885E+00 -.844285167866E-08
.201794119821E-09 .100000000000E+01 .200100000000E+04 .000000000000E+00
.280000000000E+01 .630000000000E+02 -.195577740669E-07 .490000000000E+02
.396096000000E+06 .400000000000E+01
S36 2018 5 17 14 1 52 .000000000000E+00 .000000000000E+00 .396121000000E+06
.420036880000E+05 .000000000000E+00 .000000000000E+00 .100000000000E+01
.367484696000E+04 .000000000000E+00 .000000000000E+00 .819200000000E+04
.000000000000E+00 .000000000000E+00 .000000000000E+00 .000000000000E+00
G25 2018 5 17 16 0 0 -.586538109928E-03 -.591171556152E-11 .000000000000E+00
.960000000000E+02 .790625000000E+02 .450768776329E-08 .282650655180E+01
.393204391003E-05 .748547178227E-02 .985339283943E-06 .515364713287E+04
.403200000000E+06 .167638063431E-07 .168792924864E+01 -.130385160446E-06
.974054297066E+00 .366156250000E+03 .859234222371E+00 -.824998650220E-08
.172507185617E-09 .100000000000E+01 .200100000000E+04 .000000000000E+00
.200000000000E+01 .000000000000E+00 .605359673500E-08 .960000000000E+02
.396126000000E+06 .400000000000E+01
S23 2018 5 17 14 2 40 .000000000000E+00 .000000000000E+00 .396165000000E+06
.359446000000E+05 .000000000000E+00 .000000000000E+00 .100000000000E+01
.220441400000E+05 .000000000000E+00 .000000000000E+00 .819200000000E+04
.000000000000E+00 .000000000000E+00 .000000000000E+00 .000000000000E+00
G29 2018 5 17 16 0 0 .448422506452E-03 -.636646291241E-11 .000000000000E+00
.100000000000E+02 -.134218750000E+03 .398873757550E-08 .151837862906E+01
-.712089240551E-05 .758121139370E-03 .585615634918E-05 .515369779968E+04
.403200000000E+06 -.782310962677E-07 .279259841043E+01 .931322574615E-08
.984149274453E+00 .279031250000E+03 .109062292313E+01 -.796068873750E-08
-.435375277985E-09 .100000000000E+01 .200100000000E+04 .000000000000E+00
.200000000000E+01 .000000000000E+00 -.102445483208E-07 .100000000000E+02
.396156000000E+06 .400000000000E+01
G31 2018 5 17 16 0 0 .121017917991E-03 -.261479726760E-11 .000000000000E+00
.130000000000E+02 .135562500000E+03 .417624538595E-08 -.258010292801E+01
.694207847118E-05 .874089112040E-02 .114534050226E-04 .515367195892E+04
.403200000000E+06 -.199303030968E-06 .667414181645E+00 -.428408384323E-07
.963670683015E+00 .163718750000E+03 -.129508508058E+00 -.771246411223E-08
-.253581991279E-10 .100000000000E+01 .200100000000E+04 .000000000000E+00
.200000000000E+01 .000000000000E+00 -.135041773319E-07 .130000000000E+02
.396156000000E+06 .400000000000E+01
G26 2018 5 17 16 0 0 -.146218109876E-03 .127329258248E-10 .000000000000E+00
.190000000000E+02 .955937500000E+02 .508271171534E-08 .229150417812E+01
.499933958054E-05 .278105866164E-02 .127218663692E-05 .515365811539E+04
.403200000000E+06 -.745058059692E-07 .166613425329E+01 .353902578354E-07
.955604430680E+00 .354000000000E+03 .123824483227E+00 -.863714548606E-08
.240367155114E-09 .100000000000E+01 .200100000000E+04 .000000000000E+00
.200000000000E+01 .000000000000E+00 .745058059692E-08 .190000000000E+02
.396156000000E+06 .400000000000E+01
G20 2018 5 17 16 0 0 .508385710418E-03 .909494701773E-12 .000000000000E+00
.550000000000E+02 .305312500000E+02 .550415784170E-08 -.143910495771E+01
.176578760147E-05 .424874294549E-02 .653788447380E-05 .515483108330E+04
.403200000000E+06 -.428408384323E-07 -.156561886368E+01 .819563865662E-07
.927860664755E+00 .238250000000E+03 .194382841914E+01 -.851535469870E-08
.584667210879E-09 .100000000000E+01 .200100000000E+04 .000000000000E+00
.200000000000E+01 .000000000000E+00 -.838190317154E-08 .550000000000E+02
.396156000000E+06 .400000000000E+01
R22 2018 5 17 14 15 0 -.436417758465E-04 -.363797880709E-11 .396150000000E+06
.174836372070E+05 -.213147068024E+01 .558793544769E-08 .000000000000E+00
-.223983789062E+04 .135918807983E+01 -.931322574615E-09 -.300000000000E+01
.183794223633E+05 .220586490631E+01 .000000000000E+00 .000000000000E+00
R12 2018 5 17 14 15 0 -.314591452479E-04 .000000000000E+00 .396150000000E+06
.187842797852E+05 .221794128418E+01 .651925802231E-08 .000000000000E+00
-.611366699219E+03 .832158088684E+00 -.931322574615E-09 -.100000000000E+01
.172705292969E+05 -.237456703186E+01 .000000000000E+00 .000000000000E+00
R21 2018 5 17 14 15 0 .161034986377E-04 -.181898940355E-11 .396150000000E+06
.268202294922E+04 -.252502918243E+01 .186264514923E-08 .000000000000E+00
.109598642578E+05 .185894107819E+01 -.186264514923E-08 .400000000000E+01
.228750024414E+05 -.595973968506E+00 -.186264514923E-08 .000000000000E+00
R23 2018 5 17 14 15 0 .154180452228E-03 .181898940355E-11 .396150000000E+06
.210692055664E+05 -.285812377930E+00 .558793544769E-08 .000000000000E+00
-.143027485352E+05 -.724935531616E-01 .000000000000E+00 .300000000000E+01
.137911767578E+04 .359415912628E+01 .279396772385E-08 .000000000000E+00
E24 2018 5 17 13 50 0 .670211907709E-02 -.201794136956E-10 .000000000000E+00
.190000000000E+02 .242875000000E+03 .291512142651E-08 .109551416340E+01
.112410634756E-04 .485833035782E-03 .496208667755E-05 .544061313057E+04
.395400000000E+06 .372529029846E-08 .126283855082E+01 -.372529029846E-08
.990511584178E+00 .248343750000E+03 .110117432072E+01 -.567559355411E-08
.396445084958E-09 .100000000000E+01 .200100000000E+04 .000000000000E+00
.312000000000E+01 .000000000000E+00 .440049916506E-07 .493600964546E-07
.396169000000E+06 .000000000000E+00
G16 2018 5 17 16 0 0 .245096161962E-04 -.125055521494E-11 .000000000000E+00
.790000000000E+02 .737187500000E+02 .444411368660E-08 .140168875341E+01
.403448939323E-05 .100266055670E-01 .130012631416E-05 .515363121033E+04
.403200000000E+06 -.502914190292E-07 .176651804026E+01 .137835741043E-06
.986822970829E+00 .370343750000E+03 .514283072240E+00 -.844606609827E-08
.700029159024E-10 .100000000000E+01 .200100000000E+04 .000000000000E+00
.200000000000E+01 .000000000000E+00 -.107102096081E-07 .790000000000E+02
.396186000000E+06 .400000000000E+01
G 5 2018 5 17 15 59 44 -.777514651418E-05 .682121026330E-12 .000000000000E+00
.170000000000E+02 .269375000000E+02 .513057085173E-08 .129549284559E+01
.147894024849E-05 .535089964978E-02 .625289976597E-05 .515369559669E+04
.403184000000E+06 -.745058059692E-07 -.147810732801E+01 .372529029846E-07
.947400843985E+00 .253656250000E+03 .608252324768E+00 -.836320550394E-08
.368229623956E-09 .100000000000E+01 .200100000000E+04 .000000000000E+00
.200000000000E+01 .000000000000E+00 -.111758708954E-07 .170000000000E+02
.396186000000E+06 .400000000000E+01
G14 2018 5 17 16 0 0 -.969334505498E-04 -.227373675443E-12 .000000000000E+00
.510000000000E+02 -.840625000000E+01 .468733810359E-08 .989432442176E-01
-.545755028725E-06 .978497182950E-02 .894069671631E-05 .515375780869E+04
.403200000000E+06 -.108033418655E-06 -.332595167021E+00 .987201929092E-07
.961268653452E+00 .210375000000E+03 -.195648402689E+01 -.810640909305E-08
-.559309011751E-09 .100000000000E+01 .200100000000E+04 .000000000000E+00
.200000000000E+01 .000000000000E+00 -.977888703346E-08 .510000000000E+02
.396186000000E+06 .400000000000E+01
E14 2018 5 17 12 40 0 .658168265363E-02 -.619593265583E-11 .000000000000E+00
.120000000000E+02 -.468750000000E+02 .613489840029E-08 -.827456973327E+00
-.192783772945E-05 .165251873434E+00 .759772956371E-05 .528934380722E+04
.391200000000E+06 -.192970037460E-05 .279632045438E+01 .322423875332E-05
.881842556282E+00 .208812500000E+03 .131753832323E+01 -.104768649749E-07
-.677171064036E-09 .100000000000E+01 .200100000000E+04 .000000000000E+00
.312000000000E+01 .455000000000E+03 .346917659044E-07 .386498868465E-07
.396199000000E+06 .000000000000E+00
S20 2018 5 17 14 2 40 .000000000000E+00 .000000000000E+00 .396242000000E+06
.406367200000E+05 .000000000000E+00 .000000000000E+00 .100000000000E+01
-.112459160000E+05 .000000000000E+00 .000000000000E+00 .819200000000E+04
.000000000000E+00 .000000000000E+00 .000000000000E+00 .000000000000E+00
S36 2018 5 17 14 4 32 .000000000000E+00 .000000000000E+00 .396282000000E+06
.420036880000E+05 .000000000000E+00 .000000000000E+00 .100000000000E+01
.367484696000E+04 .000000000000E+00 .000000000000E+00 .819200000000E+04
.000000000000E+00 .000000000000E+00 .000000000000E+00 .000000000000E+00
S20 2018 5 17 14 5 20 .000000000000E+00 .000000000000E+00 .396322000000E+06
.406367200000E+05 .000000000000E+00 .000000000000E+00 .100000000000E+01
-.112459160000E+05 .000000000000E+00 .000000000000E+00 .819200000000E+04
.000000000000E+00 .000000000000E+00 .000000000000E+00 .000000000000E+00
S23 2018 5 17 14 5 20 .000000000000E+00 .000000000000E+00 .396324000000E+06
.359446000000E+05 .000000000000E+00 .000000000000E+00 .100000000000E+01
.220441400000E+05 .000000000000E+00 .000000000000E+00 .819200000000E+04
.000000000000E+00 .000000000000E+00 .000000000000E+00 .000000000000E+00
E14 2018 5 17 13 50 0 .658165744971E-02 -.616751094640E-11 .000000000000E+00
.190000000000E+02 -.665625000000E+02 .678813989613E-08 -.260792610990E+00
-.358372926712E-05 .165245657437E+00 .691227614880E-05 .528932658958E+04
.395400000000E+06 -.215321779251E-05 .279627172604E+01 .100582838058E-05
.881839133054E+00 .222968750000E+03 .131754849636E+01 -.116819151701E-07
-.657884546389E-09 .100000000000E+01 .200100000000E+04 .000000000000E+00
.312000000000E+01 .455000000000E+03 .346917659044E-07 .386498868465E-07
.396409000000E+06 .000000000000E+00
S36 2018 5 17 14 7 12 .000000000000E+00 .000000000000E+00 .396442000000E+06
.420036880000E+05 .000000000000E+00 .000000000000E+00 .100000000000E+01
.367484696000E+04 .000000000000E+00 .000000000000E+00 .819200000000E+04
.000000000000E+00 .000000000000E+00 .000000000000E+00 .000000000000E+00
S20 2018 5 17 14 8 0 .000000000000E+00 .000000000000E+00 .396482000000E+06
.406367200000E+05 .000000000000E+00 .000000000000E+00 .100000000000E+01
-.112459160000E+05 .000000000000E+00 .000000000000E+00 .819200000000E+04
.000000000000E+00 .000000000000E+00 .000000000000E+00 .000000000000E+00
S23 2018 5 17 14 8 0 .000000000000E+00 .000000000000E+00 .396484000000E+06
.359446000000E+05 .000000000000E+00 .000000000000E+00 .100000000000E+01
.220441400000E+05 .000000000000E+00 .000000000000E+00 .819200000000E+04
.000000000000E+00 .000000000000E+00 .000000000000E+00 .000000000000E+00
E12 2018 5 17 13 50 0 .417666573776E-02 .843130010253E-10 .000000000000E+00
.190000000000E+02 -.192437500000E+03 .233795452805E-08 .115788182092E+01
-.890344381332E-05 .501386122778E-03 .132191926241E-04 .544061606026E+04
.395400000000E+06 -.353902578354E-07 -.293672768750E+01 .763684511185E-07
.979283181750E+00 .628437500000E+02 -.264081628266E+00 -.521593155020E-08
-.657170230921E-10 .100000000000E+01 .200100000000E+04 .000000000000E+00
.312000000000E+01 .000000000000E+00 -.144354999065E-07 -.146683305502E-07
.396499000000E+06 .000000000000E+00
S36 2018 5 17 14 9 52 .000000000000E+00 .000000000000E+00 .396603000000E+06
.420036880000E+05 .000000000000E+00 .000000000000E+00 .100000000000E+01
.367484696000E+04 .000000000000E+00 .000000000000E+00 .819200000000E+04
.000000000000E+00 .000000000000E+00 .000000000000E+00 .000000000000E+00
S20 2018 5 17 14 10 40 .000000000000E+00 .000000000000E+00 .396642000000E+06
.406367200000E+05 .000000000000E+00 .000000000000E+00 .100000000000E+01
-.112459160000E+05 .000000000000E+00 .000000000000E+00 .819200000000E+04
.000000000000E+00 .000000000000E+00 .000000000000E+00 .000000000000E+00
S23 2018 5 17 14 10 40 .000000000000E+00 .000000000000E+00 .396645000000E+06
.359446000000E+05 .000000000000E+00 .000000000000E+00 .100000000000E+01
.220441400000E+05 .000000000000E+00 .000000000000E+00 .819200000000E+04
.000000000000E+00 .000000000000E+00 .000000000000E+00 .000000000000E+00
E12 2018 5 17 14 0 0 .417671643663E-02 .843272118800E-10 .000000000000E+00
.200000000000E+02 -.191718750000E+03 .233259716203E-08 .123187689323E+01
-.886805355549E-05 .501382863149E-03 .132862478495E-04 .544061645317E+04
.396000000000E+06 -.447034835815E-07 -.293673076987E+01 .670552253723E-07
.979283174435E+00 .615000000000E+02 -.263691855687E+00 -.521307428833E-08
-.742888087128E-10 .100000000000E+01 .200100000000E+04 .000000000000E+00
.312000000000E+01 .000000000000E+00 -.144354999065E-07 -.146683305502E-07
.396679000000E+06 .000000000000E+00
E14 2018 5 17 14 0 0 .658165384084E-02 -.616751094640E-11 .000000000000E+00
.200000000000E+02 -.666250000000E+02 .681171230659E-08 -.179837825870E+00
-.358745455742E-05 .165245189099E+00 .697560608387E-05 .528932536125E+04
.396000000000E+06 -.233761966228E-05 .279626537259E+01 .836327672005E-06
.881839071611E+00 .225500000000E+03 .131754730408E+01 -.115954829984E-07
-.851821196058E-09 .100000000000E+01 .200100000000E+04 .000000000000E+00
.312000000000E+01 .455000000000E+03 .346917659044E-07 .386498868465E-07
.396679000000E+06 .000000000000E+00
S36 2018 5 17 14 12 32 .000000000000E+00 .000000000000E+00 .396764000000E+06
.420036880000E+05 .000000000000E+00 .000000000000E+00 .100000000000E+01
.367484696000E+04 .000000000000E+00 .000000000000E+00 .819200000000E+04
.000000000000E+00 .000000000000E+00 .000000000000E+00 .000000000000E+00
S20 2018 5 17 14 13 20 .000000000000E+00 .000000000000E+00 .396802000000E+06
.406367200000E+05 .000000000000E+00 .000000000000E+00 .100000000000E+01
-.112459160000E+05 .000000000000E+00 .000000000000E+00 .819200000000E+04
.000000000000E+00 .000000000000E+00 .000000000000E+00 .000000000000E+00
S23 2018 5 17 14 13 20 .000000000000E+00 .000000000000E+00 .396804000000E+06
.359446000000E+05 .000000000000E+00 .000000000000E+00 .100000000000E+01
.220441400000E+05 .000000000000E+00 .000000000000E+00 .819200000000E+04
.000000000000E+00 .000000000000E+00 .000000000000E+00 .000000000000E+00
S36 2018 5 17 14 15 12 .000000000000E+00 .000000000000E+00 .396924000000E+06
.420036880000E+05 .000000000000E+00 .000000000000E+00 .100000000000E+01
.367484696000E+04 .000000000000E+00 .000000000000E+00 .819200000000E+04
.000000000000E+00 .000000000000E+00 .000000000000E+00 .000000000000E+00
S20 2018 5 17 14 16 0 .000000000000E+00 .000000000000E+00 .396962000000E+06
.406367200000E+05 .000000000000E+00 .000000000000E+00 .100000000000E+01
-.112459160000E+05 .000000000000E+00 .000000000000E+00 .819200000000E+04
.000000000000E+00 .000000000000E+00 .000000000000E+00 .000000000000E+00
S23 2018 5 17 14 16 0 .000000000000E+00 .000000000000E+00 .396964000000E+06
.359446000000E+05 .000000000000E+00 .000000000000E+00 .100000000000E+01
.220441400000E+05 .000000000000E+00 .000000000000E+00 .819200000000E+04
.000000000000E+00 .000000000000E+00 .000000000000E+00 .000000000000E+00
S36 2018 5 17 14 17 52 .000000000000E+00 .000000000000E+00 .397085000000E+06
.420036880000E+05 .000000000000E+00 .000000000000E+00 .100000000000E+01
.367484696000E+04 .000000000000E+00 .000000000000E+00 .819200000000E+04
.000000000000E+00 .000000000000E+00 .000000000000E+00 .000000000000E+00
S20 2018 5 17 14 18 40 .000000000000E+00 .000000000000E+00 .397122000000E+06
.406367200000E+05 .000000000000E+00 .000000000000E+00 .100000000000E+01
-.112459160000E+05 .000000000000E+00 .000000000000E+00 .819200000000E+04
.000000000000E+00 .000000000000E+00 .000000000000E+00 .000000000000E+00
R13 2018 5 17 14 15 0 -.105034559965E-04 .000000000000E+00 .397290000000E+06
.663370605469E+03 .285760593414E+01 .372529029846E-08 .000000000000E+00
-.113617504883E+05 .127725887299E+01 .000000000000E+00 -.200000000000E+01
.228060634766E+05 .551796913147E+00 -.186264514923E-08 .000000000000E+00
3.03 OBSERVATION DATA M: Mixed RINEX VERSION / TYPE
RTKCONV-QT 2.4.3 Eml 20180518 083005 UTC PGM / RUN BY / DATE
log: /home/fherrero/Desktop/rtk_data/may17_street/rover/ra COMMENT
format: u-blox COMMENT
MARKER NAME
MARKER NUMBER
MARKER TYPE
OBSERVER / AGENCY
REC # / TYPE / VERS
ANT # / TYPE
4789374.0336 177048.3292 4194542.6444 APPROX POSITION XYZ
0.0000 0.0000 0.0000 ANTENNA: DELTA H/E/N
G 4 C1C L1C D1C S1C SYS / # / OBS TYPES
R 4 C1C L1C D1C S1C SYS / # / OBS TYPES
E 4 C1C L1C D1C S1C SYS / # / OBS TYPES
J 4 C1C L1C D1C S1C SYS / # / OBS TYPES
S 4 C1C L1C D1C S1C SYS / # / OBS TYPES
C 4 C1I L1I D1I S1I SYS / # / OBS TYPES
2018 5 17 14 1 2.0020000 GPS TIME OF FIRST OBS
2018 5 17 14 42 8.6010000 GPS TIME OF LAST OBS
G SYS / PHASE SHIFT
R SYS / PHASE SHIFT
E SYS / PHASE SHIFT
J SYS / PHASE SHIFT
S SYS / PHASE SHIFT
C SYS / PHASE SHIFT
0 GLONASS SLOT / FRQ #
C1C 0.000 C1P 0.000 C2C 0.000 C2P 0.000 GLONASS COD/PHS/BIS
END OF HEADER
> 2018 5 17 14 1 2.0020000 0 5
G25 22348322.550 2 117441226.71621 -3039.055 45.000
G29 20873167.574 9 -2449.652 23.000
R11 20330782.856 9 108641485.22725 -3329.648 32.000
G31 20920707.830 8 109939061.00922 -1587.315 39.000
G21 21597659.275 8 113496465.14223 1343.465 37.000
% program : RTKPOST-QT ver.2.4.3 Emlid b28
% inp file : /home/fherrero/Desktop/rtk_data/may17_street/rover/raw_201805171357.obs
% inp file : /home/fherrero/Desktop/rtk_data/may17_street/base/raw_201805171405.obs
% inp file : /home/fherrero/Desktop/rtk_data/may17_street/rover/raw_201805171357.nav
% obs start : 2018/05/17 14:01:02.0 GPST (week2001 396062.0s)
% obs end : 2018/05/17 14:42:08.6 GPST (week2001 398528.6s)
% ref pos : 41.383326247 2.117100983 105.6453
%
% (lat/lon/height=WGS84/ellipsoidal,Q=1:fix,2:float,3:sbas,4:dgps,5:single,6:ppp,ns=# of satellites)
% GPST latitude(deg) longitude(deg) height(m) Q ns sdn(m) sde(m) sdu(m) sdne(m) sdeu(m) sdun(m) age(s) ratio
2018/05/17 14:01:02.002 41.383293114 2.116101115 -91.6641 5 5 11.9771 18.8489 79.2352 -14.4364 38.1163 -29.5030 -330.00 0.0
#include "gnss_utils/gnss_utils.h" #include "../include/gnss_utils.h"
namespace GNSSUtils using namespace GNSSUtils;
/******************************* RECEIVER CLASS *******************************************/
Receiver::Receiver()
{
}
Receiver::~Receiver()
{
}
/* - Observation - */
void Receiver::clearObservations()
{
_obsVector.clear();
}
void Receiver::pushObservation(obsd_t obs)
{
_obsVector.push_back(obs);
}
std::vector<obsd_t> Receiver::getObservations()
{
return this->_obsVector;
}
/* - Navigation - */
void Receiver::clearNavigation()
{ {
GNSSUtils::getPosOutput getPos(const std::shared_ptr<GNSSUtils::Observations> & _observations, _navVector.clear();
const std::shared_ptr<GNSSUtils::Navigation> & _navigation) }
{
// Remove duplicated satellites
uniqnav(&(_navigation->getNavigation()));
// Define processing options
prcopt_t prcopt = prcopt_default;
prcopt.mode = PMODE_SINGLE;
prcopt.soltype = 0;
prcopt.nf = 1;
prcopt.navsys = SYS_GPS;
//prcopt.elmin = 1.05; // 60 degrees = 1.05 rad
prcopt.sateph = EPHOPT_BRDC;
prcopt.ionoopt = IONOOPT_OFF;
prcopt.tropopt = TROPOPT_OFF;
prcopt.dynamics = 0;
prcopt.tidecorr = 0;
prcopt.sbascorr = SBSOPT_FCORR;
// Define error msg
char msg[128] = "";
GNSSUtils::getPosOutput output;
sol_t sol;
sol = {{0}};
output.pos_stat = pntpos(&(_observations->getObservations()[0]), _observations->getObservations().size(),
&(_navigation->getNavigation()),
&prcopt, &sol, NULL, NULL, msg);
output.time = sol.time.time;
output.time = sol.time.sec;
output.pos = Eigen::Map<Eigen::Vector3d>(sol.rr);
output.vel = Eigen::Map<Eigen::Vector3d>(&sol.rr[3]);
output.pos_covar << sol.qr[0], sol.qr[3], sol.qr[5],
sol.qr[3], sol.qr[1], sol.qr[4],
sol.qr[5], sol.qr[3], sol.qr[2];
// XXX: segmentation fault here.
// if (sol.dtr != NULL)
// {
// output.rcv_bias << sol.dtr[0], sol.dtr[1], sol.dtr[2], sol.dtr[3], sol.dtr[4], sol.dtr[5];
// }
output.type = sol.type;
output.stat = sol.stat;
output.ns = sol.ns;
output.age = sol.age;
output.ratio = sol.ratio;
output.lat_lon = ecefToLatLon(output.pos);
return output;
}
Eigen::Vector3d ecefToLatLon(const Eigen::Vector3d & _ecef)
{
double pos[3];
ecef2pos(&_ecef(0), pos);
return Eigen::Map<Eigen::Vector3d>(pos);
}
void Receiver::pushNavigation(nav_t nav)
{
_navVector.push_back(nav);
}
std::vector<nav_t> Receiver::getNavigation()
{
return this->_navVector;
} }
int Receiver::getSPP(double *azel, char *msg)
{
obsd_t *obs = &this->_obsVector[0];
int n = this->_obsVector.size();
return int pntpos(*obs, n, nav_t *nav, *opt, *sol, *azel, *ssat, *msg)
}
#include "gnss_utils/navigation.h"
using namespace GNSSUtils;
Navigation::Navigation()
{}
Navigation::~Navigation()
{
clearNavigation();
//free(_nav);
}
void Navigation::clearNavigation()
{
deleteEphemeris();
deleteGLONASSEphemeris();
deleteSBASEphemeris();
deleteAlmanac();
}
void Navigation::setNavigation(nav_t _nav)
{
nav_ = _nav;
}
const nav_t & Navigation::getNavigation() const
{
return nav_;
}
nav_t & Navigation::getNavigation()
{
return nav_;
}
/****************** Array memory management ******************/
void Navigation::allocateEphemeris(int n_sat)
{
eph_t eph0 ={0,-1,-1};
int i;
nav_.eph = (eph_t *) malloc(sizeof(eph_t)*n_sat);
for (i=0;i<n_sat;i++) nav_.eph[i] = eph0;
/*
if (this->_nav->eph)
{
//_nav->eph = (eph_t *)realloc(_nav->eph, 2 * MAXSAT * sizeof(eph_t));
}
else
{
this->_nav->eph = (eph_t *) malloc(2 * MAXSAT * sizeof(eph_t));
}
*/
}
void Navigation::deleteEphemeris()
{
free(nav_.eph);
}
void Navigation::allocateGLONASSEphemeris(int n_sat)
{
geph_t geph0={0,-1};
int i;
nav_.geph = (geph_t *)malloc(sizeof(geph_t)*n_sat);
/*
for (i=0;i<NSATGLO ;i++) _nav.geph[i] = geph0;
if (this->_nav->geph)
{
//_nav->geph = (geph_t *)realloc(_nav->geph, NSATGLO * sizeof(geph_t));
}
else
{
this->_nav->geph = (geph_t *) malloc(2 * NSATGLO * sizeof(geph_t));
}
*/
}
void Navigation::deleteGLONASSEphemeris()
{
free(nav_.geph);
// if (_nav->geph)
// {
// free(_nav->geph);
// }
//
// else
// {
// // Do nothing
// }
//
}
void Navigation::allocateSBASEphemeris(int n_sat)
{
seph_t seph0={0};
int i;
nav_.seph = (seph_t *)malloc(sizeof(seph_t)*n_sat);
for (i=0; i<n_sat; i++) nav_.seph[i] = seph0;
/*
if (this->_nav->seph)
{
//_nav->seph = (seph_t *)realloc(_nav->seph, NSATSBS * sizeof(seph_t));
}
else
{
this->_nav->seph = (seph_t *) malloc(2 * NSATSBS * sizeof(seph_t));
}
*/
}
void Navigation::deleteSBASEphemeris()
{
free(nav_.seph);
// if (_nav->seph)
// {
// free(_nav->seph);
// }
//
// else
// {
// // Do nothing
// }
}
void Navigation::allocateAlmanac(int n_sat)
{
alm_t alm0 ={0,-1};
int i;
nav_.alm = (alm_t *)malloc(sizeof(alm_t)*n_sat);
for (i=0; i<n_sat; i++) nav_.alm[i] = alm0;
/*
if (this->_nav->alm)
{
//_nav->alm = (alm_t *)realloc(_nav->alm, MAXSAT * sizeof(alm_t));
}
else
{
this->_nav->alm = (alm_t *) malloc(2 * MAXSAT * sizeof(alm_t));
}
*/
}
void Navigation::deleteAlmanac()
{
free(nav_.alm);
// if (_nav->alm)
// {
// free(_nav->alm);
// }
//
// else
// {
// // Do nothing
// }
}
#include "gnss_utils/observations.h"
using namespace GNSSUtils;
Observations::Observations()
{
}
Observations::~Observations()
{
this->obs_vector_.erase(obs_vector_.begin(), obs_vector_.end());
}
void Observations::clearObservations()
{
this->obs_vector_.clear();
}
void Observations::pushObservation(obsd_t obs)
{
this->obs_vector_.push_back(obs);
}
std::vector<obsd_t> Observations::getObservations()
{
return this->obs_vector_;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment