Skip to content

AcresGeoUtm.h#

Acres/Source/Acres/AcresGeoUtm.h Generated

Universal Transverse Mercator projection (pure C++, header only, no Unreal types).

The Polaris Ranger's localisation (Dataspeed ds_localization on the OxTS AV200 fix) publishes /vehicle/odom in UTM zone 16N on the WGS84 ellipsoid; the simulator's INS stream (AcresSensors.cpp) and the multi-agent spawn poses given in UTM (AcresAgents.cpp) use these functions. The datum of the latitude / longitude going in (NAD83(2011) for an RTK fix, WGS84(G2139) otherwise) is the caller's choice, as on the vehicle; see Calibration/Polaris/geo.py.

Method: Krueger's series to sixth order in the third flattening n (Karney 2011, "Transverse Mercator with an accuracy of a few nanometers", J. Geodesy 85, eqs. 7-11, 35-36), accurate to well below a millimetre inside a zone. Tested against pyproj in Tools/PolarisModel/polaris_tests.cpp.

Name Type Unit Default Description
A, F, K0, FalseEasting inline constexpr double WGS84 ellipsoid, UTM scale on the central meridian and false easting.

CentralMeridianDeg#

Central meridian of a zone, deg.

inline double CentralMeridianDeg(int Zone) ;

GeographicToUtm#

Latitude / longitude to UTM on the WGS84 ellipsoid (northern hemisphere).

Argument Description
LatDeg Latitude, deg.
LonDeg Longitude, deg (negative west).
Zone UTM zone (16 for the ACRE farm).

Returns: Easting, northing, meridian convergence and point scale.

inline FUtm GeographicToUtm(double LatDeg, double LonDeg, int Zone) ;

UtmToGeographic#

UTM (WGS84 ellipsoid, northern hemisphere) to latitude / longitude.

Argument Description
EastingM Easting, m.
NorthingM Northing, m.
Zone UTM zone.
LatDeg Output latitude, deg.
LonDeg Output longitude, deg.
inline void UtmToGeographic(double EastingM, double NorthingM, int Zone, double& LatDeg, double& LonDeg) ;

FUtm#

struct FUtm

Result of a forward UTM projection.

Name Type Unit Default Description
EastingM double m 0 See above.
NorthingM double m 0 UTM coordinates, m (false easting 500 km; northern hemisphere, no false northing).
ConvergenceDeg double ° 0 Meridian convergence, deg: grid north minus true north, positive east of the central meridian (a true azimuth minus the convergence is the grid azimuth).
Scale double 1 Point scale factor.