ENUUtil.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 // gnsstk
40 #include "ENUUtil.hpp"
41 
42 namespace gnsstk
43 {
44 
45 //using namespace std;
46 
47 ENUUtil::ENUUtil(const double refLatRad,
48  const double refLonRad)
49 {
50  compute( refLatRad, refLonRad );
51 }
52 
53 //
54 //
55 void ENUUtil::compute( const double refLat,
56  const double refLon )
57 {
58  rotMat.resize(3,3);
59  rotMat (0,0) = -std::sin(refLon);
60  rotMat (1,0) = -std::sin(refLat)*std::cos(refLon);
61  rotMat (2,0) = std::cos(refLat)*std::cos(refLon);
62  rotMat (0,1) = std::cos(refLon);
63  rotMat (1,1) = -std::sin(refLat)*std::sin(refLon);
64  rotMat (2,1) = std::cos(refLat)*std::sin(refLon);
65  rotMat (0,2) = 0.0;
66  rotMat (1,2) = std::cos(refLat);
67  rotMat (2,2) = std::sin(refLat);
68 }
69 
70 void ENUUtil::updatePosition( const double refLatRad,
71  const double refLonRad )
72 {
73  compute( refLatRad, refLonRad );
74 }
75 
76 
78 {
79  gnsstk::Vector<double> outV(3);
80 
81  if (inV.size()!=3)
82  {
83  gnsstk::Exception e("Incompatible dimensions for Vector");
84  GNSSTK_THROW(e);
85  }
86  outV = rotMat * inV;
87  return(outV);
88 }
89 
91 {
93  v[0] = inVec[0];
94  v[1] = inVec[1];
95  v[2] = inVec[2];
96 
98  gnsstk::Triple outVec( vOut[0], vOut[1], vOut[2] );
99  return(outVec);
100 }
101 
103 {
104  gnsstk::Xvt out;
105  out.clkbias = in.clkbias;
106  out.relcorr = in.relcorr;
107  out.clkdrift = in.clkdrift;
108  out.x = convertToENU( in.x );
109  out.v = convertToENU( in.v );
110  return(out);
111 }
112 } // end namespace gnsstk
gnsstk::Matrix::resize
Matrix & resize(size_t rows, size_t cols)
Definition: MatrixImplementation.hpp:135
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
gnsstk::ENUUtil::rotMat
Matrix< double > rotMat
Definition: ENUUtil.hpp:109
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::ENUUtil::convertToENU
gnsstk::Vector< double > convertToENU(const gnsstk::Vector< double > &inV) const
Definition: ENUUtil.cpp:77
std::cos
double cos(gnsstk::Angle x)
Definition: Angle.hpp:146
gnsstk::Vector< double >
gnsstk::Vector::size
size_t size() const
STL size.
Definition: Vector.hpp:207
GNSSTK_THROW
#define GNSSTK_THROW(exc)
Definition: Exception.hpp:366
gnsstk::ENUUtil::updatePosition
void updatePosition(const double refGDLatRad, const double refLonRad)
Definition: ENUUtil.cpp:70
gnsstk::Xvt::clkbias
double clkbias
Sat clock correction in seconds.
Definition: Xvt.hpp:153
ENUUtil.hpp
gnsstk::ENUUtil::ENUUtil
ENUUtil(const double refGeodeticLatRad, const double refLonRad)
Definition: ENUUtil.cpp:47
gnsstk::ENUUtil::compute
void compute(const double refLat, const double refLon)
Definition: ENUUtil.cpp:55


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