DUNE: Uniform Navigational Environment  2.6.1
DUNE::Coordinates Namespace Reference

Detailed Description

Coordinate manipulation routines and classes.

Classes

class  BodyFixedFrame
 
class  UTM
 
class  UTMPoint
 
class  WGS84
 
struct  WMMData
 
class  WMM
 

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)
 
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
 

Function Documentation

template<typename A >
void DUNE::Coordinates::displace ( A &  point,
double  bearing,
double  range 
)

Displace a XY coordinate according to given bearing and range.

Parameters
pointpoint
bearingbearing
rangerange

Referenced by DUNE::Maneuvers::VehicleFormation::consume(), and DUNE::Maneuvers::VehicleFormation::point().

template<typename A , typename B >
double DUNE::Coordinates::getBearing ( const A &  origin,
const B &  point 
)

Get bearing of a point in relation to an origin.

Parameters
originOrigin
pointpoint for which offset is to be obtained
Returns
bearing from origin to point

Referenced by DUNE::Control::PathController::loiter(), DUNE::Maneuvers::VehicleFormation::point(), Control::Path::VectorField::Task::step(), and Control::Path::ILOS::Task::step().

template<typename A , typename B >
void DUNE::Coordinates::getBearingAndRange ( const A &  origin,
const B &  point,
double *  bearing,
double *  range 
)
inline

Get bearing and range of a point in relation to an origin.

Parameters
originOrigin
pointpoint for which offset is to be obtained
bearingpointer to output bearing data
rangepointer to output range data

References toPolar().

Referenced by DUNE::Control::PathController::consume(), and getTrackPosition().

template<typename A , typename B >
double DUNE::Coordinates::getRange ( const A &  a,
const B &  b 
)

Get range between two points.

Parameters
aWaypoint 1
bWaypoint 2
Returns
bearing from origin to point
template<typename A , typename B >
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.

Parameters
originorigin
orientationorientation
pointpoint for which track positions are required
xalong-track position on exit
yoptional cross-track position on exit

References getBearingAndRange().

template<typename A , typename B >
void DUNE::Coordinates::setBearingAndRange ( const A &  origin,
double  bearing,
double  range,
B &  point 
)

Calculate waypoint given waypoint origin, target bearing and range.

Parameters
originOrigin
bearingTarget bearing
rangeTarget range
pointoutput point

Referenced by DUNE::Control::PathController::consume(), and DUNE::Control::PathController::loiter().

Math::Matrix DUNE::Coordinates::sphericalToCartesian ( double  r,
double  az,
double  el 
)
inline

Convert a three-dimensional vector from spherical coordinates (R,Az,El) to cartesian coordinates.

Parameters
rvector norm.
azazimuth angle in radians.
elelevation angle in radians.

References DUNE::Math::Matrix.

void DUNE::Coordinates::toPolar ( double  x,
double  y,
double *  angle,
double *  norm 
)
inline

Get polar coordinates corresponding to given XY coordinates.

Parameters
xX coordinate
yY coordinate
anglepointer to output angle
normpointer to output norm

Referenced by DUNE::Maneuvers::VehicleFormation::consume(), getBearingAndRange(), DUNE::Maneuvers::VehicleFormation::point(), and toPolar().

template<typename A >
void DUNE::Coordinates::toPolar ( const A &  coord,
double *  angle,
double *  norm 
)
inline

Get polar coordinates corresponding to given XY coordinates.

Parameters
coordXY coordinates
anglepointer to output angle
normpointer 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.

Parameters
[in]estateestimated state message.
[out]latWGS84 latitude.
[out]lonWGS84 longitude.
[out]haeheight 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::Control::PathController::consume(), DUNE::Utils::Codecs::CodedEstimatedState::encode(), 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.

Parameters
[in]estateestimated state message.
[out]latWGS84 latitude.
[out]lonWGS84 longitude.

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.

Parameters
[in]estatesimulated state message.
[out]latWGS84 latitude.
[out]lonWGS84 longitude.
[out]haeheight 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.

Parameters
[in]estatesimulated state message.
[out]latWGS84 latitude.
[out]lonWGS84 longitude.

References DUNE::IMC::SimulatedState::height, and toWGS84().

Variable Documentation

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