2016-02-17 21:25:44 -04:00
|
|
|
#pragma once
|
2015-09-07 02:32:06 -03:00
|
|
|
|
2019-11-10 22:47:38 -04:00
|
|
|
#include "AP_RangeFinder.h"
|
|
|
|
#include "AP_RangeFinder_Backend_Serial.h"
|
2015-09-07 02:32:06 -03:00
|
|
|
|
2019-11-01 03:12:26 -03:00
|
|
|
class AP_RangeFinder_LightWareSerial : public AP_RangeFinder_Backend_Serial
|
2015-09-07 02:32:06 -03:00
|
|
|
{
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
2019-11-01 03:12:26 -03:00
|
|
|
using AP_RangeFinder_Backend_Serial::AP_RangeFinder_Backend_Serial;
|
2015-09-07 02:32:06 -03:00
|
|
|
|
2017-08-08 04:32:53 -03:00
|
|
|
protected:
|
|
|
|
|
|
|
|
virtual MAV_DISTANCE_SENSOR _get_mav_distance_sensor_type() const override {
|
|
|
|
return MAV_DISTANCE_SENSOR_LASER;
|
|
|
|
}
|
|
|
|
|
2015-09-07 02:32:06 -03:00
|
|
|
private:
|
|
|
|
// get a reading
|
2019-11-01 07:59:50 -03:00
|
|
|
bool get_reading(uint16_t &reading_cm) override;
|
2015-09-07 02:32:06 -03:00
|
|
|
|
|
|
|
char linebuf[10];
|
|
|
|
uint8_t linebuf_len = 0;
|
2019-02-17 17:19:50 -04:00
|
|
|
uint32_t last_init_ms;
|
2015-09-07 02:32:06 -03:00
|
|
|
};
|