APM:Libraries
|
#include <AP_Proximity.h>
Classes | |
struct | Proximity_Distance_Array |
struct | Proximity_State |
Public Types | |
enum | Proximity_Type { Proximity_Type_None = 0, Proximity_Type_SF40C = 1, Proximity_Type_MAV = 2, Proximity_Type_TRTOWER = 3, Proximity_Type_RangeFinder = 4, Proximity_Type_RPLidarA2 = 5, Proximity_Type_SITL = 10 } |
enum | Proximity_Status { Proximity_NotConnected = 0, Proximity_NoData, Proximity_Good } |
Public Member Functions | |
AP_Proximity (AP_SerialManager &_serial_manager) | |
AP_Proximity (const AP_Proximity &other)=delete | |
AP_Proximity & | operator= (const AP_Proximity)=delete |
void | init (void) |
void | update (void) |
void | set_rangefinder (const RangeFinder *rangefinder) |
const RangeFinder * | get_rangefinder () const |
uint8_t | get_orientation (uint8_t instance) const |
int16_t | get_yaw_correction (uint8_t instance) const |
Proximity_Status | get_status (uint8_t instance) const |
Proximity_Status | get_status () const |
uint8_t | num_sensors (void) const |
bool | get_horizontal_distance (uint8_t instance, float angle_deg, float &distance) const |
bool | get_horizontal_distance (float angle_deg, float &distance) const |
bool | get_horizontal_distances (Proximity_Distance_Array &prx_dist_array) const |
const Vector2f * | get_boundary_points (uint8_t instance, uint16_t &num_points) const |
const Vector2f * | get_boundary_points (uint16_t &num_points) const |
bool | get_closest_object (float &angle_deg, float &distance) const |
uint8_t | get_object_count () const |
bool | get_object_angle_and_distance (uint8_t object_number, float &angle_deg, float &distance) const |
float | distance_max () const |
float | distance_min () const |
void | handle_msg (mavlink_message_t *msg) |
bool | get_upward_distance (uint8_t instance, float &distance) const |
bool | get_upward_distance (float &distance) const |
Proximity_Type | get_type (uint8_t instance) const |
Static Public Member Functions | |
static AP_Proximity * | get_singleton (void) |
Static Public Attributes | |
static const struct AP_Param::GroupInfo | var_info [] |
Private Member Functions | |
void | detect_instance (uint8_t instance) |
void | update_instance (uint8_t instance) |
Private Attributes | |
Proximity_State | state [PROXIMITY_MAX_INSTANCES] |
AP_Proximity_Backend * | drivers [PROXIMITY_MAX_INSTANCES] |
const RangeFinder * | _rangefinder |
uint8_t | primary_instance:3 |
uint8_t | num_instances:3 |
AP_SerialManager & | serial_manager |
AP_Int8 | _type [PROXIMITY_MAX_INSTANCES] |
AP_Int8 | _orientation [PROXIMITY_MAX_INSTANCES] |
AP_Int16 | _yaw_correction [PROXIMITY_MAX_INSTANCES] |
AP_Int16 | _ignore_angle_deg [PROXIMITY_MAX_IGNORE] |
AP_Int8 | _ignore_width_deg [PROXIMITY_MAX_IGNORE] |
Static Private Attributes | |
static AP_Proximity * | _singleton |
Friends | |
class | AP_Proximity_Backend |
Definition at line 32 of file AP_Proximity.h.
Enumerator | |
---|---|
Proximity_NotConnected | |
Proximity_NoData | |
Proximity_Good |
Definition at line 53 of file AP_Proximity.h.
Enumerator | |
---|---|
Proximity_Type_None | |
Proximity_Type_SF40C | |
Proximity_Type_MAV | |
Proximity_Type_TRTOWER | |
Proximity_Type_RangeFinder | |
Proximity_Type_RPLidarA2 | |
Proximity_Type_SITL |
Definition at line 43 of file AP_Proximity.h.
AP_Proximity::AP_Proximity | ( | AP_SerialManager & | _serial_manager | ) |
|
delete |
|
private |
Definition at line 279 of file AP_Proximity.cpp.
Referenced by init().
float AP_Proximity::distance_max | ( | ) | const |
Definition at line 400 of file AP_Proximity.cpp.
Referenced by num_sensors(), and GCS_MAVLINK::send_proximity().
float AP_Proximity::distance_min | ( | ) | const |
Definition at line 408 of file AP_Proximity.cpp.
Referenced by num_sensors(), and GCS_MAVLINK::send_proximity().
const Vector2f * AP_Proximity::get_boundary_points | ( | uint8_t | instance, |
uint16_t & | num_points | ||
) | const |
Definition at line 352 of file AP_Proximity.cpp.
Referenced by AC_Avoid::adjust_velocity_proximity(), get_boundary_points(), and num_sensors().
const Vector2f * AP_Proximity::get_boundary_points | ( | uint16_t & | num_points | ) | const |
bool AP_Proximity::get_closest_object | ( | float & | angle_deg, |
float & | distance | ||
) | const |
Definition at line 369 of file AP_Proximity.cpp.
Referenced by DataFlash_Class::Log_Write_Proximity(), and num_sensors().
bool AP_Proximity::get_horizontal_distance | ( | uint8_t | instance, |
float | angle_deg, | ||
float & | distance | ||
) | const |
Definition at line 324 of file AP_Proximity.cpp.
Referenced by get_horizontal_distance(), and num_sensors().
bool AP_Proximity::get_horizontal_distance | ( | float | angle_deg, |
float & | distance | ||
) | const |
bool AP_Proximity::get_horizontal_distances | ( | Proximity_Distance_Array & | prx_dist_array | ) | const |
Definition at line 341 of file AP_Proximity.cpp.
Referenced by DataFlash_Class::Log_Write_Proximity(), num_sensors(), and GCS_MAVLINK::send_proximity().
bool AP_Proximity::get_object_angle_and_distance | ( | uint8_t | object_number, |
float & | angle_deg, | ||
float & | distance | ||
) | const |
Definition at line 390 of file AP_Proximity.cpp.
Referenced by AC_Avoid::get_proximity_roll_pitch_pct(), and num_sensors().
uint8_t AP_Proximity::get_object_count | ( | ) | const |
Definition at line 379 of file AP_Proximity.cpp.
Referenced by AC_Avoid::get_proximity_roll_pitch_pct(), and num_sensors().
uint8_t AP_Proximity::get_orientation | ( | uint8_t | instance | ) | const |
Definition at line 233 of file AP_Proximity.cpp.
Referenced by get_rangefinder(), and AP_Proximity_LightWareSF40C::set_motor_direction().
|
inline |
Definition at line 73 of file AP_Proximity.h.
Referenced by AP_Proximity_RangeFinder::update().
|
inlinestatic |
Definition at line 135 of file AP_Proximity.h.
Referenced by GCS_MAVLINK::send_distance_sensor(), and GCS_MAVLINK::send_proximity().
AP_Proximity::Proximity_Status AP_Proximity::get_status | ( | uint8_t | instance | ) | const |
Definition at line 253 of file AP_Proximity.cpp.
Referenced by AC_Avoid::adjust_velocity_proximity(), AC_Avoid::get_proximity_roll_pitch_pct(), DataFlash_Class::Log_Write_Proximity(), and GCS_MAVLINK::send_proximity().
AP_Proximity::Proximity_Status AP_Proximity::get_status | ( | void | ) | const |
Definition at line 263 of file AP_Proximity.cpp.
Referenced by get_rangefinder().
AP_Proximity::Proximity_Type AP_Proximity::get_type | ( | uint8_t | instance | ) | const |
Definition at line 432 of file AP_Proximity.cpp.
Referenced by GCS_MAVLINK::send_distance_sensor().
bool AP_Proximity::get_upward_distance | ( | uint8_t | instance, |
float & | distance | ||
) | const |
Definition at line 418 of file AP_Proximity.cpp.
Referenced by AC_Avoid::adjust_velocity_z(), get_upward_distance(), DataFlash_Class::Log_Write_Proximity(), and GCS_MAVLINK::send_proximity().
bool AP_Proximity::get_upward_distance | ( | float & | distance | ) | const |
int16_t AP_Proximity::get_yaw_correction | ( | uint8_t | instance | ) | const |
Definition at line 243 of file AP_Proximity.cpp.
Referenced by get_rangefinder(), AP_Proximity_LightWareSF40C::initialise(), and AP_Proximity_LightWareSF40C::set_forward_direction().
void AP_Proximity::handle_msg | ( | mavlink_message_t * | msg | ) |
Definition at line 269 of file AP_Proximity.cpp.
Referenced by num_sensors().
void AP_Proximity::init | ( | void | ) |
|
inline |
Definition at line 84 of file AP_Proximity.h.
Referenced by GCS_MAVLINK::send_distance_sensor().
|
delete |
|
inline |
Definition at line 72 of file AP_Proximity.h.
void AP_Proximity::update | ( | void | ) |
|
private |
|
friend |
Definition at line 35 of file AP_Proximity.h.
|
private |
Definition at line 150 of file AP_Proximity.h.
Referenced by AP_Proximity_Backend::get_ignore_area(), and AP_Proximity_Backend::get_next_ignore_start_or_end().
|
private |
Definition at line 151 of file AP_Proximity.h.
Referenced by AP_Proximity_Backend::get_ignore_area(), AP_Proximity_Backend::get_ignore_area_count(), and AP_Proximity_Backend::get_next_ignore_start_or_end().
|
private |
Definition at line 148 of file AP_Proximity.h.
Referenced by get_orientation().
|
private |
Definition at line 141 of file AP_Proximity.h.
Referenced by get_rangefinder(), and set_rangefinder().
|
staticprivate |
Definition at line 135 of file AP_Proximity.h.
Referenced by AP_Proximity(), get_singleton(), and get_type().
|
private |
Definition at line 147 of file AP_Proximity.h.
Referenced by detect_instance(), distance_max(), distance_min(), get_boundary_points(), get_closest_object(), get_horizontal_distance(), get_horizontal_distances(), get_object_angle_and_distance(), get_object_count(), get_type(), get_upward_distance(), handle_msg(), and update().
|
private |
Definition at line 149 of file AP_Proximity.h.
Referenced by get_yaw_correction().
|
private |
Definition at line 140 of file AP_Proximity.h.
Referenced by detect_instance(), distance_max(), distance_min(), get_boundary_points(), get_closest_object(), get_horizontal_distance(), get_horizontal_distances(), get_object_angle_and_distance(), get_object_count(), get_upward_distance(), handle_msg(), init(), and update().
|
private |
Definition at line 143 of file AP_Proximity.h.
Referenced by get_status(), handle_msg(), init(), num_sensors(), and update().
|
private |
Definition at line 142 of file AP_Proximity.h.
Referenced by distance_max(), distance_min(), get_boundary_points(), get_closest_object(), get_horizontal_distance(), get_horizontal_distances(), get_object_angle_and_distance(), get_object_count(), get_status(), get_upward_distance(), and update().
|
private |
Definition at line 144 of file AP_Proximity.h.
Referenced by detect_instance().
|
private |
Definition at line 139 of file AP_Proximity.h.
Referenced by detect_instance(), get_status(), init(), and update().
|
static |
Definition at line 133 of file AP_Proximity.h.
Referenced by AP_Proximity().