APM:Libraries
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
AP_Proximity_Backend Class Referenceabstract

#include <AP_Proximity_Backend.h>

Inheritance diagram for AP_Proximity_Backend:
[legend]
Collaboration diagram for AP_Proximity_Backend:
[legend]

Public Member Functions

 AP_Proximity_Backend (AP_Proximity &_frontend, AP_Proximity::Proximity_State &_state)
 
virtual ~AP_Proximity_Backend (void)
 
virtual void update ()=0
 
virtual float distance_max () const =0
 
virtual float distance_min () const =0
 
virtual bool get_upward_distance (float &distance) const
 
virtual void handle_msg (mavlink_message_t *msg)
 
bool get_horizontal_distance (float angle_deg, float &distance) 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
 
bool get_horizontal_distances (AP_Proximity::Proximity_Distance_Array &prx_dist_array) const
 

Protected Member Functions

void set_status (AP_Proximity::Proximity_Status status)
 
bool convert_angle_to_sector (float angle_degrees, uint8_t &sector) const
 
void init_boundary ()
 
void update_boundary_for_sector (uint8_t sector)
 
uint8_t get_ignore_area_count () const
 
bool get_ignore_area (uint8_t index, uint16_t &angle_deg, uint8_t &width_deg) const
 
bool get_next_ignore_start_or_end (uint8_t start_or_end, int16_t start_angle, int16_t &ignore_start) const
 

Protected Attributes

AP_Proximityfrontend
 
AP_Proximity::Proximity_Statestate
 
uint8_t _num_sectors = PROXIMITY_MAX_DIRECTION
 
uint16_t _sector_middle_deg [PROXIMITY_SECTORS_MAX] = {0, 45, 90, 135, 180, 225, 270, 315, 0, 0, 0, 0}
 
uint8_t _sector_width_deg [PROXIMITY_SECTORS_MAX] = {45, 45, 45, 45, 45, 45, 45, 45, 0, 0, 0, 0}
 
float _angle [PROXIMITY_SECTORS_MAX]
 
float _distance [PROXIMITY_SECTORS_MAX]
 
bool _distance_valid [PROXIMITY_SECTORS_MAX]
 
Vector2f _sector_edge_vector [PROXIMITY_SECTORS_MAX]
 
Vector2f _boundary_point [PROXIMITY_SECTORS_MAX]
 

Detailed Description

Definition at line 25 of file AP_Proximity_Backend.h.

Constructor & Destructor Documentation

◆ AP_Proximity_Backend()

AP_Proximity_Backend::AP_Proximity_Backend ( AP_Proximity _frontend,
AP_Proximity::Proximity_State _state 
)

Definition at line 25 of file AP_Proximity_Backend.cpp.

Here is the call graph for this function:

◆ ~AP_Proximity_Backend()

virtual AP_Proximity_Backend::~AP_Proximity_Backend ( void  )
inlinevirtual

Definition at line 33 of file AP_Proximity_Backend.h.

Here is the call graph for this function:

Member Function Documentation

◆ convert_angle_to_sector()

bool AP_Proximity_Backend::convert_angle_to_sector ( float  angle_degrees,
uint8_t &  sector 
) const
protected

Definition at line 237 of file AP_Proximity_Backend.cpp.

Referenced by get_horizontal_distance(), handle_msg(), AP_Proximity_RPLidarA2::parse_response_data(), AP_Proximity_LightWareSF40C::process_reply(), and AP_Proximity_TeraRangerTower::update_sector_data().

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

◆ distance_max()

virtual float AP_Proximity_Backend::distance_max ( ) const
pure virtual

Implemented in AP_Proximity_RPLidarA2, AP_Proximity_LightWareSF40C, AP_Proximity_TeraRangerTower, AP_Proximity_SITL, AP_Proximity_MAV, and AP_Proximity_RangeFinder.

Referenced by AP_Proximity::distance_max(), get_horizontal_distances(), and ~AP_Proximity_Backend().

Here is the caller graph for this function:

◆ distance_min()

virtual float AP_Proximity_Backend::distance_min ( ) const
pure virtual

Implemented in AP_Proximity_RPLidarA2, AP_Proximity_LightWareSF40C, AP_Proximity_TeraRangerTower, AP_Proximity_SITL, AP_Proximity_MAV, and AP_Proximity_RangeFinder.

Referenced by AP_Proximity::distance_min(), and ~AP_Proximity_Backend().

Here is the caller graph for this function:

◆ get_boundary_points()

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

Definition at line 139 of file AP_Proximity_Backend.cpp.

Referenced by AP_Proximity::get_boundary_points(), and handle_msg().

Here is the caller graph for this function:

◆ get_closest_object()

bool AP_Proximity_Backend::get_closest_object ( float &  angle_deg,
float &  distance 
) const

Definition at line 48 of file AP_Proximity_Backend.cpp.

Referenced by AP_Proximity::get_closest_object(), and handle_msg().

Here is the caller graph for this function:

◆ get_horizontal_distance()

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

Definition at line 34 of file AP_Proximity_Backend.cpp.

Referenced by AP_Proximity::get_horizontal_distance(), and handle_msg().

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

◆ get_horizontal_distances()

bool AP_Proximity_Backend::get_horizontal_distances ( AP_Proximity::Proximity_Distance_Array prx_dist_array) const

Definition at line 89 of file AP_Proximity_Backend.cpp.

Referenced by AP_Proximity::get_horizontal_distances(), and handle_msg().

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

◆ get_ignore_area()

bool AP_Proximity_Backend::get_ignore_area ( uint8_t  index,
uint16_t &  angle_deg,
uint8_t &  width_deg 
) const
protected

Definition at line 293 of file AP_Proximity_Backend.cpp.

Referenced by handle_msg(), AP_Proximity_LightWareSF40C::init_sectors(), and AP_Proximity_RPLidarA2::init_sectors().

Here is the caller graph for this function:

◆ get_ignore_area_count()

uint8_t AP_Proximity_Backend::get_ignore_area_count ( ) const
protected

Definition at line 280 of file AP_Proximity_Backend.cpp.

Referenced by handle_msg(), AP_Proximity_LightWareSF40C::init_sectors(), and AP_Proximity_RPLidarA2::init_sectors().

Here is the caller graph for this function:

◆ get_next_ignore_start_or_end()

bool AP_Proximity_Backend::get_next_ignore_start_or_end ( uint8_t  start_or_end,
int16_t  start_angle,
int16_t &  ignore_start 
) const
protected

Definition at line 305 of file AP_Proximity_Backend.cpp.

Referenced by handle_msg(), AP_Proximity_LightWareSF40C::init_sectors(), and AP_Proximity_RPLidarA2::init_sectors().

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

◆ get_object_angle_and_distance()

bool AP_Proximity_Backend::get_object_angle_and_distance ( uint8_t  object_number,
float &  angle_deg,
float &  distance 
) const

Definition at line 78 of file AP_Proximity_Backend.cpp.

Referenced by AP_Proximity::get_object_angle_and_distance(), and handle_msg().

Here is the caller graph for this function:

◆ get_object_count()

uint8_t AP_Proximity_Backend::get_object_count ( ) const

Definition at line 71 of file AP_Proximity_Backend.cpp.

Referenced by AP_Proximity::get_object_count(), and handle_msg().

Here is the caller graph for this function:

◆ get_upward_distance()

virtual bool AP_Proximity_Backend::get_upward_distance ( float &  distance) const
inlinevirtual

Reimplemented in AP_Proximity_SITL, AP_Proximity_MAV, and AP_Proximity_RangeFinder.

Definition at line 43 of file AP_Proximity_Backend.h.

Referenced by AP_Proximity::get_upward_distance().

Here is the caller graph for this function:

◆ handle_msg()

virtual void AP_Proximity_Backend::handle_msg ( mavlink_message_t *  msg)
inlinevirtual

Reimplemented in AP_Proximity_MAV.

Definition at line 46 of file AP_Proximity_Backend.h.

Referenced by AP_Proximity::handle_msg().

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

◆ init_boundary()

void AP_Proximity_Backend::init_boundary ( )
protected

Definition at line 167 of file AP_Proximity_Backend.cpp.

Referenced by AP_Proximity_Backend(), handle_msg(), AP_Proximity_LightWareSF40C::init_sectors(), and AP_Proximity_RPLidarA2::init_sectors().

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

◆ set_status()

void AP_Proximity_Backend::set_status ( AP_Proximity::Proximity_Status  status)
protected

Definition at line 232 of file AP_Proximity_Backend.cpp.

Referenced by handle_msg(), AP_Proximity_RangeFinder::update(), AP_Proximity_MAV::update(), AP_Proximity_SITL::update(), AP_Proximity_LightWareSF40C::update(), AP_Proximity_TeraRangerTower::update(), and AP_Proximity_RPLidarA2::update().

Here is the caller graph for this function:

◆ update()

virtual void AP_Proximity_Backend::update ( )
pure virtual

Implemented in AP_Proximity_RPLidarA2, AP_Proximity_LightWareSF40C, AP_Proximity_TeraRangerTower, AP_Proximity_SITL, AP_Proximity_MAV, and AP_Proximity_RangeFinder.

Referenced by AP_Proximity::update(), and ~AP_Proximity_Backend().

Here is the caller graph for this function:

◆ update_boundary_for_sector()

void AP_Proximity_Backend::update_boundary_for_sector ( uint8_t  sector)
protected

Definition at line 180 of file AP_Proximity_Backend.cpp.

Referenced by AP_Proximity_MAV::handle_msg(), handle_msg(), AP_Proximity_RPLidarA2::parse_response_data(), AP_Proximity_LightWareSF40C::process_reply(), AP_Proximity_RangeFinder::update(), AP_Proximity_SITL::update(), and AP_Proximity_TeraRangerTower::update_sector_data().

Here is the caller graph for this function:

Member Data Documentation

◆ _angle

float AP_Proximity_Backend::_angle[PROXIMITY_SECTORS_MAX]
protected

◆ _boundary_point

Vector2f AP_Proximity_Backend::_boundary_point[PROXIMITY_SECTORS_MAX]
protected

◆ _distance

float AP_Proximity_Backend::_distance[PROXIMITY_SECTORS_MAX]
protected

◆ _distance_valid

bool AP_Proximity_Backend::_distance_valid[PROXIMITY_SECTORS_MAX]
protected

◆ _num_sectors

uint8_t AP_Proximity_Backend::_num_sectors = PROXIMITY_MAX_DIRECTION
protected

◆ _sector_edge_vector

Vector2f AP_Proximity_Backend::_sector_edge_vector[PROXIMITY_SECTORS_MAX]
protected

Definition at line 103 of file AP_Proximity_Backend.h.

Referenced by init_boundary(), and update_boundary_for_sector().

◆ _sector_middle_deg

uint16_t AP_Proximity_Backend::_sector_middle_deg[PROXIMITY_SECTORS_MAX] = {0, 45, 90, 135, 180, 225, 270, 315, 0, 0, 0, 0}
protected

◆ _sector_width_deg

uint8_t AP_Proximity_Backend::_sector_width_deg[PROXIMITY_SECTORS_MAX] = {45, 45, 45, 45, 45, 45, 45, 45, 0, 0, 0, 0}
protected

◆ frontend

AP_Proximity& AP_Proximity_Backend::frontend
protected

◆ state

AP_Proximity::Proximity_State& AP_Proximity_Backend::state
protected

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