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

#include <AP_Beacon.h>

Collaboration diagram for AP_Beacon:
[legend]

Classes

struct  BeaconState
 

Public Types

enum  AP_BeaconType { AP_BeaconType_None = 0, AP_BeaconType_Pozyx = 1, AP_BeaconType_Marvelmind = 2, AP_BeaconType_SITL = 10 }
 

Public Member Functions

 AP_Beacon (AP_SerialManager &_serial_manager)
 
void init (void)
 
bool enabled (void)
 
bool healthy (void)
 
void update (void)
 
bool get_origin (Location &origin_loc) const
 
bool get_vehicle_position_ned (Vector3f &pos, float &accuracy_estimate) const
 
uint8_t count () const
 
bool get_beacon_data (uint8_t beacon_instance, struct BeaconState &state) const
 
uint8_t beacon_id (uint8_t beacon_instance) const
 
bool beacon_healthy (uint8_t beacon_instance) const
 
float beacon_distance (uint8_t beacon_instance) const
 
Vector3f beacon_position (uint8_t beacon_instance) const
 
uint32_t beacon_last_update_ms (uint8_t beacon_instance) const
 
void update_boundary_points ()
 
const Vector2fget_boundary_points (uint16_t &num_points) const
 

Static Public Attributes

static const struct AP_Param::GroupInfo var_info []
 

Private Member Functions

bool device_ready (void) const
 

Static Private Member Functions

static bool get_next_boundary_point (const Vector2f *boundary, uint8_t num_points, uint8_t current_index, float start_angle, uint8_t &next_index, float &next_angle)
 

Private Attributes

AP_Int8 _type
 
AP_Float origin_lat
 
AP_Float origin_lon
 
AP_Float origin_alt
 
AP_Int16 orient_yaw
 
AP_Beacon_Backend_driver
 
AP_SerialManagerserial_manager
 
Vector3f veh_pos_ned
 
float veh_pos_accuracy
 
uint32_t veh_pos_update_ms
 
uint8_t num_beacons = 0
 
BeaconState beacon_state [AP_BEACON_MAX_BEACONS]
 
Vector2f boundary [AP_BEACON_MAX_BEACONS+1]
 
uint8_t boundary_num_points
 
uint8_t boundary_num_beacons
 

Friends

class AP_Beacon_Backend
 

Detailed Description

Definition at line 29 of file AP_Beacon.h.

Member Enumeration Documentation

◆ AP_BeaconType

Enumerator
AP_BeaconType_None 
AP_BeaconType_Pozyx 
AP_BeaconType_Marvelmind 
AP_BeaconType_SITL 

Definition at line 37 of file AP_Beacon.h.

Constructor & Destructor Documentation

◆ AP_Beacon()

AP_Beacon::AP_Beacon ( AP_SerialManager _serial_manager)

Definition at line 73 of file AP_Beacon.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ beacon_distance()

float AP_Beacon::beacon_distance ( uint8_t  beacon_instance) const

Definition at line 204 of file AP_Beacon.cpp.

Referenced by DataFlash_Class::Log_Write_Beacon(), NavEKF2_core::readRngBcnData(), and NavEKF3_core::readRngBcnData().

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

◆ beacon_healthy()

bool AP_Beacon::beacon_healthy ( uint8_t  beacon_instance) const

Definition at line 195 of file AP_Beacon.cpp.

Referenced by NavEKF2_core::readRngBcnData(), and NavEKF3_core::readRngBcnData().

Here is the caller graph for this function:

◆ beacon_id()

uint8_t AP_Beacon::beacon_id ( uint8_t  beacon_instance) const

Definition at line 186 of file AP_Beacon.cpp.

◆ beacon_last_update_ms()

uint32_t AP_Beacon::beacon_last_update_ms ( uint8_t  beacon_instance) const

Definition at line 223 of file AP_Beacon.cpp.

Referenced by NavEKF2_core::readRngBcnData(), and NavEKF3_core::readRngBcnData().

Here is the caller graph for this function:

◆ beacon_position()

Vector3f AP_Beacon::beacon_position ( uint8_t  beacon_instance) const

Definition at line 213 of file AP_Beacon.cpp.

Referenced by NavEKF2_core::readRngBcnData(), NavEKF3_core::readRngBcnData(), and update_boundary_points().

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

◆ count()

uint8_t AP_Beacon::count ( ) const

Definition at line 167 of file AP_Beacon.cpp.

Referenced by DataFlash_Class::Log_Write_Beacon(), NavEKF2_core::readRngBcnData(), and NavEKF3_core::readRngBcnData().

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

◆ device_ready()

bool AP_Beacon::device_ready ( void  ) const
private

Definition at line 373 of file AP_Beacon.cpp.

Referenced by beacon_position(), count(), get_beacon_data(), get_boundary_points(), get_origin(), get_vehicle_position_ned(), healthy(), update(), and update_boundary_points().

Here is the caller graph for this function:

◆ enabled()

bool AP_Beacon::enabled ( void  )

Definition at line 101 of file AP_Beacon.cpp.

Referenced by DataFlash_Class::Log_Write_Beacon().

Here is the caller graph for this function:

◆ get_beacon_data()

bool AP_Beacon::get_beacon_data ( uint8_t  beacon_instance,
struct BeaconState state 
) const

Definition at line 176 of file AP_Beacon.cpp.

Here is the call graph for this function:

◆ get_boundary_points()

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

Definition at line 361 of file AP_Beacon.cpp.

Referenced by AC_Avoid::adjust_velocity_beacon_fence().

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

◆ get_next_boundary_point()

bool AP_Beacon::get_next_boundary_point ( const Vector2f boundary,
uint8_t  num_points,
uint8_t  current_index,
float  start_angle,
uint8_t &  next_index,
float &  next_angle 
)
staticprivate

Definition at line 321 of file AP_Beacon.cpp.

Referenced by update_boundary_points().

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

◆ get_origin()

bool AP_Beacon::get_origin ( Location origin_loc) const

Definition at line 128 of file AP_Beacon.cpp.

Referenced by NavEKF2_core::readRngBcnData(), and NavEKF3_core::readRngBcnData().

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

◆ get_vehicle_position_ned()

bool AP_Beacon::get_vehicle_position_ned ( Vector3f pos,
float &  accuracy_estimate 
) const

Definition at line 149 of file AP_Beacon.cpp.

Referenced by DataFlash_Class::Log_Write_Beacon(), loop(), NavEKF2_core::readRngBcnData(), and NavEKF3_core::readRngBcnData().

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

◆ healthy()

bool AP_Beacon::healthy ( void  )

Definition at line 107 of file AP_Beacon.cpp.

Referenced by beacon_distance(), and DataFlash_Class::Log_Write_Beacon().

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

◆ init()

void AP_Beacon::init ( void  )

Definition at line 80 of file AP_Beacon.cpp.

Referenced by setup().

Here is the caller graph for this function:

◆ update()

void AP_Beacon::update ( void  )

Definition at line 116 of file AP_Beacon.cpp.

Referenced by loop().

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

◆ update_boundary_points()

void AP_Beacon::update_boundary_points ( )

Definition at line 232 of file AP_Beacon.cpp.

Referenced by update().

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

Friends And Related Function Documentation

◆ AP_Beacon_Backend

friend class AP_Beacon_Backend
friend

Definition at line 32 of file AP_Beacon.h.

Member Data Documentation

◆ _driver

AP_Beacon_Backend* AP_Beacon::_driver
private

Definition at line 123 of file AP_Beacon.h.

Referenced by device_ready(), healthy(), init(), and update().

◆ _type

AP_Int8 AP_Beacon::_type
private

Definition at line 116 of file AP_Beacon.h.

Referenced by beacon_last_update_ms(), device_ready(), enabled(), and init().

◆ beacon_state

BeaconState AP_Beacon::beacon_state[AP_BEACON_MAX_BEACONS]
private

◆ boundary

Vector2f AP_Beacon::boundary[AP_BEACON_MAX_BEACONS+1]
private

Definition at line 136 of file AP_Beacon.h.

Referenced by get_boundary_points(), and update_boundary_points().

◆ boundary_num_beacons

uint8_t AP_Beacon::boundary_num_beacons
private

Definition at line 138 of file AP_Beacon.h.

Referenced by update_boundary_points().

◆ boundary_num_points

uint8_t AP_Beacon::boundary_num_points
private

Definition at line 137 of file AP_Beacon.h.

Referenced by get_boundary_points(), and update_boundary_points().

◆ num_beacons

uint8_t AP_Beacon::num_beacons = 0
private

◆ orient_yaw

AP_Int16 AP_Beacon::orient_yaw
private

Definition at line 120 of file AP_Beacon.h.

Referenced by AP_Beacon_Backend::correct_for_orient_yaw().

◆ origin_alt

AP_Float AP_Beacon::origin_alt
private

Definition at line 119 of file AP_Beacon.h.

Referenced by AP_Beacon_Backend::get_beacon_origin_alt(), and get_origin().

◆ origin_lat

AP_Float AP_Beacon::origin_lat
private

Definition at line 117 of file AP_Beacon.h.

Referenced by AP_Beacon_Backend::get_beacon_origin_lat(), and get_origin().

◆ origin_lon

AP_Float AP_Beacon::origin_lon
private

Definition at line 118 of file AP_Beacon.h.

Referenced by AP_Beacon_Backend::get_beacon_origin_lon(), and get_origin().

◆ serial_manager

AP_SerialManager& AP_Beacon::serial_manager
private

Definition at line 124 of file AP_Beacon.h.

Referenced by init().

◆ var_info

const AP_Param::GroupInfo AP_Beacon::var_info
static

Definition at line 100 of file AP_Beacon.h.

Referenced by AP_Beacon(), and setup().

◆ veh_pos_accuracy

float AP_Beacon::veh_pos_accuracy
private

◆ veh_pos_ned

Vector3f AP_Beacon::veh_pos_ned
private

◆ veh_pos_update_ms

uint32_t AP_Beacon::veh_pos_update_ms
private

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