GPS GNSS
Dependencies: Vector3
Diff: GPS_HAPS.cpp
- Revision:
- 5:f23265e8d4aa
- Parent:
- 4:708e05b10257
diff -r 708e05b10257 -r f23265e8d4aa GPS_HAPS.cpp --- a/GPS_HAPS.cpp Wed Sep 08 13:02:17 2021 +0000 +++ b/GPS_HAPS.cpp Wed Sep 08 13:21:55 2021 +0000 @@ -197,24 +197,16 @@ // pc.printf("Unknown message type\n"); // } } - -void GPS_HAPS::Punctuate() -{ -} void GPS_HAPS::Attach() { serial.attach(this, &GPS_HAPS::Receive, Serial::RxIrq); } -void GPS_HAPS::Update() -{ -} - void GPS_HAPS::Initialize() { Satellites = 0; - while (Satellites <= 4 || Latitude == 0.0f || Longitude == 0.0f || Elevation == 0.0f) + while (Satellites <= 4 || Latitude == 0.0f || Longitude == 0.0f || Altitude == 0.0f) { } CalculateUnit(); @@ -235,14 +227,14 @@ Vector3 GPS_HAPS::ToUniversal() { Vector3 v = ToUniversalUnit(); - return (Radius + Elevation) * v; + return (Radius + Altitude) * v; } void GPS_HAPS::CalculateUnit() { Vector3 _d = -1.0f * ToUniversalUnit(); - UniversalZeroPosition = -(Radius+Elevation)*_d; + UniversalZeroPosition = -(Radius+Altitude)*_d; Vector3 _z(0.0f, 0.0f, 1.0f); Vector3 _e = _d * _z; Vector3 _n = _e * _d;