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

Receiver: Navigation and Observation attributes

parent 1faefa4d
No related branches found
No related tags found
1 merge request!2Resolve "Enable Standard Point Positioning (SPP) computation"
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
#include <vector> #include <vector>
#include <iostream> #include <iostream>
#include <memory> #include <memory>
#include "observations.h"
#include "navigation.h"
extern "C" extern "C"
{ {
...@@ -15,32 +17,16 @@ namespace GNSSUtils ...@@ -15,32 +17,16 @@ namespace GNSSUtils
class Receiver class Receiver
{ {
public: public:
// Public objects
// Constructor & Destructor // Constructor & Destructor
Receiver(); Receiver();
~Receiver(); ~Receiver();
// Public objects
// Public methods // Public methods
const std::shared_ptr<GNSSUtils::Observations> getObs();
const std::shared_ptr<GNSSUtils::Navigation> getNav();
/* - Observations - */
void clearObservations();
void pushObservation(obsd_t obs);
std::vector<obsd_t> getObservations();
/* - Navigation - */
void clearNavigation();
void setNavigation(nav_t nav);
nav_t getNavigation();
/* - Processing Options - */ /* - Processing Options - */
...@@ -73,13 +59,13 @@ namespace GNSSUtils ...@@ -73,13 +59,13 @@ namespace GNSSUtils
int computeSPP(double *azel, char *msg); int computeSPP(double *azel, char *msg);
private: protected:
// Private objects // Private objects
// rtklib-like attribute to represent the different observation msgs for a given epoch // GNSSUtils::Observation attribute to represent the different observation msgs for a given epoch
std::vector<obsd_t> _obsVector; std::shared_ptr<GNSSUtils::Observations> obs_ptr_;
// rtklib-like attribute to represent the different navigation msgs for a given epoch // GNSSUtils::Navigation attribute to represent the different navigation msgs for a given epoch
nav_t _nav; std::shared_ptr<GNSSUtils::Navigation> nav_ptr_;
// rtklib-like attribute to represent the different options for a given epoch // rtklib-like attribute to represent the different options for a given epoch
prcopt_t _opt; prcopt_t _opt;
......
...@@ -6,7 +6,8 @@ using namespace GNSSUtils; ...@@ -6,7 +6,8 @@ using namespace GNSSUtils;
Receiver::Receiver() Receiver::Receiver()
{ {
obs_ptr_ = std::make_shared<GNSSUtils::Observations>();
nav_ptr_ = std::make_shared<GNSSUtils::Navigation>();
} }
Receiver::~Receiver() Receiver::~Receiver()
...@@ -14,43 +15,16 @@ Receiver::~Receiver() ...@@ -14,43 +15,16 @@ Receiver::~Receiver()
} }
const std::shared_ptr<GNSSUtils::Observations> Receiver::getObs()
/* - 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()
{
//_nav = NULL;
}
void Receiver::setNavigation(nav_t nav)
{ {
_nav = nav; return obs_ptr_;
} }
nav_t Receiver::getNavigation() const std::shared_ptr<GNSSUtils::Navigation> Receiver::getNav()
{ {
return this->_nav; return nav_ptr_;
} }
/* - Processing options - */ /* - Processing options - */
void Receiver::clearOptions() void Receiver::clearOptions()
...@@ -109,20 +83,16 @@ ssat_t Receiver::getSatStatus() ...@@ -109,20 +83,16 @@ ssat_t Receiver::getSatStatus()
int Receiver::computeSPP(double *azel, char *msg) int Receiver::computeSPP(double *azel, char *msg)
{ {
/*
const 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 nav_t *nav = this->_nav;
const prcopt_t *opt = this->_opt; const prcopt_t *opt = this->_opt;
sol_t *sol = this->_sol; sol_t *sol = this->_sol;
ssat_t *ssat = this->_ssat; ssat_t *ssat = this->_ssat;
*/ */
return pntpos(obs, n, &_nav, &_opt, &_sol, azel, &_ssat, msg);
}
// return pntpos(obs, n, &_nav, &_opt, &_sol, azel, &_ssat, msg);
return 0;
}
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