#ifndef _DEPTHSENSOR_H
#define _DEPTHSENSOR_H

#include "NavSensor.h"
#include "DepthSensorIF.h"

/*
CLASS 
DepthSensor

DESCRIPTION
Depth NavSensor

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

public:

  DepthSensor(const char *name, NavSensors *sensors, int maxBad = 5, double badDepthThresh = 10.0);

  ///////////////////////////////////////////////////////////////////
  // Latest depth
  double depth();

protected:

  virtual TaskInterface *createTaskIF(int timeout);

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

  double _depth;
  double _badDepthThresh; // Max acceptable depth change per sample period

  int    _badCount; // Used to filter depth outliers

  DepthSensorIF *_depthSensorIF;
};


#endif

