APM:Libraries
|
#include <RangeFinder.h>
Classes | |
struct | RangeFinder_State |
Public Types | |
enum | RangeFinder_Type { RangeFinder_TYPE_NONE = 0, RangeFinder_TYPE_ANALOG = 1, RangeFinder_TYPE_MBI2C = 2, RangeFinder_TYPE_PLI2C = 3, RangeFinder_TYPE_PX4 = 4, RangeFinder_TYPE_PX4_PWM = 5, RangeFinder_TYPE_BBB_PRU = 6, RangeFinder_TYPE_LWI2C = 7, RangeFinder_TYPE_LWSER = 8, RangeFinder_TYPE_BEBOP = 9, RangeFinder_TYPE_MAVLink = 10, RangeFinder_TYPE_ULANDING = 11, RangeFinder_TYPE_LEDDARONE = 12, RangeFinder_TYPE_MBSER = 13, RangeFinder_TYPE_TRI2C = 14, RangeFinder_TYPE_PLI2CV3 = 15, RangeFinder_TYPE_VL53L0X = 16, RangeFinder_TYPE_NMEA = 17, RangeFinder_TYPE_WASP = 18, RangeFinder_TYPE_BenewakeTF02 = 19, RangeFinder_TYPE_BenewakeTFmini = 20 } |
enum | RangeFinder_Function { FUNCTION_LINEAR = 0, FUNCTION_INVERTED = 1, FUNCTION_HYPERBOLA = 2 } |
enum | RangeFinder_Status { RangeFinder_NotConnected = 0, RangeFinder_NoData, RangeFinder_OutOfRangeLow, RangeFinder_OutOfRangeHigh, RangeFinder_Good } |
Public Member Functions | |
RangeFinder (AP_SerialManager &_serial_manager, enum Rotation orientation_default) | |
RangeFinder (const RangeFinder &other)=delete | |
RangeFinder & | operator= (const RangeFinder &)=delete |
uint8_t | num_sensors (void) const |
void | init (void) |
void | update (void) |
void | handle_msg (mavlink_message_t *msg) |
bool | has_orientation (enum Rotation orientation) const |
AP_RangeFinder_Backend * | find_instance (enum Rotation orientation) const |
AP_RangeFinder_Backend * | get_backend (uint8_t id) const |
uint16_t | distance_cm_orient (enum Rotation orientation) const |
uint16_t | voltage_mv_orient (enum Rotation orientation) const |
int16_t | max_distance_cm_orient (enum Rotation orientation) const |
int16_t | min_distance_cm_orient (enum Rotation orientation) const |
int16_t | ground_clearance_cm_orient (enum Rotation orientation) const |
MAV_DISTANCE_SENSOR | get_mav_distance_sensor_type_orient (enum Rotation orientation) const |
RangeFinder_Status | status_orient (enum Rotation orientation) const |
bool | has_data_orient (enum Rotation orientation) const |
uint8_t | range_valid_count_orient (enum Rotation orientation) const |
const Vector3f & | get_pos_offset_orient (enum Rotation orientation) const |
void | set_estimated_terrain_height (float height) |
bool | pre_arm_check () const |
Static Public Member Functions | |
static RangeFinder * | get_singleton (void) |
Public Attributes | |
AP_Int16 | _powersave_range |
Static Public Attributes | |
static const struct AP_Param::GroupInfo * | backend_var_info [RANGEFINDER_MAX_INSTANCES] |
static const struct AP_Param::GroupInfo | var_info [] |
Private Member Functions | |
void | detect_instance (uint8_t instance, uint8_t &serial_instance) |
void | update_instance (uint8_t instance) |
bool | _add_backend (AP_RangeFinder_Backend *driver) |
Private Attributes | |
RangeFinder_State | state [RANGEFINDER_MAX_INSTANCES] |
AP_RangeFinder_Backend * | drivers [RANGEFINDER_MAX_INSTANCES] |
uint8_t | num_instances:3 |
float | estimated_terrain_height |
AP_SerialManager & | serial_manager |
Vector3f | pos_offset_zero |
Static Private Attributes | |
static RangeFinder * | _singleton |
Friends | |
class | AP_RangeFinder_Backend |
Definition at line 31 of file RangeFinder.h.
Enumerator | |
---|---|
FUNCTION_LINEAR | |
FUNCTION_INVERTED | |
FUNCTION_HYPERBOLA |
Definition at line 67 of file RangeFinder.h.
Enumerator | |
---|---|
RangeFinder_NotConnected | |
RangeFinder_NoData | |
RangeFinder_OutOfRangeLow | |
RangeFinder_OutOfRangeHigh | |
RangeFinder_Good |
Definition at line 73 of file RangeFinder.h.
Definition at line 43 of file RangeFinder.h.
RangeFinder::RangeFinder | ( | AP_SerialManager & | _serial_manager, |
enum Rotation | orientation_default | ||
) |
|
delete |
|
private |
Definition at line 624 of file RangeFinder.cpp.
Referenced by detect_instance().
|
private |
Definition at line 640 of file RangeFinder.cpp.
Referenced by init().
uint16_t RangeFinder::distance_cm_orient | ( | enum Rotation | orientation | ) | const |
Definition at line 825 of file RangeFinder.cpp.
Referenced by AP_Frsky_Telem::calc_attiandrng(), and num_sensors().
AP_RangeFinder_Backend * RangeFinder::find_instance | ( | enum Rotation | orientation | ) | const |
Definition at line 810 of file RangeFinder.cpp.
Referenced by distance_cm_orient(), get_mav_distance_sensor_type_orient(), get_pos_offset_orient(), ground_clearance_cm_orient(), has_data_orient(), has_orientation(), max_distance_cm_orient(), min_distance_cm_orient(), num_sensors(), range_valid_count_orient(), GCS_MAVLINK::send_rangefinder_downward(), status_orient(), and voltage_mv_orient().
AP_RangeFinder_Backend * RangeFinder::get_backend | ( | uint8_t | id | ) | const |
Definition at line 771 of file RangeFinder.cpp.
Referenced by find_instance(), DataFlash_Class::Log_Write_RFND(), loop(), num_sensors(), NavEKF2_core::readRangeFinder(), NavEKF3_core::readRangeFinder(), NavEKF2_core::selectHeightForFusion(), NavEKF3_core::selectHeightForFusion(), GCS_MAVLINK::send_distance_sensor(), and AP_Proximity_RangeFinder::update().
MAV_DISTANCE_SENSOR RangeFinder::get_mav_distance_sensor_type_orient | ( | enum Rotation | orientation | ) | const |
Definition at line 913 of file RangeFinder.cpp.
Referenced by num_sensors().
Definition at line 904 of file RangeFinder.cpp.
Referenced by num_sensors().
|
inlinestatic |
Definition at line 167 of file RangeFinder.h.
Referenced by GCS_MAVLINK::send_distance_sensor(), and GCS_MAVLINK::send_rangefinder_downward().
int16_t RangeFinder::ground_clearance_cm_orient | ( | enum Rotation | orientation | ) | const |
Definition at line 861 of file RangeFinder.cpp.
Referenced by num_sensors(), NavEKF2_core::readRangeFinder(), and NavEKF3_core::readRangeFinder().
void RangeFinder::handle_msg | ( | mavlink_message_t * | msg | ) |
Definition at line 793 of file RangeFinder.cpp.
Referenced by num_sensors().
bool RangeFinder::has_data_orient | ( | enum Rotation | orientation | ) | const |
Definition at line 870 of file RangeFinder.cpp.
Referenced by num_sensors().
bool RangeFinder::has_orientation | ( | enum Rotation | orientation | ) | const |
Definition at line 804 of file RangeFinder.cpp.
Referenced by num_sensors().
void RangeFinder::init | ( | void | ) |
Definition at line 578 of file RangeFinder.cpp.
Referenced by num_sensors(), and setup().
int16_t RangeFinder::max_distance_cm_orient | ( | enum Rotation | orientation | ) | const |
Definition at line 843 of file RangeFinder.cpp.
Referenced by NavEKF2_core::getHeightControlLimit(), NavEKF3_core::getHeightControlLimit(), num_sensors(), NavEKF2_core::selectHeightForFusion(), and NavEKF3_core::selectHeightForFusion().
int16_t RangeFinder::min_distance_cm_orient | ( | enum Rotation | orientation | ) | const |
Definition at line 852 of file RangeFinder.cpp.
Referenced by num_sensors().
|
inline |
Definition at line 117 of file RangeFinder.h.
Referenced by loop(), setup(), and AP_Proximity_RangeFinder::update().
|
delete |
bool RangeFinder::pre_arm_check | ( | ) | const |
Definition at line 893 of file RangeFinder.cpp.
uint8_t RangeFinder::range_valid_count_orient | ( | enum Rotation | orientation | ) | const |
Definition at line 879 of file RangeFinder.cpp.
Referenced by num_sensors().
|
inline |
Definition at line 156 of file RangeFinder.h.
RangeFinder::RangeFinder_Status RangeFinder::status_orient | ( | enum Rotation | orientation | ) | const |
Definition at line 784 of file RangeFinder.cpp.
Referenced by num_sensors().
void RangeFinder::update | ( | void | ) |
Definition at line 608 of file RangeFinder.cpp.
Referenced by loop(), and num_sensors().
|
private |
uint16_t RangeFinder::voltage_mv_orient | ( | enum Rotation | orientation | ) | const |
Definition at line 834 of file RangeFinder.cpp.
Referenced by num_sensors().
|
friend |
Definition at line 33 of file RangeFinder.h.
AP_Int16 RangeFinder::_powersave_range |
Definition at line 111 of file RangeFinder.h.
Referenced by detect_instance().
|
staticprivate |
Definition at line 171 of file RangeFinder.h.
Referenced by get_mav_distance_sensor_type_orient(), get_singleton(), and RangeFinder().
|
static |
Definition at line 109 of file RangeFinder.h.
Referenced by detect_instance().
|
private |
Definition at line 174 of file RangeFinder.h.
Referenced by _add_backend(), detect_instance(), get_backend(), handle_msg(), init(), pre_arm_check(), and update().
|
private |
Definition at line 176 of file RangeFinder.h.
Referenced by detect_instance(), and set_estimated_terrain_height().
|
private |
Definition at line 175 of file RangeFinder.h.
Referenced by _add_backend(), find_instance(), get_backend(), handle_msg(), init(), num_sensors(), pre_arm_check(), and update().
|
private |
Definition at line 178 of file RangeFinder.h.
Referenced by get_pos_offset_orient().
|
private |
Definition at line 177 of file RangeFinder.h.
Referenced by detect_instance().
|
private |
Definition at line 173 of file RangeFinder.h.
Referenced by detect_instance(), handle_msg(), init(), pre_arm_check(), RangeFinder(), and update().
|
static |
Definition at line 114 of file RangeFinder.h.
Referenced by detect_instance(), RangeFinder(), and setup().