12 #include <gtest/gtest.h> 28 EXPECT_NEAR( c1.
lat,c2.
lat, 1e-8 );
29 EXPECT_NEAR( c1.
lon,c2.
lon, 1e-8 );
35 TEST(TopographyConversion, GeodeticToGeocentricToGeodetic )
48 gps_point.
lon = -4.475828390;
49 gps_point.
lat = 36.716411055;
53 gps_ref.
lon = -4.4789588283333330;
54 gps_ref.
lat = 36.714459075;
60 TPoint3D P_true(279.679067794,216.621954,9.34448);
61 EXPECT_NEAR(P.
x,P_true.
x, 3e-3);
62 EXPECT_NEAR(P.
y,P_true.
y, 3e-3);
63 EXPECT_NEAR(P.
z,P_true.
z, 3e-3);
68 const double A_height = 15.0;
69 gps_point2.
height += A_height;
73 EXPECT_NEAR(P.
x,0, 0.1e-3);
74 EXPECT_NEAR(P.
y,0, 0.1e-3);
75 EXPECT_NEAR(P.
z,A_height, 0.1e-3);
Classes for serialization, sockets, ini-file manipulation, streams, list of properties-values, timewatch, extensions to STL.
A set of geodetic coordinates: latitude, longitude and height, defined over a given geoid (typically...
double z
X,Y,Z coordinates.
void TOPO_IMPEXP geodeticToENU_WGS84(const TGeodeticCoords &in_coords, mrpt::math::TPoint3D &out_ENU_point, const TGeodeticCoords &in_coords_origin)
Coordinates transformation from longitude/latitude/height to ENU (East-North-Up) X/Y/Z coordinates Th...
void TOPO_IMPEXP geodeticToGeocentric(const TGeodeticCoords &in_coords, TGeocentricCoords &out_point, const TEllipsoid &ellip)
Coordinates transformation from longitude/latitude/height to geocentric X/Y/Z coordinates (with an sp...
A coordinate that is stored as a simple "decimal" angle in degrees, but can be retrieved/set in the f...
TEST(TopographyConversion, GeodeticToGeocentricToGeodetic)
This base provides a set of functions for maths stuff.
TCoords lon
Longitude (in degrees)
void TOPO_IMPEXP geocentricToGeodetic(const TGeocentricCoords &in_point, TGeodeticCoords &out_coords, const TEllipsoid &ellip=TEllipsoid::Ellipsoid_WGS84())
Coordinates transformation from geocentric X/Y/Z coordinates to longitude/latitude/height.
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
double height
Geodetic height (in meters)
This namespace provides topography helper functions, coordinate transformations.
TCoords lat
Latitude (in degrees)
void do_test_geodetic_geocentric(const TGeodeticCoords c1)