Skip to content
Snippets Groups Projects
Commit 395e44bd authored by Javier Laplaza Galindo's avatar Javier Laplaza Galindo
Browse files

Receiver class definition without the example

parent 3f1bc2c7
No related branches found
No related tags found
1 merge request!2Resolve "Enable Standard Point Positioning (SPP) computation"
...@@ -5,8 +5,6 @@ ...@@ -5,8 +5,6 @@
#include <iostream> #include <iostream>
#include <memory> #include <memory>
#include "observation.h"
extern "C" extern "C"
{ {
#include "/home/jlaplaza/RTKLIB/src/rtklib.h" #include "/home/jlaplaza/RTKLIB/src/rtklib.h"
...@@ -39,25 +37,38 @@ namespace GNSSUtils ...@@ -39,25 +37,38 @@ namespace GNSSUtils
void clearNavigation(); void clearNavigation();
void pushNavigation(nav_t nav); void setNavigation(nav_t nav);
std::vector<nav_t> getNavigation(); nav_t getNavigation();
/* - Processing Options - */ /* - Processing Options - */
void clearOptions(); void clearOptions();
void pushOption(prcopt_t opt); void setOptions(prcopt_t opt);
std::vector<prcopt_t> getOptions(); prcopt_t getOptions();
/* - Solution - */ /* - Solution - */
void clearSolution();
void setSolution(sol_t sol);
sol_t getSolution();
/* - Satellite status - */ /* - Satellite status - */
void clearSatStatus();
void setSatStatus(ssat_t ssat);
ssat_t getSatStatus();
/* - Compute Fix - */ /* - Compute Fix - */
int computeSPP(double *azel, char *msg); int computeSPP(double *azel, char *msg);
...@@ -67,21 +78,18 @@ namespace GNSSUtils ...@@ -67,21 +78,18 @@ namespace GNSSUtils
std::vector<obsd_t> _obsVector; std::vector<obsd_t> _obsVector;
// rtklib-like attribute to represent the different navigation msgs for a given epoch // rtklib-like attribute to represent the different navigation msgs for a given epoch
std::vector<nav_t> _navVector; nav_t _nav;
// rtklib-like attribute to represent the different options for a given epoch // rtklib-like attribute to represent the different options for a given epoch
std::vector<prcopt_t> _opt; prcopt_t _opt;
// rtklib-like attribute to represent the solution for a given epoch // rtklib-like attribute to represent the solution for a given epoch
std::Vector<sol_t> _sol; sol_t _sol;
// rtklib-like attribute to represent the satellite status for a given epoch // rtklib-like attribute to represent the satellite status for a given epoch
std::vector<ssat_t> _ssat; ssat_t _ssat;
}; };
} }
#endif #endif
# driver source files # driver source files
SET(sources gnss_utils.cpp observation.cpp) SET(sources gnss_utils.cpp)
# application header files # application header files
SET(headers ../include/gnss_utils.h ../include/observation.h) SET(headers ../include/gnss_utils.h)
# RTKLIB # RTKLIB
INCLUDE (${PROJECT_SOURCE_DIR}/cmake_modules/FindRTKLIB.cmake) INCLUDE (${PROJECT_SOURCE_DIR}/cmake_modules/FindRTKLIB.cmake)
......
#include "../../include/gnss_utils.h" #include "../../include/gnss_utils.h"
#include "../../include/observation.h"
#include <iostream> #include <iostream>
using namespace GNSSUtils; using namespace GNSSUtils;
...@@ -11,7 +10,7 @@ int main(int argc, char *argv[]) ...@@ -11,7 +10,7 @@ int main(int argc, char *argv[])
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 // create a Receiver object
GNSSUtils::Receiver test_rcv; //GNSSUtils::Receiver test_rcv;
// create a Observation object // create a Observation object
gtime_t ts={0}; gtime_t ts={0};
...@@ -19,22 +18,22 @@ int main(int argc, char *argv[]) ...@@ -19,22 +18,22 @@ int main(int argc, char *argv[])
std::vector<unsigned char> vu({q, w, e}); std::vector<unsigned char> vu({q, w, e});
std::vector<double> vd({1., 2., 3.}); std::vector<double> vd({1., 2., 3.});
std::vector<float> vf({1., 2., 3.}); std::vector<float> vf({1., 2., 3.});
Observation test_obs(ts, 1, 1, vu, vu, vu, vd, vd, vf); //Observation test_obs(ts, 1, 1, vu, vu, vu, vd, vd, vf);
// Display current Observation // Display current Observation
std::cout << "Current observation (sat): " << "(" << test_obs.getSat() << ")" << std::endl; //std::cout << "Current observation (sat): " << "(" << test_obs.getSat() << ")" << std::endl;
std::cout << "Current observation (SNR): " << "(" ; //std::cout << "Current observation (SNR): " << "(" ;
for (unsigned char i=0; i < 3; ++i) //for (unsigned char i=0; i < 3; ++i)
std::cout << test_obs.getSNR()[i] << ", "; //std::cout << test_obs.getSNR()[i] << ", ";
std::cout << ")" << std::endl; //std::cout << ")" << std::endl;
obsd_t obs = test_obs.convert2rtk(); //obsd_t obs = test_obs.convert2rtk();
std::cout << "Observation SNR in RTKLIB format: " << "("; //std::cout << "Observation SNR in RTKLIB format: " << "(";
for (unsigned char i=0; i < 3; ++i) //for (unsigned char i=0; i < 3; ++i)
std::cout << obs.SNR[i] << ", "; //std::cout << obs.SNR[i] << ", ";
std::cout << ")" << std::endl; //std::cout << ")" << std::endl;
} }
...@@ -37,31 +37,88 @@ std::vector<obsd_t> Receiver::getObservations() ...@@ -37,31 +37,88 @@ std::vector<obsd_t> Receiver::getObservations()
void Receiver::clearNavigation() void Receiver::clearNavigation()
{ {
_navVector.clear(); //_nav = NULL;
} }
void Receiver::pushNavigation(nav_t nav) void Receiver::setNavigation(nav_t nav)
{ {
_navVector.push_back(nav); _nav = nav;
} }
std::vector<nav_t> Receiver::getNavigation() nav_t Receiver::getNavigation()
{ {
return this->_navVector; return this->_nav;
} }
/* - Processing options - */
void Receiver::clearOptions()
{
//_opt = NULL;
}
void Receiver::setOptions(prcopt_t opt)
{
_opt = opt;
}
prcopt_t Receiver::getOptions()
{
return this->_opt;
}
/* - Solution - */
void Receiver::clearSolution()
{
//_sol = NULL;
}
void Receiver::setSolution(sol_t sol)
{
_sol = sol;
}
sol_t Receiver::getSolution()
{
return this->_sol;
}
/* - Satellite Status - */
void Receiver::clearSatStatus()
{
//_ssat = NULL;
}
void Receiver::setSatStatus(ssat_t ssat)
{
_ssat = ssat;
}
ssat_t Receiver::getSatStatus()
{
return this->_ssat;
}
/* - Compute Fix - */
int Receiver::getSPP(double *azel, char *msg) int Receiver::computeSPP(double *azel, char *msg)
{ {
obsd_t *obs = &this->_obsVector[0]; const obsd_t *obs = &this->_obsVector[0];
int n = this->_obsVector.size(); int n = this->_obsVector.size();
/*
const nav_t *nav = this->_nav;
const prcopt_t *opt = this->_opt;
sol_t *sol = this->_sol;
ssat_t *ssat = this->_ssat;
*/
return int pntpos(*obs, n, nav_t *nav, *opt, *sol, *azel, *ssat, *msg) return pntpos(obs, n, &_nav, &_opt, &_sol, azel, &_ssat, msg);
} }
......
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