APM:Libraries
Classes | Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | Static Private Attributes | Friends | List of all members
AP_Proximity Class Reference

#include <AP_Proximity.h>

Collaboration diagram for AP_Proximity:
[legend]

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_Proximityoperator= (const AP_Proximity)=delete
 
void init (void)
 
void update (void)
 
void set_rangefinder (const RangeFinder *rangefinder)
 
const RangeFinderget_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 Vector2fget_boundary_points (uint8_t instance, uint16_t &num_points) const
 
const Vector2fget_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_Proximityget_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_Backenddrivers [PROXIMITY_MAX_INSTANCES]
 
const RangeFinder_rangefinder
 
uint8_t primary_instance:3
 
uint8_t num_instances:3
 
AP_SerialManagerserial_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
 

Detailed Description

Definition at line 32 of file AP_Proximity.h.

Member Enumeration Documentation

◆ Proximity_Status

Enumerator
Proximity_NotConnected 
Proximity_NoData 
Proximity_Good 

Definition at line 53 of file AP_Proximity.h.

◆ Proximity_Type

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.

Constructor & Destructor Documentation

◆ AP_Proximity() [1/2]

AP_Proximity::AP_Proximity ( AP_SerialManager _serial_manager)

Definition at line 177 of file AP_Proximity.cpp.

Here is the call graph for this function:

◆ AP_Proximity() [2/2]

AP_Proximity::AP_Proximity ( const AP_Proximity other)
delete

Member Function Documentation

◆ detect_instance()

void AP_Proximity::detect_instance ( uint8_t  instance)
private

Definition at line 279 of file AP_Proximity.cpp.

Referenced by init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ distance_max()

float AP_Proximity::distance_max ( ) const

Definition at line 400 of file AP_Proximity.cpp.

Referenced by num_sensors(), and GCS_MAVLINK::send_proximity().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ distance_min()

float AP_Proximity::distance_min ( ) const

Definition at line 408 of file AP_Proximity.cpp.

Referenced by num_sensors(), and GCS_MAVLINK::send_proximity().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_boundary_points() [1/2]

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_boundary_points() [2/2]

const Vector2f * AP_Proximity::get_boundary_points ( uint16_t &  num_points) const

Definition at line 362 of file AP_Proximity.cpp.

Here is the call graph for this function:

◆ get_closest_object()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_horizontal_distance() [1/2]

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_horizontal_distance() [2/2]

bool AP_Proximity::get_horizontal_distance ( float  angle_deg,
float &  distance 
) const

Definition at line 335 of file AP_Proximity.cpp.

Here is the call graph for this function:

◆ get_horizontal_distances()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_object_angle_and_distance()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_object_count()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_orientation()

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().

Here is the caller graph for this function:

◆ get_rangefinder()

const RangeFinder* AP_Proximity::get_rangefinder ( ) const
inline

Definition at line 73 of file AP_Proximity.h.

Referenced by AP_Proximity_RangeFinder::update().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_singleton()

static AP_Proximity* AP_Proximity::get_singleton ( void  )
inlinestatic

Definition at line 135 of file AP_Proximity.h.

Referenced by GCS_MAVLINK::send_distance_sensor(), and GCS_MAVLINK::send_proximity().

Here is the caller graph for this function:

◆ get_status() [1/2]

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().

Here is the caller graph for this function:

◆ get_status() [2/2]

AP_Proximity::Proximity_Status AP_Proximity::get_status ( void  ) const

Definition at line 263 of file AP_Proximity.cpp.

Referenced by get_rangefinder().

Here is the caller graph for this function:

◆ get_type()

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().

Here is the caller graph for this function:

◆ get_upward_distance() [1/2]

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_upward_distance() [2/2]

bool AP_Proximity::get_upward_distance ( float &  distance) const

Definition at line 427 of file AP_Proximity.cpp.

Here is the call graph for this function:

◆ get_yaw_correction()

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().

Here is the caller graph for this function:

◆ handle_msg()

void AP_Proximity::handle_msg ( mavlink_message_t *  msg)

Definition at line 269 of file AP_Proximity.cpp.

Referenced by num_sensors().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ init()

void AP_Proximity::init ( void  )

Definition at line 191 of file AP_Proximity.cpp.

Here is the call graph for this function:

◆ num_sensors()

uint8_t AP_Proximity::num_sensors ( void  ) const
inline

Definition at line 84 of file AP_Proximity.h.

Referenced by GCS_MAVLINK::send_distance_sensor().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator=()

AP_Proximity& AP_Proximity::operator= ( const AP_Proximity  )
delete

◆ set_rangefinder()

void AP_Proximity::set_rangefinder ( const RangeFinder rangefinder)
inline

Definition at line 72 of file AP_Proximity.h.

◆ update()

void AP_Proximity::update ( void  )

Definition at line 211 of file AP_Proximity.cpp.

Here is the call graph for this function:

◆ update_instance()

void AP_Proximity::update_instance ( uint8_t  instance)
private

Friends And Related Function Documentation

◆ AP_Proximity_Backend

friend class AP_Proximity_Backend
friend

Definition at line 35 of file AP_Proximity.h.

Member Data Documentation

◆ _ignore_angle_deg

AP_Int16 AP_Proximity::_ignore_angle_deg[PROXIMITY_MAX_IGNORE]
private

◆ _ignore_width_deg

AP_Int8 AP_Proximity::_ignore_width_deg[PROXIMITY_MAX_IGNORE]
private

◆ _orientation

AP_Int8 AP_Proximity::_orientation[PROXIMITY_MAX_INSTANCES]
private

Definition at line 148 of file AP_Proximity.h.

Referenced by get_orientation().

◆ _rangefinder

const RangeFinder* AP_Proximity::_rangefinder
private

Definition at line 141 of file AP_Proximity.h.

Referenced by get_rangefinder(), and set_rangefinder().

◆ _singleton

AP_Proximity * AP_Proximity::_singleton
staticprivate

Definition at line 135 of file AP_Proximity.h.

Referenced by AP_Proximity(), get_singleton(), and get_type().

◆ _type

AP_Int8 AP_Proximity::_type[PROXIMITY_MAX_INSTANCES]
private

◆ _yaw_correction

AP_Int16 AP_Proximity::_yaw_correction[PROXIMITY_MAX_INSTANCES]
private

Definition at line 149 of file AP_Proximity.h.

Referenced by get_yaw_correction().

◆ drivers

AP_Proximity_Backend* AP_Proximity::drivers[PROXIMITY_MAX_INSTANCES]
private

◆ num_instances

uint8_t AP_Proximity::num_instances
private

Definition at line 143 of file AP_Proximity.h.

Referenced by get_status(), handle_msg(), init(), num_sensors(), and update().

◆ primary_instance

uint8_t AP_Proximity::primary_instance
private

◆ serial_manager

AP_SerialManager& AP_Proximity::serial_manager
private

Definition at line 144 of file AP_Proximity.h.

Referenced by detect_instance().

◆ state

Proximity_State AP_Proximity::state[PROXIMITY_MAX_INSTANCES]
private

Definition at line 139 of file AP_Proximity.h.

Referenced by detect_instance(), get_status(), init(), and update().

◆ var_info

const AP_Param::GroupInfo AP_Proximity::var_info
static

Definition at line 133 of file AP_Proximity.h.

Referenced by AP_Proximity().


The documentation for this class was generated from the following files: