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

#include <AC_Circle.h>

Collaboration diagram for AC_Circle:
[legend]

Classes

struct  circle_flags
 

Public Member Functions

 AC_Circle (const AP_InertialNav &inav, const AP_AHRS_View &ahrs, AC_PosControl &pos_control)
 Constructor. More...
 
void init (const Vector3f &center)
 
void init ()
 
void set_center (const Vector3f &center)
 set_circle_center in cm from home More...
 
const Vector3fget_center () const
 get_circle_center in cm from home More...
 
float get_radius ()
 get_radius - returns radius of circle in cm More...
 
void set_radius (float radius_cm)
 set_radius - sets circle radius in cm More...
 
void set_rate (float deg_per_sec)
 set_circle_rate - set circle rate in degrees per second More...
 
float get_angle_total () const
 get_angle_total - return total angle in radians that vehicle has circled More...
 
void update ()
 update - update circle controller More...
 
int32_t get_roll () const
 get desired roll, pitch which should be fed into stabilize controllers More...
 
int32_t get_pitch () const
 
int32_t get_yaw () const
 
void get_closest_point_on_circle (Vector3f &result)
 
float get_distance_to_target () const
 get horizontal distance to loiter target in cm More...
 
int32_t get_bearing_to_target () const
 get bearing to target in centi-degrees More...
 

Static Public Attributes

static const struct AP_Param::GroupInfo var_info []
 

Private Member Functions

void calc_velocities (bool init_velocity)
 
void init_start_angle (bool use_heading)
 

Private Attributes

struct AC_Circle::circle_flags _flags
 
const AP_InertialNav_inav
 
const AP_AHRS_View_ahrs
 
AC_PosControl_pos_control
 
AP_Float _radius
 
AP_Float _rate
 
Vector3f _center
 
float _yaw
 
float _angle
 
float _angle_total
 
float _angular_vel
 
float _angular_vel_max
 
float _angular_accel
 

Detailed Description

Definition at line 14 of file AC_Circle.h.

Constructor & Destructor Documentation

◆ AC_Circle()

AC_Circle::AC_Circle ( const AP_InertialNav inav,
const AP_AHRS_View ahrs,
AC_PosControl pos_control 
)

Constructor.

Definition at line 33 of file AC_Circle.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ calc_velocities()

void AC_Circle::calc_velocities ( bool  init_velocity)
private

Definition at line 204 of file AC_Circle.cpp.

Referenced by init(), and set_rate().

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

◆ get_angle_total()

float AC_Circle::get_angle_total ( ) const
inline

get_angle_total - return total angle in radians that vehicle has circled

Definition at line 44 of file AC_Circle.h.

Here is the call graph for this function:

◆ get_bearing_to_target()

int32_t AC_Circle::get_bearing_to_target ( ) const
inline

get bearing to target in centi-degrees

Definition at line 65 of file AC_Circle.h.

Here is the call graph for this function:

◆ get_center()

const Vector3f& AC_Circle::get_center ( ) const
inline

get_circle_center in cm from home

Definition at line 33 of file AC_Circle.h.

◆ get_closest_point_on_circle()

void AC_Circle::get_closest_point_on_circle ( Vector3f result)

Definition at line 170 of file AC_Circle.cpp.

Referenced by get_yaw().

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

◆ get_distance_to_target()

float AC_Circle::get_distance_to_target ( ) const
inline

get horizontal distance to loiter target in cm

Definition at line 62 of file AC_Circle.h.

Here is the call graph for this function:

◆ get_pitch()

int32_t AC_Circle::get_pitch ( ) const
inline

Definition at line 51 of file AC_Circle.h.

Here is the call graph for this function:

◆ get_radius()

float AC_Circle::get_radius ( )
inline

get_radius - returns radius of circle in cm

Definition at line 36 of file AC_Circle.h.

◆ get_roll()

int32_t AC_Circle::get_roll ( ) const
inline

get desired roll, pitch which should be fed into stabilize controllers

Definition at line 50 of file AC_Circle.h.

Here is the call graph for this function:

◆ get_yaw()

int32_t AC_Circle::get_yaw ( ) const
inline

Definition at line 52 of file AC_Circle.h.

Here is the call graph for this function:

◆ init() [1/2]

void AC_Circle::init ( const Vector3f center)

init - initialise circle controller setting center specifically caller should set the position controller's x,y and z speeds and accelerations before calling this

Definition at line 52 of file AC_Circle.cpp.

Here is the call graph for this function:

◆ init() [2/2]

void AC_Circle::init ( )

init - initialise circle controller setting center using stopping point and projecting out based on the copter's heading caller should set the position controller's x,y and z speeds and accelerations before calling this

Definition at line 74 of file AC_Circle.cpp.

Here is the call graph for this function:

◆ init_start_angle()

void AC_Circle::init_start_angle ( bool  use_heading)
private

Definition at line 231 of file AC_Circle.cpp.

Referenced by init().

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

◆ set_center()

void AC_Circle::set_center ( const Vector3f center)
inline

set_circle_center in cm from home

Definition at line 30 of file AC_Circle.h.

◆ set_radius()

void AC_Circle::set_radius ( float  radius_cm)
inline

set_radius - sets circle radius in cm

Definition at line 38 of file AC_Circle.h.

Here is the call graph for this function:

◆ set_rate()

void AC_Circle::set_rate ( float  deg_per_sec)

set_circle_rate - set circle rate in degrees per second

Definition at line 101 of file AC_Circle.cpp.

Referenced by set_radius().

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

◆ update()

void AC_Circle::update ( )

update - update circle controller

Definition at line 110 of file AC_Circle.cpp.

Referenced by get_angle_total().

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

Member Data Documentation

◆ _ahrs

const AP_AHRS_View& AC_Circle::_ahrs
private

Definition at line 89 of file AC_Circle.h.

Referenced by get_closest_point_on_circle(), init(), and init_start_angle().

◆ _angle

float AC_Circle::_angle
private

Definition at line 99 of file AC_Circle.h.

Referenced by init_start_angle(), and update().

◆ _angle_total

float AC_Circle::_angle_total
private

Definition at line 100 of file AC_Circle.h.

Referenced by get_angle_total(), init_start_angle(), and update().

◆ _angular_accel

float AC_Circle::_angular_accel
private

Definition at line 103 of file AC_Circle.h.

Referenced by calc_velocities(), and update().

◆ _angular_vel

float AC_Circle::_angular_vel
private

Definition at line 101 of file AC_Circle.h.

Referenced by calc_velocities(), and update().

◆ _angular_vel_max

float AC_Circle::_angular_vel_max
private

Definition at line 102 of file AC_Circle.h.

Referenced by calc_velocities(), and update().

◆ _center

Vector3f AC_Circle::_center
private

◆ _flags

struct AC_Circle::circle_flags AC_Circle::_flags
private

Referenced by AC_Circle().

◆ _inav

const AP_InertialNav& AC_Circle::_inav
private

Definition at line 88 of file AC_Circle.h.

Referenced by get_closest_point_on_circle(), and init_start_angle().

◆ _pos_control

AC_PosControl& AC_Circle::_pos_control
private

◆ _radius

AP_Float AC_Circle::_radius
private

◆ _rate

AP_Float AC_Circle::_rate
private

Definition at line 94 of file AC_Circle.h.

Referenced by calc_velocities(), and set_rate().

◆ _yaw

float AC_Circle::_yaw
private

Definition at line 98 of file AC_Circle.h.

Referenced by get_yaw(), and update().

◆ var_info

const AP_Param::GroupInfo AC_Circle::var_info
static
Initial value:

Definition at line 67 of file AC_Circle.h.

Referenced by AC_Circle().


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