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

CMake and include paths

parent d643029f
No related branches found
No related tags found
1 merge request!2Resolve "Enable Standard Point Positioning (SPP) computation"
This commit is part of merge request !2. Comments created here will be created in the context of that merge request.
#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/lib) FIND_PATH(gnss_utils_INCLUDE_DIR observations.h navigation.h /usr/include/iridrivers /usr/local/include)
FIND_LIBRARY(gnss_utils_LIBRARY FIND_LIBRARY(gnss_utils_LIBRARY
NAMES gnss_utils NAMES gnss_utils
PATHS /usr/lib /usr/local/lib /usr/local/lib) PATHS /usr/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,4 +18,3 @@ ELSE (gnss_utils_FOUND) ...@@ -18,4 +18,3 @@ 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)
File moved
File moved
File moved
...@@ -4,7 +4,7 @@ set(rtklib_src_dir ${rtklib_dir}/src) ...@@ -4,7 +4,7 @@ set(rtklib_src_dir ${rtklib_dir}/src)
# driver source files # driver source files
SET(sources SET(sources
getPos.cpp gnss_utils.cpp
observations.cpp observations.cpp
navigation.cpp) navigation.cpp)
...@@ -16,7 +16,7 @@ SET(rtklib_src ...@@ -16,7 +16,7 @@ SET(rtklib_src
${rtklib_src_dir}/preceph.c ${rtklib_src_dir}/preceph.c
${rtklib_src_dir}/qzslex.c ${rtklib_src_dir}/qzslex.c
${rtklib_src_dir}/rtcm.c ${rtklib_src_dir}/rtcm.c
${rtklib_src_dir}/rtcm2.c ${rtklib_src_dir}/rtcm2.c
${rtklib_src_dir}/rtcm3.c ${rtklib_src_dir}/rtcm3.c
${rtklib_src_dir}/rtcm3e.c ${rtklib_src_dir}/rtcm3e.c
${rtklib_src_dir}/ionex.c ${rtklib_src_dir}/ionex.c
...@@ -42,7 +42,7 @@ FIND_PACKAGE(Boost REQUIRED) ...@@ -42,7 +42,7 @@ 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(. ${EIGEN3_INCLUDE_DIR} ${Boost_INCLUDE_DIRS} ${RTK_LIB_PATH}) INCLUDE_DIRECTORIES(../include/ ${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} ${rtklib_src})
......
#include "../../include/observations.h" #include "gnss_utils/observations.h"
#include "../../include/navigation.h" #include "gnss_utils/navigation.h"
#include <typeinfo> #include <typeinfo>
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
extern "C" extern "C"
{ {
#include "/home/jlaplaza/RTKLIB/src/rinex.c" #include "../deps/RTKLIB/src/rinex.c"
} }
using namespace GNSSUtils; using namespace GNSSUtils;
...@@ -24,7 +24,7 @@ int createObsAndNav(Observations* observations, char* obs_path, Navigation* nav ...@@ -24,7 +24,7 @@ int createObsAndNav(Observations* observations, char* obs_path, Navigation* nav
double te_d[] = {2018, 5, 17, 14, 42, 8}; double te_d[] = {2018, 5, 17, 14, 42, 8};
gtime_t te = epoch2time(te_d); gtime_t te = epoch2time(te_d);
double tint = 0.1; double tint = 0.1;
// Create options container // Create options container
char* opt = "-SYS=G"; char* opt = "-SYS=G";
...@@ -51,25 +51,25 @@ int createObsAndNav(Observations* observations, char* obs_path, Navigation* nav ...@@ -51,25 +51,25 @@ int createObsAndNav(Observations* observations, char* obs_path, Navigation* nav
obs.data[1].P[0] = 22348322.550; obs.data[1].P[0] = 22348322.550;
obs.data[2].P[0] = 20873167.574; obs.data[2].P[0] = 20873167.574;
obs.data[3].P[0] = 20920707.830; obs.data[3].P[0] = 20920707.830;
std::cout << "Obs number: " << obs.n << std::endl; std::cout << "Obs number: " << obs.n << std::endl;
} }
else
else
{ {
std::cout << "Couldn't load provided observation file" << std::endl; std::cout << "Couldn't load provided observation file" << std::endl;
return 0; return 0;
} }
for (int i=0; i < obs.n; i++) 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 << 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] << " | 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; " | 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]); observations->pushObservation(obs.data[i]);
} }
...@@ -92,17 +92,17 @@ int createObsAndNav(Observations* observations, char* obs_path, Navigation* nav ...@@ -92,17 +92,17 @@ int createObsAndNav(Observations* observations, char* obs_path, Navigation* nav
std::cout << "GLONASS satellites in navigation file: " << nav.ng << 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 << "SBAS satellites in navigation file: " << nav.ns << std::endl;
std::cout << "Almanac satellites in navigation file: " << nav.na << std::endl; std::cout << "Almanac satellites in navigation file: " << nav.na << std::endl;
uniqnav(&nav); uniqnav(&nav);
} }
else
else
{ {
std::cout << "Couldn't load provided navigation file" << std::endl; std::cout << "Couldn't load provided navigation file" << std::endl;
return 0; return 0;
} }
/* Print Constellation Satellites ids */ /* Print Constellation Satellites ids */
for (int i=0;i<nav.n;i++) for (int i=0;i<nav.n;i++)
{ {
...@@ -118,7 +118,7 @@ int createObsAndNav(Observations* observations, char* obs_path, Navigation* nav ...@@ -118,7 +118,7 @@ int createObsAndNav(Observations* observations, char* obs_path, Navigation* nav
{ {
std::cout << i << " SBAS Sat Id: " << nav.seph[i].sat << std::endl; std::cout << i << " SBAS Sat Id: " << nav.seph[i].sat << std::endl;
} }
/* Load nav into Navigation object*/ /* Load nav into Navigation object*/
navigation->setNavigation(nav); navigation->setNavigation(nav);
...@@ -141,12 +141,12 @@ int main(int argc, char *argv[]) ...@@ -141,12 +141,12 @@ int main(int argc, char *argv[])
// create Observations object // create Observations object
Observations observations; Observations observations;
// create Navigation object // create Navigation object
Navigation navigation; Navigation navigation;
createObsAndNav(&observations, "/home/jlaplaza/gitlab/gnss_utils/src/examples/raw_201805171357.obs", &navigation, "/home/jlaplaza/gitlab/gnss_utils/src/examples/raw_201805171357.nav"); createObsAndNav(&observations, "../examples/raw_201805171357.obs", &navigation, "../examples/raw_201805171357.nav");
nav_t nav = navigation.getNavigation(); nav_t nav = navigation.getNavigation();
...@@ -158,8 +158,8 @@ int main(int argc, char *argv[]) ...@@ -158,8 +158,8 @@ int main(int argc, char *argv[])
std::cout << "------------------" << std::endl; std::cout << "------------------" << std::endl;
std::cout << "Processing options" << std::endl; std::cout << "Processing options" << std::endl;
std::cout << "------------------" << std::endl; std::cout << "------------------" << std::endl;
prcopt_t prcopt = prcopt_default; prcopt_t prcopt = prcopt_default;
prcopt.mode = PMODE_SINGLE; prcopt.mode = PMODE_SINGLE;
prcopt.soltype = 0; prcopt.soltype = 0;
prcopt.nf = 1; prcopt.nf = 1;
...@@ -176,8 +176,8 @@ int main(int argc, char *argv[]) ...@@ -176,8 +176,8 @@ int main(int argc, char *argv[])
prcopt.ru[2] = 4194542.6444; prcopt.ru[2] = 4194542.6444;
std::cout << "Processing options defined" << std::endl; std::cout << "Processing options defined" << std::endl;
//Compute spp //Compute spp
/* header */ /* header */
...@@ -195,13 +195,13 @@ int main(int argc, char *argv[]) ...@@ -195,13 +195,13 @@ int main(int argc, char *argv[])
for (int i=0; i < obs.size(); i++) 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 << 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] << " | 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; " | 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; std::cout << "obs.size(): " << obs.size() << std::endl;
stat = pntpos(&obs[0], obs.size(), &nav, &prcopt, &solb, NULL, NULL, msg); stat = pntpos(&obs[0], obs.size(), &nav, &prcopt, &solb, NULL, NULL, msg);
std::cout << "msg: " << msg << std::endl; std::cout << "msg: " << msg << std::endl;
......
#include "../include/getPos.h" #include "gnss_utils/gnss_utils.h"
using namespace GNSSUtils; using namespace GNSSUtils;
...@@ -11,7 +11,7 @@ static int getPos(Observations observations, Navigation navigation, sol_t sol) ...@@ -11,7 +11,7 @@ static int getPos(Observations observations, Navigation navigation, sol_t sol)
nav_t nav = navigation.getNavigation(); nav_t nav = navigation.getNavigation();
// Define processing options // Define processing options
prcopt_t prcopt = prcopt_default; prcopt_t prcopt = prcopt_default;
prcopt.mode = PMODE_SINGLE; prcopt.mode = PMODE_SINGLE;
prcopt.soltype = 0; prcopt.soltype = 0;
prcopt.nf = 1; prcopt.nf = 1;
...@@ -29,9 +29,8 @@ static int getPos(Observations observations, Navigation navigation, sol_t sol) ...@@ -29,9 +29,8 @@ static int getPos(Observations observations, Navigation navigation, sol_t sol)
// Define error msg // Define error msg
char msg[128]=""; char msg[128]="";
int stat = pntpos(&(obs[0]), obs.size(), &nav, &prcopt, &solb, NULL, NULL, msg); int stat = pntpos(&(obs[0]), obs.size(), &nav, &prcopt, &solb, NULL, NULL, msg);
return stat; return stat;
} }
#include "../include/navigation.h" #include "gnss_utils/navigation.h"
using namespace GNSSUtils; using namespace GNSSUtils;
......
#include "../include/observations.h" #include "gnss_utils/observations.h"
using namespace GNSSUtils; using namespace GNSSUtils;
...@@ -27,9 +27,3 @@ std::vector<obsd_t> Observations::getObservations() ...@@ -27,9 +27,3 @@ std::vector<obsd_t> Observations::getObservations()
{ {
return this->_obsVector; return this->_obsVector;
} }
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