Resurgence (PY2022)
Codebase for the Husky Robotics 2021-2022 rover Resurgence
Loading...
Searching...
No Matches
gps_util.h
1#pragma once
2
3#include "../navtypes.h"
4
9class GPSDatum {
10public:
11 static const GPSDatum WGS84;
12
19 GPSDatum(double a, double b);
20
22 double getA() const;
23
25 double getB() const;
26
28 double getFlattening() const;
29
31 double getSquareEccentricity() const;
32
33private:
34 const double a;
35 const double b;
36};
37
44public:
51 GPSToMetersConverter(const GPSDatum& datum, const navtypes::gpscoords_t& origin);
52
54 navtypes::point_t gpsToMeters(const navtypes::gpscoords_t& coords) const;
55
57 navtypes::gpscoords_t metersToGPS(const navtypes::point_t& pos) const;
58
63 double getMetersPerDegLat() const;
64
69 double getMetersPerDegLon() const;
70
71private:
72 const GPSDatum datum;
73 const navtypes::gpscoords_t origin;
74 double metersPerDegLat;
75 double metersPerDegLon;
76};
A GPS datum that specifies the reference ellipsoid for use in GPS calculations.
Definition gps_util.h:9
double getFlattening() const
Get the flattening parameter of the reference ellipsoid.
Definition gps_util.cpp:32
double getSquareEccentricity() const
Get the square of the (first) eccentricity of the ellipsoid.
Definition gps_util.cpp:36
static const GPSDatum WGS84
Reference links: https://en.wikipedia.org/wiki/Geodetic_datum#Earth_reference_ellipsoid https://en....
Definition gps_util.h:11
double getA() const
Get the semi-major axis of the reference ellipsoid.
Definition gps_util.cpp:24
GPSDatum(double a, double b)
Construct a new GPSDatum object, with the specified parameters for the ellipsoid.
Definition gps_util.cpp:22
double getB() const
Get the semi-minor axis of the reference ellipsoid.
Definition gps_util.cpp:28
double getMetersPerDegLon() const
Get the number of meters per degree of longitude.
Definition gps_util.cpp:69
navtypes::gpscoords_t metersToGPS(const navtypes::point_t &pos) const
convert a coordinate on the xy-plane to a gps coordinate
Definition gps_util.cpp:62
navtypes::point_t gpsToMeters(const navtypes::gpscoords_t &coords) const
convert the given gps coordinates to a coordinate on the xy plane, in meters
Definition gps_util.cpp:55
double getMetersPerDegLat() const
Get the number of meters per degree of latitude.
Definition gps_util.cpp:73
GPSToMetersConverter(const GPSDatum &datum, const navtypes::gpscoords_t &origin)
Construct a new GPSToMetersConverter object.
Definition gps_util.cpp:40
Represents a GPS coordinate in degrees.
Definition navtypes.h:10