#ifndef _GPS_H
#define _GPS_H

#include "NavSensor.h"
#include "GpsIF.h"
#include "NavigationIF.h"

// Dummy value for now...
#define MaxGpsFixDepth 0.1

/*
CLASS 
Gps

DESCRIPTION
GPS NavSensor

AUTHOR
Tom O'Reilly
*/
class Gps : public NavSensor {

public:

  Gps(const char *name, NavSensors *sensors, 
      const NavigationIF::Position *position,
      double maxFixDepth,
      int maxBad = 3);

  /////////////////////////////////////////////////////////////////////
  // Latest Gps fix
  GpsIF::Fix fix;

protected:

  virtual TaskInterface *createTaskIF(int timeout);

  virtual DeviceIF::Status readTaskIF(Boolean *valid, 
				      TimeIF::TimeSpec *sampleTime);

  GpsIF *_gpsIF;

  /////////////////////////////////////////////////////////////////////
  // This position object reference is updated by Navigation.
  // We use it here to monitor depth; if we are deeper than _maxFixDepth, 
  // we don't try to get a GPS fix.
  const NavigationIF::Position *_position;

  // Maximum depth at which we can still get a GPS fix
  double _maxFixDepth;
};


#endif

