APM:Libraries
AP_RangeFinder_MaxsonarSerialLV.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "RangeFinder.h"
4 #include "RangeFinder_Backend.h"
5 
7 {
8 
9 public:
10  // constructor
13  uint8_t serial_instance);
14 
15  // static detection function
16  static bool detect(AP_SerialManager &serial_manager, uint8_t serial_instance);
17 
18  // update state
19  void update(void);
20 
21 protected:
22 
23  MAV_DISTANCE_SENSOR _get_mav_distance_sensor_type() const override {
24  return MAV_DISTANCE_SENSOR_ULTRASOUND;
25  }
26 
27 private:
28  // get a reading
29  bool get_reading(uint16_t &reading_cm);
30 
32  uint32_t last_reading_ms = 0;
33  char linebuf[10];
34  uint8_t linebuf_len = 0;
35 };
static AP_SerialManager serial_manager
Definition: AHRS_Test.cpp:24
static bool detect(AP_SerialManager &serial_manager, uint8_t serial_instance)
AP_RangeFinder_MaxsonarSerialLV(RangeFinder::RangeFinder_State &_state, AP_SerialManager &serial_manager, uint8_t serial_instance)
MAV_DISTANCE_SENSOR _get_mav_distance_sensor_type() const override