DUNE: Uniform Navigational Environment
2019.02.1
|
Coordinate manipulation routines and classes.
Classes | |
class | BodyFixedFrame |
class | UTM |
class | UTMPoint |
class | WGS84 |
class | WMM |
struct | WMMData |
Functions | |
void | toWGS84 (const IMC::EstimatedState &estate, double &lat, double &lon, float &hae) |
void | toWGS84 (const IMC::EstimatedState &estate, double &lat, double &lon) |
void | toWGS84 (const IMC::SimulatedState &estate, double &lat, double &lon, float &hae) |
void | toWGS84 (const IMC::SimulatedState &estate, double &lat, double &lon) |
std::string | latitudeToNMEA (double latitude) |
std::string | longitudeToNMEA (double longitude) |
void | toPolar (double x, double y, double *angle, double *norm) |
template<typename A > | |
void | toPolar (const A &coord, double *angle, double *norm) |
template<typename A , typename B > | |
void | getBearingAndRange (const A &origin, const B &point, double *bearing, double *range) |
template<typename A > | |
void | displace (A &point, double bearing, double range) |
template<typename A , typename B > | |
void | setBearingAndRange (const A &origin, double bearing, double range, B &point) |
template<typename A , typename B > | |
double | getRange (const A &a, const B &b) |
template<typename A , typename B > | |
double | getBearing (const A &origin, const B &point) |
template<typename A , typename B > | |
void | getTrackPosition (const A &origin, double orientation, const B &point, double *x, double *y=0) |
Math::Matrix | sphericalToCartesian (double r, double az, double el) |
Variables | |
class DUNE_DLL_SYM | BodyFixedFrame |
class DUNE_DLL_SYM | UTM |
class DUNE_DLL_SYM | UTMPoint |
class DUNE_DLL_SYM | WGS84 |
class DUNE_DLL_SYM | WMM |
void DUNE::Coordinates::displace | ( | A & | point, |
double | bearing, | ||
double | range | ||
) |
Displace a XY coordinate according to given bearing and range.
point | point |
bearing | bearing |
range | range |
References displace().
Referenced by DUNE::Maneuvers::VehicleFormation::consume(), displace(), DUNE::Maneuvers::FigureEight::FigureEight(), and DUNE::Maneuvers::VehicleFormation::point().
double DUNE::Coordinates::getBearing | ( | const A & | origin, |
const B & | point | ||
) |
Get bearing of a point in relation to an origin.
origin | Origin |
point | point for which offset is to be obtained |
References getBearing().
Referenced by DUNE::Maneuvers::FigureEight::FigureEight(), getBearing(), DUNE::Control::PathController::loiter(), DUNE::Maneuvers::VehicleFormation::point(), Control::Path::VectorField::Task::step(), and Control::Path::ILOS::Task::step().
|
inline |
Get bearing and range of a point in relation to an origin.
origin | Origin |
point | point for which offset is to be obtained |
bearing | pointer to output bearing data |
range | pointer to output range data |
References getBearingAndRange(), and toPolar().
Referenced by DUNE::Control::PathController::consume(), getBearingAndRange(), and getTrackPosition().
double DUNE::Coordinates::getRange | ( | const A & | a, |
const B & | b | ||
) |
Get range between two points.
a | Waypoint 1 |
b | Waypoint 2 |
References getRange().
Referenced by DUNE::Control::PathController::consume(), DUNE::Maneuvers::RowsStages::getDistance(), and getRange().
void DUNE::Coordinates::getTrackPosition | ( | const A & | origin, |
double | orientation, | ||
const B & | point, | ||
double * | x, | ||
double * | y = 0 |
||
) |
Get along and cross track positions of a 2D point for a track defined by an origin and an orientation.
origin | origin |
orientation | orientation |
point | point for which track positions are required |
x | along-track position on exit |
y | optional cross-track position on exit |
References getBearingAndRange(), and getTrackPosition().
Referenced by getTrackPosition(), and DUNE::Control::PathController::sourceFilter().
std::string DUNE::Coordinates::latitudeToNMEA | ( | double | latitude | ) |
Convert latitude to the format used in NMEA sentences.
latitude | latitude in radian. |
References DUNE::Math::Angles::convertDecimalToDM(), DUNE::Math::Angles::degrees(), and DUNE::Utils::String::str().
Referenced by Sensors::EmulatedGPS::Task::createRMC(), and sphericalToCartesian().
std::string DUNE::Coordinates::longitudeToNMEA | ( | double | longitude | ) |
Convert longitude to the format used in NMEA sentences.
longitude | longitude in radian. |
References DUNE::Math::Angles::convertDecimalToDM(), DUNE::Math::Angles::degrees(), and DUNE::Utils::String::str().
Referenced by Sensors::EmulatedGPS::Task::createRMC(), and sphericalToCartesian().
void DUNE::Coordinates::setBearingAndRange | ( | const A & | origin, |
double | bearing, | ||
double | range, | ||
B & | point | ||
) |
Calculate waypoint given waypoint origin, target bearing and range.
origin | Origin |
bearing | Target bearing |
range | Target range |
point | output point |
References setBearingAndRange().
Referenced by DUNE::Control::PathController::consume(), DUNE::Control::PathController::loiter(), and setBearingAndRange().
|
inline |
Convert a three-dimensional vector from spherical coordinates (R,Az,El) to cartesian coordinates.
r | vector norm. |
az | azimuth angle in radians. |
el | elevation angle in radians. |
References latitudeToNMEA(), longitudeToNMEA(), DUNE::Math::Matrix, sphericalToCartesian(), and toWGS84().
Referenced by sphericalToCartesian().
|
inline |
Get polar coordinates corresponding to given XY coordinates.
x | X coordinate |
y | Y coordinate |
angle | pointer to output angle |
norm | pointer to output norm |
References toPolar().
Referenced by DUNE::Maneuvers::VehicleFormation::consume(), getBearingAndRange(), DUNE::Maneuvers::VehicleFormation::point(), DUNE::Maneuvers::StationKeep::StationKeep(), and toPolar().
|
inline |
Get polar coordinates corresponding to given XY coordinates.
coord | XY coordinates |
angle | pointer to output angle |
norm | pointer to output norm |
References toPolar().
void DUNE::Coordinates::toWGS84 | ( | const IMC::EstimatedState & | estate, |
double & | lat, | ||
double & | lon, | ||
float & | hae | ||
) |
Convert the position in an estimated state message to WGS84 coordinates.
[in] | estate | estimated state message. |
[out] | lat | WGS84 latitude. |
[out] | lon | WGS84 longitude. |
[out] | hae | height above WGS84 ellipsoid. |
References DUNE::Coordinates::WGS84::displace(), DUNE::IMC::EstimatedState::height, DUNE::IMC::EstimatedState::lat, DUNE::IMC::EstimatedState::lon, DUNE::IMC::EstimatedState::x, DUNE::IMC::EstimatedState::y, and DUNE::IMC::EstimatedState::z.
Referenced by DUNE::Navigation::StreamEstimator::consume(), DUNE::Control::PathController::consume(), DUNE::Utils::Codecs::CodedEstimatedState::encode(), DUNE::Maneuvers::FigureEight::FigureEight(), DUNE::Control::SlopeData::renderSlopeInvalid(), sphericalToCartesian(), DUNE::Maneuvers::StationKeep::StationKeep(), DUNE::Navigation::UsblTools::toFix(), and toWGS84().
void DUNE::Coordinates::toWGS84 | ( | const IMC::EstimatedState & | estate, |
double & | lat, | ||
double & | lon | ||
) |
Convert the position in an estimated state message to WGS84 coordinates.
References DUNE::IMC::EstimatedState::height, and toWGS84().
void DUNE::Coordinates::toWGS84 | ( | const IMC::SimulatedState & | estate, |
double & | lat, | ||
double & | lon, | ||
float & | hae | ||
) |
Convert the position in a simulated state message to WGS84 coordinates.
[in] | estate | simulated state message. |
[out] | lat | WGS84 latitude. |
[out] | lon | WGS84 longitude. |
[out] | hae | height above WGS84 ellipsoid. |
References DUNE::Coordinates::WGS84::displace(), DUNE::IMC::SimulatedState::height, DUNE::IMC::SimulatedState::lat, DUNE::IMC::SimulatedState::lon, DUNE::IMC::SimulatedState::x, DUNE::IMC::SimulatedState::y, and DUNE::IMC::SimulatedState::z.
void DUNE::Coordinates::toWGS84 | ( | const IMC::SimulatedState & | estate, |
double & | lat, | ||
double & | lon | ||
) |
Convert the position in a simulated state message to WGS84 coordinates.
References DUNE::IMC::SimulatedState::height, and toWGS84().
class DUNE_DLL_SYM DUNE::Coordinates::BodyFixedFrame |
class DUNE_DLL_SYM DUNE::Coordinates::UTM |
class DUNE_DLL_SYM DUNE::Coordinates::UTMPoint |
class DUNE_DLL_SYM DUNE::Coordinates::WGS84 |
class DUNE_DLL_SYM DUNE::Coordinates::WMM |