APM:Libraries
AP_RangeFinder_uLanding.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_RADAR;
25  }
26 
27 private:
28  // detect uLanding Firmware Version
29  bool detect_version(void);
30 
31  // get a reading
32  bool get_reading(uint16_t &reading_cm);
33 
35  uint8_t _linebuf[6];
36  uint8_t _linebuf_len;
37  uint32_t _last_reading_ms;
39  uint8_t _header;
40  uint8_t _version;
41 };
static AP_SerialManager serial_manager
Definition: AHRS_Test.cpp:24
static bool detect(AP_SerialManager &serial_manager, uint8_t serial_instance)
AP_RangeFinder_uLanding(RangeFinder::RangeFinder_State &_state, AP_SerialManager &serial_manager, uint8_t serial_instance)
MAV_DISTANCE_SENSOR _get_mav_distance_sensor_type() const override
bool get_reading(uint16_t &reading_cm)