2016-02-17 21:25:44 -04:00
|
|
|
#pragma once
|
2013-02-28 20:19:02 -04:00
|
|
|
|
|
|
|
#include "RangeFinder.h"
|
2014-06-26 23:57:28 -03:00
|
|
|
#include "RangeFinder_Backend.h"
|
2013-02-28 20:19:02 -04:00
|
|
|
|
2014-06-26 23:57:28 -03:00
|
|
|
class AP_RangeFinder_analog : public AP_RangeFinder_Backend
|
2013-02-28 20:19:02 -04:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
// constructor
|
2017-08-07 00:41:01 -03:00
|
|
|
AP_RangeFinder_analog(RangeFinder::RangeFinder_State &_state);
|
2013-02-28 20:19:02 -04:00
|
|
|
|
2014-06-26 23:57:28 -03:00
|
|
|
// static detection function
|
2017-08-07 00:41:01 -03:00
|
|
|
static bool detect(RangeFinder::RangeFinder_State &_state);
|
2013-02-28 20:19:02 -04:00
|
|
|
|
2014-06-26 23:57:28 -03:00
|
|
|
// update state
|
2018-11-07 07:01:51 -04:00
|
|
|
void update(void) override;
|
2013-02-28 20:19:02 -04:00
|
|
|
|
2017-08-08 04:32:53 -03:00
|
|
|
protected:
|
|
|
|
|
|
|
|
MAV_DISTANCE_SENSOR _get_mav_distance_sensor_type() const override {
|
|
|
|
return MAV_DISTANCE_SENSOR_UNKNOWN;
|
|
|
|
}
|
|
|
|
|
2013-02-28 20:19:02 -04:00
|
|
|
private:
|
2014-06-26 23:57:28 -03:00
|
|
|
// update raw voltage
|
|
|
|
void update_voltage(void);
|
|
|
|
|
|
|
|
AP_HAL::AnalogSource *source;
|
2013-02-28 20:19:02 -04:00
|
|
|
};
|