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

#include <AP_Soaring.h>

Collaboration diagram for SoaringController:
[legend]

Public Member Functions

 SoaringController (AP_AHRS &ahrs, AP_SpdHgtControl &spdHgt, const AP_Vehicle::FixedWing &parms)
 
void get_target (Location &wp)
 
bool suppress_throttle ()
 
bool check_thermal_criteria ()
 
bool check_cruise_criteria ()
 
bool check_init_thermal_criteria ()
 
void init_thermalling ()
 
void init_cruising ()
 
void update_thermalling ()
 
void update_cruising ()
 
bool is_active () const
 
bool get_throttle_suppressed () const
 
void set_throttle_suppressed (bool suppressed)
 
float get_vario_reading () const
 
void update_vario ()
 

Static Public Attributes

static const struct AP_Param::GroupInfo var_info []
 

Protected Attributes

AP_Int8 soar_active
 
AP_Int8 soar_active_ch
 
AP_Float thermal_vspeed
 
AP_Float thermal_q1
 
AP_Float thermal_q2
 
AP_Float thermal_r
 
AP_Float thermal_distance_ahead
 
AP_Int16 min_thermal_s
 
AP_Int16 min_cruise_s
 
AP_Float polar_CD0
 
AP_Float polar_B
 
AP_Float polar_K
 
AP_Float alt_max
 
AP_Float alt_min
 
AP_Float alt_cutoff
 

Private Member Functions

float McCready (float alt)
 
void get_wind_corrected_drift (const Location *current_loc, const Vector3f *wind, float *wind_drift_x, float *wind_drift_y, float *dx, float *dy)
 
void get_altitude_wrt_home (float *alt)
 

Private Attributes

ExtendedKalmanFilter _ekf {}
 
AP_AHRS_ahrs
 
AP_SpdHgtControl_spdHgt
 
Variometer _vario
 
struct Location _prev_update_location
 
unsigned long _thermal_start_time_us
 
unsigned long _cruise_start_time_us
 
unsigned long _prev_update_time
 
float _loiter_rad
 
bool _throttle_suppressed
 

Detailed Description

Definition at line 28 of file AP_Soaring.h.

Constructor & Destructor Documentation

◆ SoaringController()

SoaringController::SoaringController ( AP_AHRS ahrs,
AP_SpdHgtControl spdHgt,
const AP_Vehicle::FixedWing parms 
)

Definition at line 131 of file AP_Soaring.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ check_cruise_criteria()

bool SoaringController::check_cruise_criteria ( )

Definition at line 178 of file AP_Soaring.cpp.

Here is the call graph for this function:

◆ check_init_thermal_criteria()

bool SoaringController::check_init_thermal_criteria ( )

Definition at line 194 of file AP_Soaring.cpp.

Here is the call graph for this function:

◆ check_thermal_criteria()

bool SoaringController::check_thermal_criteria ( )

Definition at line 169 of file AP_Soaring.cpp.

Here is the call graph for this function:

◆ get_altitude_wrt_home()

void SoaringController::get_altitude_wrt_home ( float *  alt)
private

Definition at line 252 of file AP_Soaring.cpp.

Referenced by suppress_throttle().

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

◆ get_target()

void SoaringController::get_target ( Location wp)

Definition at line 141 of file AP_Soaring.cpp.

Here is the call graph for this function:

◆ get_throttle_suppressed()

bool SoaringController::get_throttle_suppressed ( ) const
inline

Definition at line 85 of file AP_Soaring.h.

Referenced by AP_TECS::_detect_bad_descent().

Here is the caller graph for this function:

◆ get_vario_reading()

float SoaringController::get_vario_reading ( ) const
inline

Definition at line 93 of file AP_Soaring.h.

Here is the call graph for this function:

◆ get_wind_corrected_drift()

void SoaringController::get_wind_corrected_drift ( const Location current_loc,
const Vector3f wind,
float *  wind_drift_x,
float *  wind_drift_y,
float *  dx,
float *  dy 
)
private

Definition at line 239 of file AP_Soaring.cpp.

Referenced by update_thermalling().

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

◆ init_cruising()

void SoaringController::init_cruising ( )

Definition at line 230 of file AP_Soaring.cpp.

Here is the call graph for this function:

◆ init_thermalling()

void SoaringController::init_thermalling ( )

Definition at line 204 of file AP_Soaring.cpp.

Here is the call graph for this function:

◆ is_active()

bool SoaringController::is_active ( ) const

Definition at line 324 of file AP_Soaring.cpp.

Referenced by AP_TECS::_detect_bad_descent(), and init_cruising().

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

◆ McCready()

float SoaringController::McCready ( float  alt)
private

Definition at line 318 of file AP_Soaring.cpp.

Referenced by check_cruise_criteria().

Here is the caller graph for this function:

◆ set_throttle_suppressed()

void SoaringController::set_throttle_suppressed ( bool  suppressed)
inline

Definition at line 89 of file AP_Soaring.h.

◆ suppress_throttle()

bool SoaringController::suppress_throttle ( )

Definition at line 147 of file AP_Soaring.cpp.

Referenced by init_cruising().

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

◆ update_cruising()

void SoaringController::update_cruising ( )

Definition at line 306 of file AP_Soaring.cpp.

◆ update_thermalling()

void SoaringController::update_thermalling ( )

Definition at line 257 of file AP_Soaring.cpp.

Here is the call graph for this function:

◆ update_vario()

void SoaringController::update_vario ( )

Definition at line 312 of file AP_Soaring.cpp.

Referenced by get_vario_reading().

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

Member Data Documentation

◆ _ahrs

AP_AHRS& SoaringController::_ahrs
private

Definition at line 30 of file AP_Soaring.h.

Referenced by get_altitude_wrt_home(), init_thermalling(), and update_thermalling().

◆ _cruise_start_time_us

unsigned long SoaringController::_cruise_start_time_us
private

Definition at line 41 of file AP_Soaring.h.

Referenced by check_thermal_criteria(), init_cruising(), and suppress_throttle().

◆ _ekf

ExtendedKalmanFilter SoaringController::_ekf {}
private

◆ _loiter_rad

float SoaringController::_loiter_rad
private

Definition at line 46 of file AP_Soaring.h.

Referenced by check_cruise_criteria().

◆ _prev_update_location

struct Location SoaringController::_prev_update_location
private

◆ _prev_update_time

unsigned long SoaringController::_prev_update_time
private

Definition at line 44 of file AP_Soaring.h.

Referenced by get_wind_corrected_drift(), init_thermalling(), and update_thermalling().

◆ _spdHgt

AP_SpdHgtControl& SoaringController::_spdHgt
private

Definition at line 31 of file AP_Soaring.h.

Referenced by suppress_throttle().

◆ _thermal_start_time_us

unsigned long SoaringController::_thermal_start_time_us
private

◆ _throttle_suppressed

bool SoaringController::_throttle_suppressed
private

Definition at line 47 of file AP_Soaring.h.

Referenced by get_throttle_suppressed(), init_cruising(), and suppress_throttle().

◆ _vario

Variometer SoaringController::_vario
private

◆ alt_cutoff

AP_Float SoaringController::alt_cutoff
protected

Definition at line 68 of file AP_Soaring.h.

Referenced by suppress_throttle().

◆ alt_max

AP_Float SoaringController::alt_max
protected

Definition at line 66 of file AP_Soaring.h.

Referenced by check_cruise_criteria(), and check_thermal_criteria().

◆ alt_min

AP_Float SoaringController::alt_min
protected

Definition at line 67 of file AP_Soaring.h.

Referenced by check_cruise_criteria(), check_thermal_criteria(), and suppress_throttle().

◆ min_cruise_s

AP_Int16 SoaringController::min_cruise_s
protected

Definition at line 62 of file AP_Soaring.h.

Referenced by check_thermal_criteria().

◆ min_thermal_s

AP_Int16 SoaringController::min_thermal_s
protected

Definition at line 61 of file AP_Soaring.h.

Referenced by check_cruise_criteria(), and check_init_thermal_criteria().

◆ polar_B

AP_Float SoaringController::polar_B
protected

Definition at line 64 of file AP_Soaring.h.

Referenced by update_vario().

◆ polar_CD0

AP_Float SoaringController::polar_CD0
protected

Definition at line 63 of file AP_Soaring.h.

Referenced by update_vario().

◆ polar_K

AP_Float SoaringController::polar_K
protected

Definition at line 65 of file AP_Soaring.h.

Referenced by update_vario().

◆ soar_active

AP_Int8 SoaringController::soar_active
protected

◆ soar_active_ch

AP_Int8 SoaringController::soar_active_ch
protected

Definition at line 55 of file AP_Soaring.h.

Referenced by is_active().

◆ thermal_distance_ahead

AP_Float SoaringController::thermal_distance_ahead
protected

Definition at line 60 of file AP_Soaring.h.

Referenced by init_thermalling().

◆ thermal_q1

AP_Float SoaringController::thermal_q1
protected

Definition at line 57 of file AP_Soaring.h.

Referenced by init_thermalling().

◆ thermal_q2

AP_Float SoaringController::thermal_q2
protected

Definition at line 58 of file AP_Soaring.h.

Referenced by init_thermalling().

◆ thermal_r

AP_Float SoaringController::thermal_r
protected

Definition at line 59 of file AP_Soaring.h.

Referenced by init_thermalling().

◆ thermal_vspeed

AP_Float SoaringController::thermal_vspeed
protected

Definition at line 56 of file AP_Soaring.h.

Referenced by check_thermal_criteria(), and McCready().

◆ var_info

const AP_Param::GroupInfo SoaringController::var_info
static

Definition at line 74 of file AP_Soaring.h.

Referenced by SoaringController().


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