diff --git a/include/gnss_utils/navigation.h b/include/gnss_utils/navigation.h index 1c259477d067b4a0646ba43f31fc3d23e85eb522..ba4c3f594f6fa59e852575fb87d9d6c49b4cf4da 100644 --- a/include/gnss_utils/navigation.h +++ b/include/gnss_utils/navigation.h @@ -69,8 +69,6 @@ class Navigation //////////////////////////////// nav UTILS ////////////////////////////////////// template <typename T> - static void copyArrayElement(const T &new_element, T& element_spot); - template <typename T> static bool addToArray(const T &new_element, T *&array, int &n, int &nmax); template <typename T> static bool copyArray(const T *array_in, const int &n_in, T *&array_out, int &n_out, int &nmax_out); @@ -252,115 +250,15 @@ inline void Navigation::freeAlmanac() } //////////////////////////////// nav UTILS ////////////////////////////////////// -template <typename T> -inline void Navigation::copyArrayElement(const T &new_element, T& element_spot) -{ - element_spot = new_element; -} - -//template <> -//inline void Navigation::copyArrayElement<eph_t>(const eph_t& new_element, eph_t& element_spot) -//{ -// element_spot = new_element; -// std::cout << "tgd new element " << new_element.tgd << std::endl; -// std::cout << "before tgd element_spot " << element_spot.tgd << std::endl; -// double tgd[4]; -// element_spot.tgd = tgd; -// std::cout << "tgd element_spot " << element_spot.tgd << std::endl; -//} -//template <> -//inline void Navigation::copyArrayElement<geph_t>(const geph_t& new_element, geph_t& element_spot) -//{ -// element_spot = new_element; -// std::cout << "pos new element " << new_element.pos << std::endl; -// std::cout << "before pos element_spot " << element_spot.pos << std::endl; -// double pos[3]; -// element_spot.pos = pos; -// std::cout << "pos element_spot " << element_spot.pos << std::endl; -//} -//template <> -//inline void Navigation::copyArrayElement<seph_t>(const seph_t& new_element, seph_t& element_spot) -//{ -// element_spot = new_element; -// std::cout << "pos new element " << new_element.pos << std::endl; -// std::cout << "before pos element_spot " << element_spot.pos << std::endl; -// double pos[3]; -// element_spot.pos = pos; -// std::cout << "pos element_spot " << element_spot.pos << std::endl; -//} -//template <> -//inline void Navigation::copyArrayElement<peph_t>(const peph_t& new_element, peph_t& element_spot) -//{ -// element_spot = new_element; -// std::cout << "pos new element " << new_element.pos << std::endl; -// std::cout << "before pos element_spot " << element_spot.pos << std::endl; -// double pos[MAXSAT][4]; -// element_spot.pos = pos; -// std::cout << "pos element_spot " << element_spot.pos << std::endl; -//} -//template <> -//inline void Navigation::copyArrayElement<pclk_t>(const pclk_t& new_element, pclk_t& element_spot) -//{ -// element_spot = new_element; -// std::cout << "clk new element " << new_element.clk << std::endl; -// std::cout << "before clk element_spot " << element_spot.clk << std::endl; -// double clk[MAXSAT][1]; -// element_spot.clk = clk; -// std::cout << "clk element_spot " << element_spot.clk << std::endl; -//} -template <> -inline void Navigation::copyArrayElement<alm_t>(const alm_t& new_element, alm_t& element_spot) -{ - std::cout << "copyArrayElement<alm_t>\n"; - std::cout << "new element: "; - std::cout << new_element.sat << std::endl; /* satellite number */ - std::cout << new_element.svh << std::endl; /* sv health (0:ok) */ - std::cout << new_element.svconf << std::endl; /* as and sv config */ - std::cout << new_element.week << std::endl; /* GPS/QZS: gps week, GAL: galileo week */ - //toa; /* Toa */ - - std::cout << new_element.A << std::endl; - std::cout << new_element.e << std::endl; - std::cout << new_element.i0 << std::endl; - std::cout << new_element.OMG0 << std::endl; - std::cout << new_element.omg << std::endl; - std::cout << new_element.M0 << std::endl; - std::cout << new_element.OMGd << std::endl; - std::cout << new_element.toas << std::endl; /* Toa (s) in week */ - std::cout << new_element.f0 << std::endl; - std::cout << new_element.f1 << std::endl; - - std::cout << "element_spot: " << std::endl; - std::cout << element_spot.sat << std::endl; /* satellite number */ - std::cout << element_spot.svh << std::endl; /* sv health (0:ok) */ - std::cout << element_spot.svconf << std::endl; /* as and sv config */ - std::cout << element_spot.week << std::endl; /* GPS/QZS: gps week, GAL: galileo week */ - //toa; /* Toa */ - - std::cout << element_spot.A << std::endl; - std::cout << element_spot.e << std::endl; - std::cout << element_spot.i0 << std::endl; - std::cout << element_spot.OMG0 << std::endl; - std::cout << element_spot.omg << std::endl; - std::cout << element_spot.M0 << std::endl; - std::cout << element_spot.OMGd << std::endl; - std::cout << element_spot.toas << std::endl; /* Toa (s) in week */ - std::cout << element_spot.f0 << std::endl; - std::cout << element_spot.f1 << std::endl; - - std::cout << "copying.."; - element_spot = new_element; -} - template <typename T> inline bool Navigation::addToArray(const T &new_element, T *&array, int &n, int &nmax) { - std::cout << "addToArray: n = " << n << " nmax = " << nmax << "\n"; + //std::cout << "addToArray: n = " << n << " nmax = " << nmax << "\n"; // "inspired" from RTKLIB rinex.c T *array_ref; if (nmax <= n) { - std::cout << "addToArray: nmax <= n\n"; + //std::cout << "addToArray: nmax <= n\n"; nmax += 1024; if (!(array_ref = (T*)realloc(array, sizeof(T) * nmax))) { @@ -370,36 +268,36 @@ inline bool Navigation::addToArray(const T &new_element, T *&array, int &n, int n = nmax = 0; return false; } - std::cout << "addToArray: assigning reallocated array\n"; + //std::cout << "addToArray: assigning reallocated array\n"; array = array_ref; } - std::cout << "addToArray: adding element " << n << "\n"; - copyArrayElement<T>(new_element, array[n++]); - std::cout << "addToArray: added!\n"; + //std::cout << "addToArray: adding element " << n << "\n"; + array[n++] = new_element; + //std::cout << "addToArray: added!\n"; return true; } template<typename T> inline bool Navigation::copyArray(const T *array_in, const int &n_in, T *&array_out, int &n_out, int &nmax_out) { - std::cout << "copyArray: " << n_in << " elements\n"; + //std::cout << "copyArray: " << n_in << " elements\n"; if (array_in == NULL) return false; - std::cout << "copyArray: array in not null\n"; + //std::cout << "copyArray: array in not null\n"; for (int i = 0; i<n_in; i++) { - std::cout << "copyArray: adding element " << i << "\n"; + //std::cout << "copyArray: adding element " << i << "\n"; if (!addToArray<T>(array_in[i], array_out, n_out, nmax_out)) { - std::cout << "copyArray: failed to add..\n"; + //std::cout << "copyArray: failed to add..\n"; return false; } - std::cout << "copyArray: n_out = " << n_out << " nmax_out = " << nmax_out << "\n"; + //std::cout << "copyArray: n_out = " << n_out << " nmax_out = " << nmax_out << "\n"; } - std::cout << "copyArray: all copied\n"; + //std::cout << "copyArray: all copied\n"; return true; } diff --git a/src/ublox_raw.cpp b/src/ublox_raw.cpp index dd1630a0d119f4405d77125477581c507b74eb6f..8ce73d04fe114c3f446cc61e6d969ce4d106a9cb 100644 --- a/src/ublox_raw.cpp +++ b/src/ublox_raw.cpp @@ -79,9 +79,6 @@ RawDataType UBloxRaw::addDataStream(const std::vector<u_int8_t>& data_stream) } } - - std::cout << "ALL BYTES DECODED!\n\n"; - return raw_data_type_; }