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

#include <AP_Follow.h>

Collaboration diagram for AP_Follow:
[legend]

Public Types

enum  YawBehave { YAW_BEHAVE_NONE = 0, YAW_BEHAVE_FACE_LEAD_VEHICLE = 1, YAW_BEHAVE_SAME_AS_LEAD_VEHICLE = 2, YAW_BEHAVE_DIR_OF_FLIGHT = 3 }
 

Public Member Functions

 AP_Follow ()
 
void set_target_sysid (uint8_t sysid)
 
bool have_target () const
 
bool get_target_location_and_velocity (Location &loc, Vector3f &vel_ned) const
 
bool get_target_dist_and_vel_ned (Vector3f &dist_ned, Vector3f &dist_with_ofs, Vector3f &vel_ned)
 
const AC_Pget_pos_p () const
 
YawBehave get_yaw_behave () const
 
bool get_target_heading (float &heading) const
 
void handle_msg (const mavlink_message_t &msg)
 
bool enabled () const
 

Static Public Attributes

static const struct AP_Param::GroupInfo var_info []
 

Private Member Functions

bool get_velocity_ned (Vector3f &vel_ned, float dt) const
 
void init_offsets_if_required (const Vector3f &dist_vec_ned)
 
bool get_offsets_ned (Vector3f &offsets) const
 

Private Attributes

AP_Int8 _enabled
 
AP_Int16 _sysid
 
AP_Float _dist_max
 
AP_Int8 _offset_type
 
AP_Vector3f _offset
 
AP_Int8 _yaw_behave
 
AC_P _p_pos
 
bool _healthy
 
uint8_t _sysid_to_follow = 0
 
uint32_t _last_location_update_ms
 
Location _target_location
 
Vector3f _target_velocity_ned
 
Vector3f _target_accel_ned
 
uint32_t _last_heading_update_ms
 
float _target_heading
 
uint32_t _last_location_sent_to_gcs
 

Detailed Description

Definition at line 25 of file AP_Follow.h.

Member Enumeration Documentation

◆ YawBehave

Enumerator
YAW_BEHAVE_NONE 
YAW_BEHAVE_FACE_LEAD_VEHICLE 
YAW_BEHAVE_SAME_AS_LEAD_VEHICLE 
YAW_BEHAVE_DIR_OF_FLIGHT 

Definition at line 31 of file AP_Follow.h.

Constructor & Destructor Documentation

◆ AP_Follow()

AP_Follow::AP_Follow ( )

Definition at line 117 of file AP_Follow.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ enabled()

bool AP_Follow::enabled ( void  ) const
inline

Definition at line 77 of file AP_Follow.h.

Here is the call graph for this function:

◆ get_offsets_ned()

bool AP_Follow::get_offsets_ned ( Vector3f offsets) const
private

Definition at line 315 of file AP_Follow.cpp.

Referenced by enabled(), and get_target_dist_and_vel_ned().

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

◆ get_pos_p()

const AC_P& AP_Follow::get_pos_p ( ) const
inline

Definition at line 58 of file AP_Follow.h.

◆ get_target_dist_and_vel_ned()

bool AP_Follow::get_target_dist_and_vel_ned ( Vector3f dist_ned,
Vector3f dist_with_ofs,
Vector3f vel_ned 
)

Definition at line 156 of file AP_Follow.cpp.

Referenced by set_target_sysid().

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

◆ get_target_heading()

bool AP_Follow::get_target_heading ( float &  heading) const

Definition at line 196 of file AP_Follow.cpp.

Referenced by get_yaw_behave().

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

◆ get_target_location_and_velocity()

bool AP_Follow::get_target_location_and_velocity ( Location loc,
Vector3f vel_ned 
) const

Definition at line 125 of file AP_Follow.cpp.

Referenced by get_target_dist_and_vel_ned(), handle_msg(), and set_target_sysid().

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

◆ get_velocity_ned()

bool AP_Follow::get_velocity_ned ( Vector3f vel_ned,
float  dt 
) const
private

Definition at line 300 of file AP_Follow.cpp.

Referenced by enabled(), and get_target_location_and_velocity().

Here is the caller graph for this function:

◆ get_yaw_behave()

YawBehave AP_Follow::get_yaw_behave ( ) const
inline

Definition at line 65 of file AP_Follow.h.

Here is the call graph for this function:

◆ handle_msg()

void AP_Follow::handle_msg ( const mavlink_message_t &  msg)

Definition at line 214 of file AP_Follow.cpp.

Referenced by get_yaw_behave().

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

◆ have_target()

bool AP_Follow::have_target ( ) const

Referenced by set_target_sysid().

Here is the caller graph for this function:

◆ init_offsets_if_required()

void AP_Follow::init_offsets_if_required ( const Vector3f dist_vec_ned)
private

Definition at line 307 of file AP_Follow.cpp.

Referenced by enabled(), and get_target_dist_and_vel_ned().

Here is the caller graph for this function:

◆ set_target_sysid()

void AP_Follow::set_target_sysid ( uint8_t  sysid)
inline

Definition at line 42 of file AP_Follow.h.

Here is the call graph for this function:

Member Data Documentation

◆ _dist_max

AP_Float AP_Follow::_dist_max
private

Definition at line 93 of file AP_Follow.h.

Referenced by get_target_dist_and_vel_ned().

◆ _enabled

AP_Int8 AP_Follow::_enabled
private

◆ _healthy

bool AP_Follow::_healthy
private

Definition at line 100 of file AP_Follow.h.

◆ _last_heading_update_ms

uint32_t AP_Follow::_last_heading_update_ms
private

Definition at line 106 of file AP_Follow.h.

Referenced by get_offsets_ned(), get_target_heading(), and handle_msg().

◆ _last_location_sent_to_gcs

uint32_t AP_Follow::_last_location_sent_to_gcs
private

Definition at line 108 of file AP_Follow.h.

Referenced by handle_msg().

◆ _last_location_update_ms

uint32_t AP_Follow::_last_location_update_ms
private

Definition at line 102 of file AP_Follow.h.

Referenced by get_target_location_and_velocity(), and handle_msg().

◆ _offset

AP_Vector3f AP_Follow::_offset
private

Definition at line 95 of file AP_Follow.h.

Referenced by get_offsets_ned(), and init_offsets_if_required().

◆ _offset_type

AP_Int8 AP_Follow::_offset_type
private

Definition at line 94 of file AP_Follow.h.

Referenced by get_offsets_ned().

◆ _p_pos

AC_P AP_Follow::_p_pos
private

Definition at line 97 of file AP_Follow.h.

Referenced by get_pos_p().

◆ _sysid

AP_Int16 AP_Follow::_sysid
private

Definition at line 92 of file AP_Follow.h.

Referenced by AP_Follow(), handle_msg(), and set_target_sysid().

◆ _sysid_to_follow

uint8_t AP_Follow::_sysid_to_follow = 0
private

Definition at line 101 of file AP_Follow.h.

Referenced by AP_Follow(), and handle_msg().

◆ _target_accel_ned

Vector3f AP_Follow::_target_accel_ned
private

Definition at line 105 of file AP_Follow.h.

Referenced by get_velocity_ned().

◆ _target_heading

float AP_Follow::_target_heading
private

Definition at line 107 of file AP_Follow.h.

Referenced by get_offsets_ned(), get_target_heading(), and handle_msg().

◆ _target_location

Location AP_Follow::_target_location
private

Definition at line 103 of file AP_Follow.h.

Referenced by get_target_location_and_velocity(), and handle_msg().

◆ _target_velocity_ned

Vector3f AP_Follow::_target_velocity_ned
private

Definition at line 104 of file AP_Follow.h.

Referenced by get_velocity_ned(), and handle_msg().

◆ _yaw_behave

AP_Int8 AP_Follow::_yaw_behave
private

Definition at line 96 of file AP_Follow.h.

Referenced by get_yaw_behave().

◆ var_info

const AP_Param::GroupInfo AP_Follow::var_info
static

Definition at line 74 of file AP_Follow.h.

Referenced by AP_Follow().


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