Browse Source

GPS: expose last_fix_time

master
Andrew Tridgell 13 years ago
parent
commit
4dff78b9c0
  1. 4
      libraries/AP_GPS/GPS.cpp
  2. 6
      libraries/AP_GPS/GPS.h

4
libraries/AP_GPS/GPS.cpp

@ -36,9 +36,9 @@ GPS::update(void) @@ -36,9 +36,9 @@ GPS::update(void)
if (_status == GPS_OK) {
// update our acceleration
float deltat = 1.0e-3 * (_idleTimer - _last_fix_time);
float deltat = 1.0e-3 * (_idleTimer - last_fix_time);
float deltav = 1.0e-2 * ((float)ground_speed - (float)_last_ground_speed);
_last_fix_time = _idleTimer;
last_fix_time = _idleTimer;
_last_ground_speed = ground_speed;
if (deltat > 2.0 || deltat == 0) {

6
libraries/AP_GPS/GPS.h

@ -113,6 +113,9 @@ public: @@ -113,6 +113,9 @@ public:
// our approximate linear acceleration in m/s/s
float acceleration(void) { return _acceleration; }
// the time we got our last fix in system milliseconds
uint32_t last_fix_time;
protected:
Stream *_port; ///< port the GPS is attached to
@ -173,9 +176,6 @@ private: @@ -173,9 +176,6 @@ private:
/// Our current status
GPS_Status _status;
// the time we got our last fix in system milliseconds
uint32_t _last_fix_time;
// previous ground speed in cm/s
uint32_t _last_ground_speed;

Loading…
Cancel
Save