Geodetic coordinate utility header.
More...
Go to the source code of this file.
Geodetic coordinate utility header.
Projects GPS latitude/longitude onto a local cartesian plane so that planar geometry can be used on it.
- Author
- Amruth Nadimpally (nadim.nosp@m.paa@.nosp@m.purdu.nosp@m.e.ed.nosp@m.u)
-
Aditya Saini (saini.nosp@m.91@p.nosp@m.urdue.nosp@m..edu)
◆ geodetic_from_scaled()
| static geodetic_coord_t geodetic_from_scaled |
( |
const float | latitude, |
|
|
const float | longitude ) |
|
inlinestatic |
Build a coordinate from latitude and longitude already in degrees.
Callers must convert packed CAN / GPS fixed-point values into degrees before calling (for example with UNPACK_COEFF_GPS_COORDINATES_LATITUDE).
- Parameters
-
| latitude | Latitude in degrees |
| longitude | Longitude in degrees |
- Returns
- The coordinate in degrees.
◆ geodetic_to_local()
Project a coordinate onto a local east-north plane about an origin.
Equirectangular approximation: northing is proportional to latitude, and easting is compressed by the cosine of the origin latitude. Sub-meter accurate over the few kilometers a track spans, and linear, so straight lines stay straight and segment geometry remains valid.
- Parameters
-
| origin | The coordinate that maps to (0, 0) |
| coord | The coordinate to project |
- Returns
- East (x) and north (y) offset from the origin, in meters.
◆ METERS_PER_DEGREE
| float METERS_PER_DEGREE = 111132.0f |
|
staticconstexpr |