mavsdk::geometry::CoordinateTransformation Class Reference ​
#include: geometry.h
This is a utility class for coordinate transformations.
The projections used to transform from global (lat/lon) to local (meter) coordinates are taken from: http://mathworld.wolfram.com/AzimuthalEquidistantProjection.html and inspired by the implementations in: https://github.com/PX4/ecl/blob/master/geo/geo.cpp
Data Structures ​
struct GlobalCoordinate
struct LocalCoordinate
Public Member Functions ​
Type | Name | Description |
---|---|---|
 | CoordinateTransformation ()=delete | Default constructor not available. |
 | CoordinateTransformation (GlobalCoordinate reference) | Constructor to initialize projection reference. |
 | ~CoordinateTransformation ()=default | Destructor. |
LocalCoordinate | local_from_global (GlobalCoordinate global_coordinate)const | Calculate local coordinates from global coordinates. |
GlobalCoordinate | global_from_local (LocalCoordinate local_coordinate)const | Calculate global coordinates from local coordinates. |
Constructor & Destructor Documentation ​
CoordinateTransformation() ​
cpp
mavsdk::geometry::CoordinateTransformation::CoordinateTransformation()=delete
Default constructor not available.
CoordinateTransformation() ​
cpp
mavsdk::geometry::CoordinateTransformation::CoordinateTransformation(GlobalCoordinate reference)
Constructor to initialize projection reference.
Parameters
- GlobalCoordinate reference - Reference coordinate to project from.
~CoordinateTransformation() ​
cpp
mavsdk::geometry::CoordinateTransformation::~CoordinateTransformation()=default
Destructor.
Member Function Documentation ​
local_from_global() ​
cpp
LocalCoordinate mavsdk::geometry::CoordinateTransformation::local_from_global(GlobalCoordinate global_coordinate) const
Calculate local coordinates from global coordinates.
Parameters
- GlobalCoordinate global_coordinate - The global coordinate to project from.
Returns
 LocalCoordinate -
global_from_local() ​
cpp
GlobalCoordinate mavsdk::geometry::CoordinateTransformation::global_from_local(LocalCoordinate local_coordinate) const
Calculate global coordinates from local coordinates.
Parameters
- LocalCoordinate local_coordinate - The local coordinate to project from.
Returns
 GlobalCoordinate -