NEDUtil.cpp
Go to the documentation of this file.
1 //==============================================================================
2 //
3 // This file is part of GNSSTk, the ARL:UT GNSS Toolkit.
4 //
5 // The GNSSTk is free software; you can redistribute it and/or modify
6 // it under the terms of the GNU Lesser General Public License as published
7 // by the Free Software Foundation; either version 3.0 of the License, or
8 // any later version.
9 //
10 // The GNSSTk is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU Lesser General Public License for more details.
14 //
15 // You should have received a copy of the GNU Lesser General Public
16 // License along with GNSSTk; if not, write to the Free Software Foundation,
17 // Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
18 //
19 // This software was developed by Applied Research Laboratories at the
20 // University of Texas at Austin.
21 // Copyright 2004-2022, The Board of Regents of The University of Texas System
22 //
23 //==============================================================================
24 
25 //==============================================================================
26 //
27 // This software was developed by Applied Research Laboratories at the
28 // University of Texas at Austin, under contract to an agency or agencies
29 // within the U.S. Department of Defense. The U.S. Government retains all
30 // rights to use, duplicate, distribute, disclose, or release this software.
31 //
32 // Pursuant to DoD Directive 523024
33 //
34 // DISTRIBUTION STATEMENT A: This software has been approved for public
35 // release, distribution is unlimited.
36 //
37 //==============================================================================
38 
39 //
40 //
41 //#include <stdio.h>
42 
43 // gnsstk
44 #include "NEDUtil.hpp"
45 
46 namespace gnsstk
47 {
48 
49 //using namespace std;
50 
51 NEDUtil::NEDUtil(const double refLatRad,
52  const double refLonRad)
53 {
54  compute( refLatRad, refLonRad );
55 }
56 
57 //
58 //
59 void NEDUtil::compute( const double refLat,
60  const double refLon )
61 {
62  rotMat.resize(3,3);
63  rotMat (0,0) = -std::sin(refLat)*std::cos(refLon);
64  rotMat (1,0) = -std::sin(refLon);
65  rotMat (2,0) = -std::cos(refLat)*std::cos(refLon);
66  rotMat (0,1) = -std::sin(refLat)*std::sin(refLon);
67  rotMat (1,1) = std::cos(refLon);
68  rotMat (2,1) = -std::cos(refLat)*std::sin(refLon);
69  rotMat (0,2) = std::cos(refLat);
70  rotMat (1,2) = 0.0;
71  rotMat (2,2) = -std::sin(refLat);
72 }
73 
74 void NEDUtil::updatePosition( const double refLatRad,
75  const double refLonRad )
76 {
77  compute( refLatRad, refLonRad );
78 }
79 
81 {
82  gnsstk::Vector<double> outV(3);
83 
84  if (inV.size()!=3)
85  {
86  gnsstk::Exception e("Incompatible dimensions for Vector");
87  GNSSTK_THROW(e);
88  }
89  outV = rotMat * inV;
90  return(outV);
91 }
92 
94 {
96  v[0] = inVec[0];
97  v[1] = inVec[1];
98  v[2] = inVec[2];
99 
101  gnsstk::Triple outVec( vOut[0], vOut[1], vOut[2] );
102  return(outVec);
103 }
104 
106 {
107  gnsstk::Xvt out;
108  out.clkbias = in.clkbias;
109  out.relcorr = in.relcorr;
110  out.clkdrift = in.clkdrift;
111  out.x = convertToNED( in.x );
112  out.v = convertToNED( in.v );
113  return(out);
114 }
115 } // end namespace gnsstk
gnsstk::Matrix::resize
Matrix & resize(size_t rows, size_t cols)
Definition: MatrixImplementation.hpp:135
NEDUtil.hpp
gnsstk::Xvt::v
Triple v
satellite velocity in ECEF Cartesian, meters/second
Definition: Xvt.hpp:152
gnsstk::Triple
Definition: Triple.hpp:68
gnsstk
For Sinex::InputHistory.
Definition: BasicFramework.cpp:50
std::sin
double sin(gnsstk::Angle x)
Definition: Angle.hpp:144
gnsstk::Xvt::relcorr
double relcorr
relativity correction (standard 2R.V/c^2 term), seconds
Definition: Xvt.hpp:155
gnsstk::Exception
Definition: Exception.hpp:151
gnsstk::Xvt::x
Triple x
Sat position ECEF Cartesian (X,Y,Z) meters.
Definition: Xvt.hpp:151
gnsstk::Xvt::clkdrift
double clkdrift
satellite clock drift in seconds/second
Definition: Xvt.hpp:154
gnsstk::Xvt
Definition: Xvt.hpp:60
gnsstk::NEDUtil::updatePosition
void updatePosition(const double refLatRad, const double refLonRad)
Definition: NEDUtil.cpp:74
std::cos
double cos(gnsstk::Angle x)
Definition: Angle.hpp:146
gnsstk::NEDUtil::rotMat
Matrix< double > rotMat
Definition: NEDUtil.hpp:108
gnsstk::NEDUtil::NEDUtil
NEDUtil(const double refGdLatRad, const double refLonRad)
Definition: NEDUtil.cpp:51
gnsstk::Vector< double >
gnsstk::NEDUtil::compute
void compute(const double refLat, const double refLon)
Definition: NEDUtil.cpp:59
gnsstk::NEDUtil::convertToNED
gnsstk::Vector< double > convertToNED(const gnsstk::Vector< double > &inV) const
Definition: NEDUtil.cpp:80
gnsstk::Vector::size
size_t size() const
STL size.
Definition: Vector.hpp:207
GNSSTK_THROW
#define GNSSTK_THROW(exc)
Definition: Exception.hpp:366
gnsstk::Xvt::clkbias
double clkbias
Sat clock correction in seconds.
Definition: Xvt.hpp:153


gnsstk
Author(s):
autogenerated on Wed Oct 25 2023 02:40:40