APM:Libraries
AP_RangeFinder_Benewake.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 
14  };
15 
16  // constructor
19  uint8_t serial_instance,
20  benewake_model_type model);
21 
22  // static detection function
23  static bool detect(AP_SerialManager &serial_manager, uint8_t serial_instance);
24 
25  // update state
26  void update(void);
27 
28 protected:
29 
30  virtual MAV_DISTANCE_SENSOR _get_mav_distance_sensor_type() const override {
31  return MAV_DISTANCE_SENSOR_LASER;
32  }
33 
34 private:
35 
36  // get a reading
37  // distance returned in reading_cm, signal_ok is set to true if sensor reports a strong signal
38  bool get_reading(uint16_t &reading_cm, bool &signal_ok);
39 
42  uint32_t last_reading_ms;
43  char linebuf[10];
44  uint8_t linebuf_len;
45 };
static AP_SerialManager serial_manager
Definition: AHRS_Test.cpp:24
AP_RangeFinder_Benewake(RangeFinder::RangeFinder_State &_state, AP_SerialManager &serial_manager, uint8_t serial_instance, benewake_model_type model)
static bool detect(AP_SerialManager &serial_manager, uint8_t serial_instance)
benewake_model_type model_type
bool get_reading(uint16_t &reading_cm, bool &signal_ok)
virtual MAV_DISTANCE_SENSOR _get_mav_distance_sensor_type() const override