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

#include <AP_L1_Control.h>

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

Public Member Functions

 AP_L1_Control (AP_AHRS &ahrs, const AP_SpdHgtControl *spdHgtControl)
 
 AP_L1_Control (const AP_L1_Control &other)=delete
 
AP_L1_Controloperator= (const AP_L1_Control &)=delete
 
int32_t nav_roll_cd (void) const
 
float lateral_acceleration (void) const
 
int32_t nav_bearing_cd (void) const
 
int32_t bearing_error_cd (void) const
 
float crosstrack_error (void) const
 
float crosstrack_error_integrator (void) const
 
int32_t target_bearing_cd (void) const
 
float turn_distance (float wp_radius) const
 
float turn_distance (float wp_radius, float turn_angle) const
 
float loiter_radius (const float loiter_radius) const
 
void update_waypoint (const struct Location &prev_WP, const struct Location &next_WP, float dist_min=0.0f)
 
void update_loiter (const struct Location &center_WP, float radius, int8_t loiter_direction)
 
void update_heading_hold (int32_t navigation_heading_cd)
 
void update_level_flight (void)
 
bool reached_loiter_target (void)
 
void set_default_period (float period)
 
void set_data_is_stale (void)
 
bool data_is_stale (void) const
 
void set_reverse (bool reverse)
 

Static Public Attributes

static const struct AP_Param::GroupInfo var_info []
 

Private Member Functions

void _prevent_indecision (float &Nu)
 
float get_yaw ()
 
float get_yaw_sensor ()
 

Private Attributes

AP_AHRS_ahrs
 
const AP_SpdHgtControl_spdHgtControl
 
float _latAccDem
 
float _L1_dist
 
bool _WPcircle
 
float _nav_bearing
 
float _bearing_error
 
float _crosstrack_error
 
int32_t _target_bearing_cd
 
AP_Float _L1_period
 
AP_Float _L1_damping
 
float _last_Nu
 
float _L1_xtrack_i = 0
 
AP_Float _L1_xtrack_i_gain
 
float _L1_xtrack_i_gain_prev = 0
 
uint32_t _last_update_waypoint_us
 
bool _data_is_stale = true
 
AP_Float _loiter_bank_limit
 
bool _reverse = false
 

Additional Inherited Members

- Public Types inherited from AP_Navigation
enum  ControllerType { CONTROLLER_DEFAULT = 0, CONTROLLER_L1 = 1 }
 

Detailed Description

Definition at line 22 of file AP_L1_Control.h.

Constructor & Destructor Documentation

◆ AP_L1_Control() [1/2]

AP_L1_Control::AP_L1_Control ( AP_AHRS ahrs,
const AP_SpdHgtControl spdHgtControl 
)
inline

Definition at line 24 of file AP_L1_Control.h.

Here is the call graph for this function:

◆ AP_L1_Control() [2/2]

AP_L1_Control::AP_L1_Control ( const AP_L1_Control other)
delete

Member Function Documentation

◆ _prevent_indecision()

void AP_L1_Control::_prevent_indecision ( float &  Nu)
private

prevent indecision in our turning by using our previous turn decision if we are in a narrow angle band pointing away from the target and the turn angle has changed sign

Definition at line 182 of file AP_L1_Control.cpp.

Referenced by update_loiter(), and update_waypoint().

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

◆ bearing_error_cd()

int32_t AP_L1_Control::bearing_error_cd ( void  ) const
virtual

Implements AP_Navigation.

Definition at line 101 of file AP_L1_Control.cpp.

Referenced by AP_L1_Control().

Here is the caller graph for this function:

◆ crosstrack_error()

float AP_L1_Control::crosstrack_error ( void  ) const
inlinevirtual

Implements AP_Navigation.

Definition at line 46 of file AP_L1_Control.h.

◆ crosstrack_error_integrator()

float AP_L1_Control::crosstrack_error_integrator ( void  ) const
inlinevirtual

Reimplemented from AP_Navigation.

Definition at line 47 of file AP_L1_Control.h.

Here is the call graph for this function:

◆ data_is_stale()

bool AP_L1_Control::data_is_stale ( void  ) const
inlinevirtual

Implements AP_Navigation.

Definition at line 67 of file AP_L1_Control.h.

◆ get_yaw()

float AP_L1_Control::get_yaw ( )
private

Definition at line 56 of file AP_L1_Control.cpp.

Referenced by update_waypoint().

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

◆ get_yaw_sensor()

float AP_L1_Control::get_yaw_sensor ( )
private

Definition at line 67 of file AP_L1_Control.cpp.

Referenced by _prevent_indecision().

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

◆ lateral_acceleration()

float AP_L1_Control::lateral_acceleration ( void  ) const
virtual

Implements AP_Navigation.

Definition at line 91 of file AP_L1_Control.cpp.

Referenced by AP_L1_Control().

Here is the caller graph for this function:

◆ loiter_radius()

float AP_L1_Control::loiter_radius ( const float  loiter_radius) const
virtual

Implements AP_Navigation.

Definition at line 138 of file AP_L1_Control.cpp.

Referenced by crosstrack_error_integrator(), and update_loiter().

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

◆ nav_bearing_cd()

int32_t AP_L1_Control::nav_bearing_cd ( void  ) const
virtual

Implements AP_Navigation.

Definition at line 96 of file AP_L1_Control.cpp.

Referenced by AP_L1_Control().

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

◆ nav_roll_cd()

int32_t AP_L1_Control::nav_roll_cd ( void  ) const
virtual

Implements AP_Navigation.

Definition at line 79 of file AP_L1_Control.cpp.

Referenced by AP_L1_Control().

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

◆ operator=()

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

Referenced by AP_L1_Control().

Here is the caller graph for this function:

◆ reached_loiter_target()

bool AP_L1_Control::reached_loiter_target ( void  )
virtual

Implements AP_Navigation.

Definition at line 172 of file AP_L1_Control.cpp.

Referenced by crosstrack_error_integrator().

Here is the caller graph for this function:

◆ set_data_is_stale()

void AP_L1_Control::set_data_is_stale ( void  )
inlinevirtual

Implements AP_Navigation.

Definition at line 64 of file AP_L1_Control.h.

◆ set_default_period()

void AP_L1_Control::set_default_period ( float  period)
inline

Definition at line 60 of file AP_L1_Control.h.

◆ set_reverse()

void AP_L1_Control::set_reverse ( bool  reverse)
inlinevirtual

Implements AP_Navigation.

Definition at line 74 of file AP_L1_Control.h.

◆ target_bearing_cd()

int32_t AP_L1_Control::target_bearing_cd ( void  ) const
virtual

Implements AP_Navigation.

Definition at line 106 of file AP_L1_Control.cpp.

Referenced by crosstrack_error_integrator().

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

◆ turn_distance() [1/2]

float AP_L1_Control::turn_distance ( float  wp_radius) const
virtual

Implements AP_Navigation.

Definition at line 114 of file AP_L1_Control.cpp.

Referenced by crosstrack_error_integrator(), and turn_distance().

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

◆ turn_distance() [2/2]

float AP_L1_Control::turn_distance ( float  wp_radius,
float  turn_angle 
) const
virtual

Implements AP_Navigation.

Definition at line 128 of file AP_L1_Control.cpp.

Here is the call graph for this function:

◆ update_heading_hold()

void AP_L1_Control::update_heading_hold ( int32_t  navigation_heading_cd)
virtual

Implements AP_Navigation.

Definition at line 446 of file AP_L1_Control.cpp.

Referenced by crosstrack_error_integrator().

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

◆ update_level_flight()

void AP_L1_Control::update_level_flight ( void  )
virtual

Implements AP_Navigation.

Definition at line 487 of file AP_L1_Control.cpp.

Referenced by crosstrack_error_integrator().

Here is the caller graph for this function:

◆ update_loiter()

void AP_L1_Control::update_loiter ( const struct Location center_WP,
float  radius,
int8_t  loiter_direction 
)
virtual

Implements AP_Navigation.

Definition at line 333 of file AP_L1_Control.cpp.

Referenced by crosstrack_error_integrator().

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

◆ update_waypoint()

void AP_L1_Control::update_waypoint ( const struct Location prev_WP,
const struct Location next_WP,
float  dist_min = 0.0f 
)
virtual

Implements AP_Navigation.

Definition at line 198 of file AP_L1_Control.cpp.

Referenced by crosstrack_error_integrator().

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

Member Data Documentation

◆ _ahrs

AP_AHRS& AP_L1_Control::_ahrs
private

◆ _bearing_error

float AP_L1_Control::_bearing_error
private

◆ _crosstrack_error

float AP_L1_Control::_crosstrack_error
private

◆ _data_is_stale

bool AP_L1_Control::_data_is_stale = true
private

◆ _L1_damping

AP_Float AP_L1_Control::_L1_damping
private

Definition at line 110 of file AP_L1_Control.h.

Referenced by update_loiter(), and update_waypoint().

◆ _L1_dist

float AP_L1_Control::_L1_dist
private

Definition at line 90 of file AP_L1_Control.h.

Referenced by turn_distance(), update_heading_hold(), update_loiter(), and update_waypoint().

◆ _L1_period

AP_Float AP_L1_Control::_L1_period
private

◆ _L1_xtrack_i

float AP_L1_Control::_L1_xtrack_i = 0
private

Definition at line 120 of file AP_L1_Control.h.

Referenced by crosstrack_error_integrator(), and update_waypoint().

◆ _L1_xtrack_i_gain

AP_Float AP_L1_Control::_L1_xtrack_i_gain
private

Definition at line 121 of file AP_L1_Control.h.

Referenced by update_waypoint().

◆ _L1_xtrack_i_gain_prev

float AP_L1_Control::_L1_xtrack_i_gain_prev = 0
private

Definition at line 122 of file AP_L1_Control.h.

Referenced by update_waypoint().

◆ _last_Nu

float AP_L1_Control::_last_Nu
private

Definition at line 113 of file AP_L1_Control.h.

Referenced by _prevent_indecision(), update_loiter(), and update_waypoint().

◆ _last_update_waypoint_us

uint32_t AP_L1_Control::_last_update_waypoint_us
private

Definition at line 123 of file AP_L1_Control.h.

Referenced by update_waypoint().

◆ _latAccDem

float AP_L1_Control::_latAccDem
private

◆ _loiter_bank_limit

AP_Float AP_L1_Control::_loiter_bank_limit
private

Definition at line 126 of file AP_L1_Control.h.

Referenced by loiter_radius().

◆ _nav_bearing

float AP_L1_Control::_nav_bearing
private

◆ _reverse

bool AP_L1_Control::_reverse = false
private

Definition at line 128 of file AP_L1_Control.h.

Referenced by get_yaw(), get_yaw_sensor(), and set_reverse().

◆ _spdHgtControl

const AP_SpdHgtControl* AP_L1_Control::_spdHgtControl
private

Definition at line 83 of file AP_L1_Control.h.

Referenced by loiter_radius().

◆ _target_bearing_cd

int32_t AP_L1_Control::_target_bearing_cd
private

◆ _WPcircle

bool AP_L1_Control::_WPcircle
private

◆ var_info

const AP_Param::GroupInfo AP_L1_Control::var_info
static

Definition at line 72 of file AP_L1_Control.h.

Referenced by AP_L1_Control().


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