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

Detailed Description

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
 

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

References displace().

Referenced by DUNE::Maneuvers::VehicleFormation::consume(), displace(), DUNE::Maneuvers::FigureEight::FigureEight(), 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

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

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 getBearingAndRange(), and toPolar().

Referenced by DUNE::Control::PathController::consume(), getBearingAndRange(), 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

References getRange().

Referenced by DUNE::Control::PathController::consume(), DUNE::Maneuvers::RowsStages::getDistance(), and getRange().

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(), 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.

Parameters
latitudelatitude in radian.
Returns
NMEA formatted latitude.

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.

Parameters
longitudelongitude in radian.
Returns
NMEA formatted longitude.

References DUNE::Math::Angles::convertDecimalToDM(), DUNE::Math::Angles::degrees(), and DUNE::Utils::String::str().

Referenced by Sensors::EmulatedGPS::Task::createRMC(), and sphericalToCartesian().

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

References setBearingAndRange().

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

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 latitudeToNMEA(), longitudeToNMEA(), DUNE::Math::Matrix, sphericalToCartesian(), and toWGS84().

Referenced by sphericalToCartesian().

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

References toPolar().

Referenced by DUNE::Maneuvers::VehicleFormation::consume(), getBearingAndRange(), DUNE::Maneuvers::VehicleFormation::point(), DUNE::Maneuvers::StationKeep::StationKeep(), 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 
)

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