|
QGroundControl
Ground Control Station for MAVLink Drones
|
Unit conversions and geodesy shared by receiver families and their callers. More...
Classes | |
| struct | Ecef |
Functions | |
| Ecef | toEcef (const GPSEllipsoidPosition &position) |
| GPSEllipsoidPosition | fromEcef (const Ecef &position) |
| bool | nearEarthSurface (const Ecef &position) |
| uint64_t | utcMicroseconds (int year, int month, int day, int hour, int minute, int second, int32_t nsec) |
| constexpr double | degreesFromE7 (int32_t value) |
| Degrees of a coordinate in 1e-7 degree units, as u-blox and MAVLink send them. | |
| constexpr double | metersFromMillimeters (int32_t value) |
| double | roundedToMillimeters (double meters) |
| meters rounded to whole millimetres. | |
| std::optional< uint32_t > | tenthMillimeters (double meters) |
| meters in 0.1 mm, truncated toward zero. Empty when not finite, negative or beyond a 32-bit unsigned field. | |
| double | distance (const Ecef &left, const Ecef &right) |
| Straight-line distance between left and right, in metres. | |
Variables | |
| constexpr double | DEG_TO_RAD = std::numbers::pi / 180.0 |
| constexpr double | RAD_TO_DEG = 180.0 / std::numbers::pi |
| constexpr time_t | UTC_PLAUSIBILITY_FLOOR_SECS = static_cast<time_t>(1234567890ULL) |
| Receiver dates before this instant (2009-02-13) are implausible and reported as unknown. | |
Unit conversions and geodesy shared by receiver families and their callers.
|
constexpr |
Degrees of a coordinate in 1e-7 degree units, as u-blox and MAVLink send them.
Definition at line 23 of file GPSProtocolMath.h.
Referenced by UBX::coordinateDegrees(), and NTRIPVehicleGgaSource::setVehicle().
Straight-line distance between left and right, in metres.
Definition at line 60 of file GPSProtocolMath.h.
References GPSProtocolMath::Ecef::x, GPSProtocolMath::Ecef::y, and GPSProtocolMath::Ecef::z.
| GPSEllipsoidPosition GPSProtocolMath::fromEcef | ( | const Ecef & | position | ) |
Definition at line 22 of file GPSProtocolMath.cc.
References GPSEllipsoidPosition::altitudeMeters, height, GPSEllipsoidPosition::latitudeDegrees, and GPSEllipsoidPosition::longitudeDegrees.
|
constexpr |
Definition at line 28 of file GPSProtocolMath.h.
Referenced by NTRIPVehicleGgaSource::setVehicle().
| bool GPSProtocolMath::nearEarthSurface | ( | const Ecef & | position | ) |
Whether position lies 6000 to 7000 km from the Earth's centre, as a receiver's coordinates do; false for the zero or unknown coordinates of an unset base.
Definition at line 32 of file GPSProtocolMath.cc.
|
inline |
meters rounded to whole millimetres.
Definition at line 34 of file GPSProtocolMath.h.
|
inline |
meters in 0.1 mm, truncated toward zero. Empty when not finite, negative or beyond a 32-bit unsigned field.
Definition at line 40 of file GPSProtocolMath.h.
Referenced by gpsValidateBaseStationConfig().
| Ecef GPSProtocolMath::toEcef | ( | const GPSEllipsoidPosition & | position | ) |
Definition at line 14 of file GPSProtocolMath.cc.
References GPSProtocolMath::Ecef::x, GPSProtocolMath::Ecef::y, and GPSProtocolMath::Ecef::z.
| uint64_t GPSProtocolMath::utcMicroseconds | ( | int | year, |
| int | month, | ||
| int | day, | ||
| int | hour, | ||
| int | minute, | ||
| int | second, | ||
| int32_t | nsec | ||
| ) |
Microseconds since the Unix epoch of a receiver's UTC calendar fields plus nsec, which may be negative. Fields beyond their range carry into the next larger unit, as a leap second's 60 does. 0 when the date is implausible or beyond the platform's time_t.
Definition at line 38 of file GPSProtocolMath.cc.
References UTC_PLAUSIBILITY_FLOOR_SECS.
|
inlineconstexpr |
Definition at line 17 of file GPSProtocolMath.h.
|
inlineconstexpr |
Definition at line 18 of file GPSProtocolMath.h.
|
inlineconstexpr |
Receiver dates before this instant (2009-02-13) are implausible and reported as unknown.
Definition at line 20 of file GPSProtocolMath.h.
Referenced by utcMicroseconds().