Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: Vector3
Revision 5:f23265e8d4aa, committed 2021-09-08
- Comitter:
- cocorlow
- Date:
- Wed Sep 08 13:21:55 2021 +0000
- Parent:
- 4:708e05b10257
- Commit message:
- Elevation -> Altitude
Changed in this revision
| GPS_HAPS.cpp | Show annotated file Show diff for this revision Revisions of this file |
| GPS_HAPS.hpp | Show annotated file Show diff for this revision Revisions of this file |
--- 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;
--- a/GPS_HAPS.hpp Wed Sep 08 13:02:17 2021 +0000
+++ b/GPS_HAPS.hpp Wed Sep 08 13:21:55 2021 +0000
@@ -43,17 +43,17 @@
static const float Radius = 6378136.6f;
void Receive();
- void Punctuate();
+ void Parse(char *cmd);
public:
// GPGGA
volatile int Quality;
volatile int Satellites;
volatile float HDOP;
- volatile float Elevation;
- volatile char UnitElevation;
- volatile float GeoidElevation;
- volatile char UnitGeoidElevation;
+ volatile float Altitude;
+ volatile char UnitAltitude;
+ volatile float GeoidAltitude;
+ volatile char UnitGeoidAltitude;
// GPRMC
volatile int Hours;
@@ -73,7 +73,6 @@
volatile float GeomagneticDeclination ;
volatile char GeomagneticE_W;
volatile char Mode;
- volatile float Altitude;
volatile int Time;
Vector3 UniversalZeroPosition;
@@ -86,9 +85,7 @@
GPS_HAPS(PinName tx, PinName rx, int baud);
void Attach();
- void Update();
void Loop();
- void Parse(char *cmd);
void Initialize();
Vector3 ToUniversalUnit();
Vector3 ToUniversal();