APM:Libraries
|
#include <AP_Avoidance.h>
Classes | |
class | Obstacle |
Public Member Functions | |
void | add_obstacle (uint32_t obstacle_timestamp_ms, const MAV_COLLISION_SRC src, uint32_t src_id, const Location &loc, const Vector3f &vel_ned) |
void | add_obstacle (uint32_t obstacle_timestamp_ms, const MAV_COLLISION_SRC src, uint32_t src_id, const Location &loc, float cog, float hspeed, float vspeed) |
void | update () |
void | enable () |
void | disable () |
MAV_COLLISION_THREAT_LEVEL | current_threat_level () const |
void | handle_msg (const mavlink_message_t &msg) |
Static Public Attributes | |
static const struct AP_Param::GroupInfo | var_info [] |
Protected Member Functions | |
AP_Avoidance (AP_AHRS &ahrs, class AP_ADSB &adsb) | |
void | handle_avoidance_local (AP_Avoidance::Obstacle *threat) |
virtual MAV_COLLISION_ACTION | handle_avoidance (const AP_Avoidance::Obstacle *obstacle, MAV_COLLISION_ACTION requested_action)=0 |
virtual void | handle_recovery (uint8_t recovery_action)=0 |
void | handle_threat_gcs_notify (AP_Avoidance::Obstacle *threat) |
AP_Avoidance::Obstacle * | most_serious_threat () |
MAV_COLLISION_ACTION | mav_avoidance_action () |
bool | get_destination_perpendicular (const AP_Avoidance::Obstacle *obstacle, Vector3f &newdest_neu, const float wp_speed_xy, const float wp_speed_z, const uint8_t _minimum_avoid_height) |
bool | get_vector_perpendicular (const AP_Avoidance::Obstacle *obstacle, Vector3f &vec_neu) |
Static Protected Member Functions | |
static Vector3f | perpendicular_xyz (const Location &p1, const Vector3f &v1, const Location &p2) |
static Vector2f | perpendicular_xy (const Location &p1, const Vector3f &v1, const Location &p2) |
Protected Attributes | |
uint32_t | _last_state_change_ms = 0 |
MAV_COLLISION_THREAT_LEVEL | _threat_level = MAV_COLLISION_THREAT_LEVEL_NONE |
uint32_t | _gcs_cleared_messages_first_sent |
const AP_AHRS & | _ahrs |
Static Protected Attributes | |
static const uint8_t | _gcs_cleared_messages_duration = 5 |
Private Member Functions | |
bool | check_startup () |
void | init () |
void | deinit () |
uint32_t | src_id_for_adsb_vehicle (AP_ADSB::adsb_vehicle_t vehicle) const |
void | check_for_threats () |
void | update_threat_level (const Location &my_loc, const Vector3f &my_vel, AP_Avoidance::Obstacle &obstacle) |
void | get_adsb_samples () |
bool | obstacle_is_more_serious_threat (const AP_Avoidance::Obstacle &obstacle) const |
Private Attributes | |
const uint32_t | MAX_OBSTACLE_AGE_MS = 5000 |
const uint8_t | _low_velocity_threshold = 1 |
AP_Avoidance::Obstacle * | _obstacles |
uint8_t | _obstacles_allocated |
uint8_t | _obstacle_count |
int8_t | _current_most_serious_threat |
MAV_COLLISION_ACTION | _latest_action = MAV_COLLISION_ACTION_NONE |
class AP_ADSB & | _adsb |
AP_Int8 | _enabled |
AP_Int8 | _obstacles_max |
AP_Int8 | _fail_action |
AP_Int8 | _fail_recovery |
AP_Int8 | _fail_time_horizon |
AP_Int16 | _fail_distance_xy |
AP_Int16 | _fail_distance_z |
AP_Int16 | _fail_altitude_minimum |
AP_Int8 | _warn_action |
AP_Int8 | _warn_time_horizon |
AP_Float | _warn_distance_xy |
AP_Float | _warn_distance_z |
Static Private Attributes | |
static const uint8_t | _gcs_notify_interval = 1 |
Definition at line 41 of file AP_Avoidance.h.
void AP_Avoidance::add_obstacle | ( | uint32_t | obstacle_timestamp_ms, |
const MAV_COLLISION_SRC | src, | ||
uint32_t | src_id, | ||
const Location & | loc, | ||
const Vector3f & | vel_ned | ||
) |
Definition at line 190 of file AP_Avoidance.cpp.
Referenced by add_obstacle(), get_adsb_samples(), and handle_msg().
void AP_Avoidance::add_obstacle | ( | uint32_t | obstacle_timestamp_ms, |
const MAV_COLLISION_SRC | src, | ||
uint32_t | src_id, | ||
const Location & | loc, | ||
float | cog, | ||
float | hspeed, | ||
float | vspeed | ||
) |
|
private |
Definition at line 435 of file AP_Avoidance.cpp.
Referenced by update().
|
private |
Definition at line 174 of file AP_Avoidance.cpp.
Referenced by add_obstacle(), handle_msg(), and update().
MAV_COLLISION_THREAT_LEVEL AP_Avoidance::current_threat_level | ( | ) | const |
Definition at line 382 of file AP_Avoidance.cpp.
Referenced by disable().
|
private |
Definition at line 163 of file AP_Avoidance.cpp.
Referenced by check_startup().
|
inline |
|
inline |
Definition at line 82 of file AP_Avoidance.h.
|
private |
Definition at line 259 of file AP_Avoidance.cpp.
Referenced by update().
|
protected |
|
protected |
Definition at line 590 of file AP_Avoidance.cpp.
Referenced by mav_avoidance_action().
|
protectedpure virtual |
|
protected |
Definition at line 512 of file AP_Avoidance.cpp.
Referenced by update().
void AP_Avoidance::handle_msg | ( | const mavlink_message_t & | msg | ) |
Definition at line 554 of file AP_Avoidance.cpp.
Referenced by disable().
|
protectedpure virtual |
|
protected |
Definition at line 392 of file AP_Avoidance.cpp.
Referenced by update().
|
private |
Definition at line 138 of file AP_Avoidance.cpp.
Referenced by check_startup().
|
inlineprotected |
Definition at line 123 of file AP_Avoidance.h.
Referenced by handle_threat_gcs_notify().
|
protected |
Definition at line 483 of file AP_Avoidance.cpp.
Referenced by update().
|
private |
Definition at line 417 of file AP_Avoidance.cpp.
Referenced by check_for_threats().
|
staticprotected |
Definition at line 642 of file AP_Avoidance.cpp.
Referenced by mav_avoidance_action().
|
staticprotected |
Definition at line 631 of file AP_Avoidance.cpp.
Referenced by get_vector_perpendicular(), and mav_avoidance_action().
|
private |
Definition at line 253 of file AP_Avoidance.cpp.
Referenced by get_adsb_samples().
void AP_Avoidance::update | ( | void | ) |
|
private |
Definition at line 328 of file AP_Avoidance.cpp.
Referenced by check_for_threats().
|
private |
Definition at line 181 of file AP_Avoidance.h.
Referenced by get_adsb_samples(), and update().
|
protected |
Definition at line 137 of file AP_Avoidance.h.
Referenced by check_for_threats(), get_vector_perpendicular(), and handle_avoidance_local().
|
private |
Definition at line 177 of file AP_Avoidance.h.
Referenced by check_for_threats(), current_threat_level(), init(), most_serious_threat(), and obstacle_is_more_serious_threat().
|
private |
Definition at line 184 of file AP_Avoidance.h.
Referenced by check_startup(), disable(), enable(), and init().
|
private |
Definition at line 187 of file AP_Avoidance.h.
Referenced by handle_avoidance_local().
|
private |
Definition at line 192 of file AP_Avoidance.h.
Referenced by handle_avoidance_local().
|
private |
Definition at line 190 of file AP_Avoidance.h.
Referenced by update_threat_level().
|
private |
Definition at line 191 of file AP_Avoidance.h.
Referenced by update_threat_level().
|
private |
Definition at line 188 of file AP_Avoidance.h.
Referenced by handle_avoidance_local().
|
private |
Definition at line 189 of file AP_Avoidance.h.
Referenced by update_threat_level().
|
staticprotected |
Definition at line 114 of file AP_Avoidance.h.
Referenced by handle_threat_gcs_notify().
|
protected |
Definition at line 115 of file AP_Avoidance.h.
Referenced by handle_threat_gcs_notify(), and init().
|
staticprivate |
Definition at line 143 of file AP_Avoidance.h.
Referenced by handle_threat_gcs_notify().
|
protected |
Definition at line 109 of file AP_Avoidance.h.
Referenced by handle_avoidance_local(), and init().
|
private |
Definition at line 178 of file AP_Avoidance.h.
Referenced by handle_avoidance_local(), and mav_avoidance_action().
|
private |
Definition at line 147 of file AP_Avoidance.h.
Referenced by get_vector_perpendicular().
|
private |
Definition at line 176 of file AP_Avoidance.h.
Referenced by add_obstacle(), check_for_threats(), deinit(), and init().
|
private |
Definition at line 174 of file AP_Avoidance.h.
Referenced by add_obstacle(), check_for_threats(), check_startup(), current_threat_level(), deinit(), init(), most_serious_threat(), and obstacle_is_more_serious_threat().
|
private |
Definition at line 175 of file AP_Avoidance.h.
Referenced by add_obstacle(), deinit(), and init().
|
private |
Definition at line 185 of file AP_Avoidance.h.
Referenced by init().
|
protected |
Definition at line 110 of file AP_Avoidance.h.
Referenced by handle_avoidance_local(), and init().
|
private |
Definition at line 194 of file AP_Avoidance.h.
|
private |
Definition at line 196 of file AP_Avoidance.h.
Referenced by update_threat_level().
|
private |
Definition at line 197 of file AP_Avoidance.h.
Referenced by update_threat_level().
|
private |
Definition at line 195 of file AP_Avoidance.h.
Referenced by update_threat_level().
|
private |
Definition at line 142 of file AP_Avoidance.h.
Referenced by check_for_threats(), and update_threat_level().
|
static |
Definition at line 92 of file AP_Avoidance.h.
Referenced by AP_Avoidance().