2016-04-19 18:32:17 -03:00
|
|
|
#pragma once
|
|
|
|
|
2019-11-10 22:47:38 -04:00
|
|
|
#include "AP_RangeFinder.h"
|
|
|
|
#include "AP_RangeFinder_Backend_Serial.h"
|
2016-04-19 18:32:17 -03:00
|
|
|
|
2019-11-01 03:29:03 -03:00
|
|
|
class AP_RangeFinder_MaxsonarSerialLV : public AP_RangeFinder_Backend_Serial
|
2016-04-19 18:32:17 -03:00
|
|
|
{
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
2022-01-12 22:48:24 -04:00
|
|
|
AP_RangeFinder_MaxsonarSerialLV(RangeFinder::RangeFinder_State &_state, AP_RangeFinder_Params &_params);
|
2019-11-01 04:03:17 -03:00
|
|
|
|
2017-08-08 04:32:53 -03:00
|
|
|
protected:
|
|
|
|
|
|
|
|
MAV_DISTANCE_SENSOR _get_mav_distance_sensor_type() const override {
|
|
|
|
return MAV_DISTANCE_SENSOR_ULTRASOUND;
|
|
|
|
}
|
|
|
|
|
2016-04-19 18:32:17 -03:00
|
|
|
private:
|
|
|
|
// get a reading
|
2021-10-18 02:45:33 -03:00
|
|
|
bool get_reading(float &reading_m) override;
|
2016-04-19 18:32:17 -03:00
|
|
|
|
2019-11-01 08:00:04 -03:00
|
|
|
uint16_t read_timeout_ms() const override { return 500; }
|
|
|
|
|
2016-04-19 18:32:17 -03:00
|
|
|
char linebuf[10];
|
|
|
|
uint8_t linebuf_len = 0;
|
|
|
|
};
|