APM:Libraries
AP_RangeFinder_LightWareSerial.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  virtual MAV_DISTANCE_SENSOR _get_mav_distance_sensor_type() const override {
24  return MAV_DISTANCE_SENSOR_LASER;
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
AP_RangeFinder_LightWareSerial(RangeFinder::RangeFinder_State &_state, AP_SerialManager &serial_manager, uint8_t serial_instance)
static bool detect(AP_SerialManager &serial_manager, uint8_t serial_instance)
virtual MAV_DISTANCE_SENSOR _get_mav_distance_sensor_type() const override