Routines for WGS-84 coordinate manipulation.
|
template<typename Ta , typename Tb > |
static Ta | distance (Ta lat1, Ta lon1, Tb hae1, Ta lat2, Ta lon2, Tb hae2) |
|
template<typename Ta , typename Tb , typename Tc , typename Td , typename Te > |
static void | displacement (Ta rlat, Ta rlon, Tb rhae, Tc lat, Tc lon, Td hae, Te *n, Te *e, Te *d=NULL) |
|
template<typename Ta , typename Tb , typename Tc , typename Td > |
static void | displace (Ta n, Ta e, Tb d, Tc *lat, Tc *lon, Td *hae) |
|
template<typename Ta , typename Tb > |
static void | displace (Ta n, Ta e, Tb *lat, Tb *lon) |
|
template<typename Ta , typename Tb > |
static void | getNEBearingAndRange (Ta lat1, Ta lon1, Ta lat2, Ta lon2, Tb *bearing, Tb *range) |
|
template<typename Ta , typename Tb , typename Tc > |
static void | getAzimuthAndElevation (Ta lat1, Ta lon1, Tb hei1, Ta lat2, Ta lon2, Tb hei2, Tc *azimuth, Tc *elevation) |
|
template<typename Ta , typename Tb , typename Tc > |
static void | toECEF (Ta lat, Ta lon, Tb hae, Tc *x, Tc *y, Tc *z) |
|
template<typename Ta , typename Tb , typename Tc , typename Td > |
static void | fromECEF (Ta x, Ta y, Tb z, Tc *lat, Tc *lon, Td *hae) |
|
template<typename Ta , typename Tb , typename Tc , typename Td >
static void DUNE::Coordinates::WGS84::displace |
( |
Ta |
n, |
|
|
Ta |
e, |
|
|
Tb |
d, |
|
|
Tc * |
lat, |
|
|
Tc * |
lon, |
|
|
Td * |
hae |
|
) |
| |
|
inlinestatic |
Displace a geodetic coordinate in the NED frame according to given offsets.
- Parameters
-
[in] | n | North offset (m). |
[in] | e | East offset (m). |
[in] | d | Down offset (m). |
[in,out] | lat | reference latitude on entry, displaced latitude on exit (rad). |
[in,out] | lon | reference longitude entry, displaced longitude on exit (rad). |
[in,out] | hae | reference height on entry, displaced height on exit (rad). |
References fromECEF(), and toECEF().
Referenced by DUNE::Maneuvers::VehicleFormation::consume(), DUNE::Maneuvers::FollowTrajectory::desiredPath(), DUNE::Maneuvers::VehicleFormation::desiredPath(), displace(), DUNE::Maneuvers::FigureEight::FigureEight(), DUNE::Maneuvers::RowsStages::getDistance(), DUNE::Parsers::PlanConfigParser::parseCoordinate(), DUNE::Control::SlopeData::renderSlopeInvalid(), DUNE::Navigation::UsblTools::toFix(), and DUNE::Coordinates::toWGS84().
template<typename Ta , typename Tb , typename Tc , typename Td , typename Te >
static void DUNE::Coordinates::WGS84::displacement |
( |
Ta |
rlat, |
|
|
Ta |
rlon, |
|
|
Tb |
rhae, |
|
|
Tc |
lat, |
|
|
Tc |
lon, |
|
|
Td |
hae, |
|
|
Te * |
n, |
|
|
Te * |
e, |
|
|
Te * |
d = NULL |
|
) |
| |
|
inlinestatic |
template<typename Ta , typename Tb >
static Ta DUNE::Coordinates::WGS84::distance |
( |
Ta |
lat1, |
|
|
Ta |
lon1, |
|
|
Tb |
hae1, |
|
|
Ta |
lat2, |
|
|
Ta |
lon2, |
|
|
Tb |
hae2 |
|
) |
| |
|
inlinestatic |
Calculate distance between two WGS-84 coordinates.
Basically, a ECEF conversion of both WGS-84 coordinates is done then the ECEF distance is returned.
- Note
- This is the standard way of doing it and that NE distance is a different measure.
- Parameters
-
[in] | lat1 | WGS-84 latitude of first coordinate (rad). |
[in] | lon1 | WGS-84 longitude of first coordinate (rad). |
[in] | hae1 | height above WGS-84 ellipsoid of first coordinate (m). |
[in] | lat2 | WGS-84 latitude of second coordinate (rad). |
[in] | lon2 | WGS-84 longitude of second coordinate (rad). |
[in] | hae2 | height above WGS-84 ellipsoid of second coordinate (m). |
- Returns
- distance between the two coordinates (m).
References toECEF().
Referenced by DUNE::Control::PathController::consume(), DUNE::Navigation::StreamEstimator::consume(), and DUNE::Maneuvers::FigureEight::FigureEight().
template<typename Ta , typename Tb , typename Tc , typename Td >
static void DUNE::Coordinates::WGS84::fromECEF |
( |
Ta |
x, |
|
|
Ta |
y, |
|
|
Tb |
z, |
|
|
Tc * |
lat, |
|
|
Tc * |
lon, |
|
|
Td * |
hae |
|
) |
| |
|
inlinestatic |
Convert ECEF (x,y,z) to WGS-84 (lat, lon, hae) using non-iterative solution.
- Parameters
-
[in] | x | ECEF x coordinate (m). |
[in] | y | ECEF y coordinate (m). |
[in] | z | ECEF z coordinate (m). |
[out] | lat | WGS-84 latitude (rad). |
[out] | lon | WGS-84 longitude (rad). |
[out] | hae | height above WGS-84 ellipsoid (m). |
Referenced by displace().
template<typename Ta , typename Tb , typename Tc >
static void DUNE::Coordinates::WGS84::toECEF |
( |
Ta |
lat, |
|
|
Ta |
lon, |
|
|
Tb |
hae, |
|
|
Tc * |
x, |
|
|
Tc * |
y, |
|
|
Tc * |
z |
|
) |
| |
|
inlinestatic |
Convert WGS-84 coordinates to ECEF (Earch Center Earth Fixed) coordinates.
- Parameters
-
[in] | lat | WGS-84 latitude (rad). |
[in] | lon | WGS-84 longitude (rad). |
[in] | hae | WGS-84 coordinate height (m). |
[out] | x | storage for ECEF x coordinate (m). |
[out] | y | storage for ECEF y coordinate (m). |
[out] | z | storage for ECEF z coordinate (m). |
Referenced by displace(), displacement(), and distance().