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

#include <AC_Avoid.h>

Collaboration diagram for AC_Avoid:
[legend]

Public Member Functions

 AC_Avoid (const AP_AHRS &ahrs, const AC_Fence &fence, const AP_Proximity &proximity, const AP_Beacon *beacon=nullptr)
 Constructor. More...
 
 AC_Avoid (const AC_Avoid &other)=delete
 
AC_Avoidoperator= (const AC_Avoid &)=delete
 
void adjust_velocity (float kP, float accel_cmss, Vector2f &desired_vel_cms, float dt)
 
void adjust_velocity (float kP, float accel_cmss, Vector3f &desired_vel_cms, float dt)
 
void adjust_speed (float kP, float accel, float heading, float &speed, float dt)
 
void adjust_velocity_z (float kP, float accel_cmss, float &climb_rate_cms, float dt)
 
void adjust_roll_pitch (float &roll, float &pitch, float angle_max)
 
void proximity_avoidance_enable (bool on_off)
 
bool proximity_avoidance_enabled ()
 
void limit_velocity (float kP, float accel_cmss, Vector2f &desired_vel_cms, const Vector2f &limit_direction, float limit_distance_cm, float dt) const
 
float get_max_speed (float kP, float accel_cmss, float distance_cm, float dt) const
 

Static Public Attributes

static const struct AP_Param::GroupInfo var_info []
 

Private Types

enum  BehaviourType { BEHAVIOR_SLIDE = 0, BEHAVIOR_STOP = 1 }
 

Private Member Functions

void adjust_velocity_circle_fence (float kP, float accel_cmss, Vector2f &desired_vel_cms, float dt)
 
void adjust_velocity_polygon_fence (float kP, float accel_cmss, Vector2f &desired_vel_cms, float dt)
 
void adjust_velocity_beacon_fence (float kP, float accel_cmss, Vector2f &desired_vel_cms, float dt)
 
void adjust_velocity_proximity (float kP, float accel_cmss, Vector2f &desired_vel_cms, float dt)
 
void adjust_velocity_polygon (float kP, float accel_cmss, Vector2f &desired_vel_cms, const Vector2f *boundary, uint16_t num_points, bool earth_frame, float margin, float dt)
 
float get_stopping_distance (float kP, float accel_cmss, float speed_cms) const
 
float distance_to_lean_pct (float dist_m)
 
void get_proximity_roll_pitch_pct (float &roll_positive, float &roll_negative, float &pitch_positive, float &pitch_negative)
 

Private Attributes

const AP_AHRS_ahrs
 
const AC_Fence_fence
 
const AP_Proximity_proximity
 
const AP_Beacon_beacon
 
AP_Int8 _enabled
 
AP_Int16 _angle_max
 
AP_Float _dist_max
 
AP_Float _margin
 
AP_Int8 _behavior
 
bool _proximity_enabled = true
 

Detailed Description

Definition at line 29 of file AC_Avoid.h.

Member Enumeration Documentation

◆ BehaviourType

Enumerator
BEHAVIOR_SLIDE 
BEHAVIOR_STOP 

Definition at line 82 of file AC_Avoid.h.

Constructor & Destructor Documentation

◆ AC_Avoid() [1/2]

AC_Avoid::AC_Avoid ( const AP_AHRS ahrs,
const AC_Fence fence,
const AP_Proximity proximity,
const AP_Beacon beacon = nullptr 
)

Constructor.

Definition at line 54 of file AC_Avoid.cpp.

Here is the call graph for this function:

◆ AC_Avoid() [2/2]

AC_Avoid::AC_Avoid ( const AC_Avoid other)
delete

Member Function Documentation

◆ adjust_roll_pitch()

void AC_Avoid::adjust_roll_pitch ( float &  roll,
float &  pitch,
float  angle_max 
)

Definition at line 186 of file AC_Avoid.cpp.

Here is the call graph for this function:

◆ adjust_speed()

void AC_Avoid::adjust_speed ( float  kP,
float  accel,
float  heading,
float &  speed,
float  dt 
)

Definition at line 101 of file AC_Avoid.cpp.

Here is the call graph for this function:

◆ adjust_velocity() [1/2]

void AC_Avoid::adjust_velocity ( float  kP,
float  accel_cmss,
Vector2f desired_vel_cms,
float  dt 
)

Definition at line 63 of file AC_Avoid.cpp.

Referenced by adjust_speed(), adjust_velocity(), and AC_Loiter::calc_desired_velocity().

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

◆ adjust_velocity() [2/2]

void AC_Avoid::adjust_velocity ( float  kP,
float  accel_cmss,
Vector3f desired_vel_cms,
float  dt 
)

Definition at line 88 of file AC_Avoid.cpp.

Here is the call graph for this function:

◆ adjust_velocity_beacon_fence()

void AC_Avoid::adjust_velocity_beacon_fence ( float  kP,
float  accel_cmss,
Vector2f desired_vel_cms,
float  dt 
)
private

Definition at line 353 of file AC_Avoid.cpp.

Referenced by adjust_velocity().

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

◆ adjust_velocity_circle_fence()

void AC_Avoid::adjust_velocity_circle_fence ( float  kP,
float  accel_cmss,
Vector2f desired_vel_cms,
float  dt 
)
private

Definition at line 266 of file AC_Avoid.cpp.

Referenced by adjust_velocity().

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

◆ adjust_velocity_polygon()

void AC_Avoid::adjust_velocity_polygon ( float  kP,
float  accel_cmss,
Vector2f desired_vel_cms,
const Vector2f boundary,
uint16_t  num_points,
bool  earth_frame,
float  margin,
float  dt 
)
private

Definition at line 400 of file AC_Avoid.cpp.

Referenced by adjust_velocity_beacon_fence(), adjust_velocity_polygon_fence(), and adjust_velocity_proximity().

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

◆ adjust_velocity_polygon_fence()

void AC_Avoid::adjust_velocity_polygon_fence ( float  kP,
float  accel_cmss,
Vector2f desired_vel_cms,
float  dt 
)
private

Definition at line 324 of file AC_Avoid.cpp.

Referenced by adjust_velocity().

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

◆ adjust_velocity_proximity()

void AC_Avoid::adjust_velocity_proximity ( float  kP,
float  accel_cmss,
Vector2f desired_vel_cms,
float  dt 
)
private

Definition at line 379 of file AC_Avoid.cpp.

Referenced by adjust_velocity().

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

◆ adjust_velocity_z()

void AC_Avoid::adjust_velocity_z ( float  kP,
float  accel_cmss,
float &  climb_rate_cms,
float  dt 
)

Definition at line 118 of file AC_Avoid.cpp.

Here is the call graph for this function:

◆ distance_to_lean_pct()

float AC_Avoid::distance_to_lean_pct ( float  dist_m)
private

Definition at line 523 of file AC_Avoid.cpp.

Referenced by get_proximity_roll_pitch_pct().

Here is the caller graph for this function:

◆ get_max_speed()

float AC_Avoid::get_max_speed ( float  kP,
float  accel_cmss,
float  distance_cm,
float  dt 
) const

Definition at line 254 of file AC_Avoid.cpp.

Referenced by adjust_velocity_circle_fence(), adjust_velocity_z(), limit_velocity(), and proximity_avoidance_enabled().

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

◆ get_proximity_roll_pitch_pct()

void AC_Avoid::get_proximity_roll_pitch_pct ( float &  roll_positive,
float &  roll_negative,
float &  pitch_positive,
float &  pitch_negative 
)
private

Definition at line 534 of file AC_Avoid.cpp.

Referenced by adjust_roll_pitch().

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

◆ get_stopping_distance()

float AC_Avoid::get_stopping_distance ( float  kP,
float  accel_cmss,
float  speed_cms 
) const
private

Definition at line 500 of file AC_Avoid.cpp.

Referenced by adjust_velocity_circle_fence(), and adjust_velocity_polygon().

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

◆ limit_velocity()

void AC_Avoid::limit_velocity ( float  kP,
float  accel_cmss,
Vector2f desired_vel_cms,
const Vector2f limit_direction,
float  limit_distance_cm,
float  dt 
) const

Definition at line 239 of file AC_Avoid.cpp.

Referenced by adjust_velocity_polygon(), and proximity_avoidance_enabled().

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

◆ operator=()

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

◆ proximity_avoidance_enable()

void AC_Avoid::proximity_avoidance_enable ( bool  on_off)
inline

Definition at line 62 of file AC_Avoid.h.

◆ proximity_avoidance_enabled()

bool AC_Avoid::proximity_avoidance_enabled ( )
inline

Definition at line 63 of file AC_Avoid.h.

Here is the call graph for this function:

Member Data Documentation

◆ _ahrs

const AP_AHRS& AC_Avoid::_ahrs
private

◆ _angle_max

AP_Int16 AC_Avoid::_angle_max
private

Definition at line 137 of file AC_Avoid.h.

Referenced by adjust_roll_pitch().

◆ _beacon

const AP_Beacon* AC_Avoid::_beacon
private

Definition at line 133 of file AC_Avoid.h.

Referenced by adjust_velocity_beacon_fence().

◆ _behavior

AP_Int8 AC_Avoid::_behavior
private

Definition at line 140 of file AC_Avoid.h.

Referenced by adjust_velocity_circle_fence(), and adjust_velocity_polygon().

◆ _dist_max

AP_Float AC_Avoid::_dist_max
private

Definition at line 138 of file AC_Avoid.h.

Referenced by distance_to_lean_pct(), and get_proximity_roll_pitch_pct().

◆ _enabled

AP_Int8 AC_Avoid::_enabled
private

Definition at line 136 of file AC_Avoid.h.

Referenced by adjust_roll_pitch(), adjust_velocity(), and adjust_velocity_z().

◆ _fence

const AC_Fence& AC_Avoid::_fence
private

◆ _margin

AP_Float AC_Avoid::_margin
private

Definition at line 139 of file AC_Avoid.h.

Referenced by adjust_velocity_proximity(), and adjust_velocity_z().

◆ _proximity

const AP_Proximity& AC_Avoid::_proximity
private

◆ _proximity_enabled

bool AC_Avoid::_proximity_enabled = true
private

◆ var_info

const AP_Param::GroupInfo AC_Avoid::var_info
static

Definition at line 78 of file AC_Avoid.h.

Referenced by AC_Avoid().


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