67 const std::pair<const Orientation &, bool> & orientation,
68 const std::pair<const Velocity &, bool> & velocity):
70 orientation_{orientation.first},
71 velocity_{velocity.first},
73 bHasOrientation_{orientation.second},
74 bHasVelocity_{velocity.second},
75 positionECEF_{position},
76 adjustedOrientation_{adjustOrientation(orientation_,velocity_)}{}
80 const std::pair<const Orientation &, bool> & orientation,
81 const std::pair<const Velocity &, bool> & velocity)
83 if(position == position_ &&
84 (!orientation.second || orientation.first == orientation_) &&
85 (!velocity.second || velocity.first == velocity_))
93 if(position != position_)
99 bool bCalculateAdjustedOrientation{
false};
101 if(orientation.second)
103 orientation_ = orientation.first;
104 bHasOrientation_ =
true;
105 bCalculateAdjustedOrientation =
true;
110 velocity_ = velocity.first;
111 bHasVelocity_ =
true;
112 bCalculateAdjustedOrientation =
true;
115 if(bCalculateAdjustedOrientation)
117 adjustedOrientation_ = adjustOrientation(orientation_,velocity_);
133 return {orientation_,bHasOrientation_};
139 return {adjustedOrientation_,bHasOrientation_ || bHasVelocity_};
145 return {velocity_,bHasVelocity_};
151 return positionECEF_;
160 double dX{otherECEF.
getX() - selfECEF.getX()};
161 double dY{otherECEF.getY() - selfECEF.getY()};
162 double dZ{ otherECEF.getZ() - selfECEF.getZ()};
167 double dNorthMeters{-dX * sin(dLatitudeRadians) * cos(dLongitudeRadians) -
168 dY * sin(dLatitudeRadians) * sin(dLongitudeRadians) +
169 dZ * cos(dLatitudeRadians)};
171 double dEastMeters{-dX * sin(dLongitudeRadians) + dY * cos(dLongitudeRadians)};
173 double dUpMeters{dX * cos(dLatitudeRadians) * cos(dLongitudeRadians) +
174 dY * cos(dLatitudeRadians) * sin(dLongitudeRadians) +
175 dZ * sin(dLatitudeRadians)};
177 PositionNEU otherNEU{dNorthMeters,dEastMeters,dUpMeters};
179 if(bHasOrientation_ || bHasVelocity_)
181 otherNEU.
rotate(adjustedOrientation_);
190 return bValid_==
false;
double getRollDegrees() const
Holds the velocity elements associated with an NEM's location information.
double getYawDegrees() const
std::pair< const Orientation &, bool > getAdjustedOrientation() const
double getElevationDegrees() const
std::pair< const Orientation &, bool > getOrientation() const
PositionOrientationVelocity()
bool update(const Position &position, const std::pair< const Orientation &, bool > &orientation, const std::pair< const Velocity &, bool > &velocity)
double getAzimuthDegrees() const
void AI_TO_BE_DEGREES(double &val, const double A, const double B)
double getPitchDegrees() const
void NEG_90_TO_POS_90_DEGREES(double &val)
std::pair< const Velocity &, bool > getVelocity() const
const PositionECEF & getPositionECEF() const
const Position & getPosition() const
void rotate(const Orientation &orientation)
double getLatitudeRadians() const
Holds pitch, yaw and roll.
PositionNEU getPositionNEU(const PositionOrientationVelocity &other) const
Holds latitude, longitude and altitude.
double getLongitudeRadians() const