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

#include <AC_AttitudeControl_Heli.h>

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

Classes

struct  AttControlHeliFlags
 

Public Member Functions

 AC_AttitudeControl_Heli (AP_AHRS_View &ahrs, const AP_Vehicle::MultiCopter &aparm, AP_MotorsHeli &motors, float dt)
 
AC_PIDget_rate_roll_pid ()
 
AC_PIDget_rate_pitch_pid ()
 
AC_PIDget_rate_yaw_pid ()
 
void passthrough_bf_roll_pitch_rate_yaw (float roll_passthrough, float pitch_passthrough, float yaw_rate_bf_cds) override
 
void integrate_bf_rate_error_to_angle_errors ()
 
void input_rate_bf_roll_pitch_yaw (float roll_rate_bf_cds, float pitch_rate_bf_cds, float yaw_rate_bf_cds) override
 
virtual void rate_controller_run ()
 
void update_althold_lean_angle_max (float throttle_in) override
 
void use_leaky_i (bool leaky_i) override
 
void use_flybar_passthrough (bool passthrough, bool tail_passthrough) override
 
void do_piro_comp (bool piro_comp)
 
void set_hover_roll_trim_scalar (float scalar) override
 
void set_throttle_out (float throttle_in, bool apply_angle_boost, float filt_cutoff) override
 
void input_euler_angle_roll_pitch_euler_rate_yaw (float euler_roll_angle_cd, float euler_pitch_angle_cd, float euler_yaw_rate_cds) override
 
void input_euler_angle_roll_pitch_yaw (float euler_roll_angle_cd, float euler_pitch_angle_cd, float euler_yaw_angle_cd, bool slew_yaw) override
 
void set_inverted_flight (bool inverted) override
 
- Public Member Functions inherited from AC_AttitudeControl
 AC_AttitudeControl (AP_AHRS_View &ahrs, const AP_Vehicle::MultiCopter &aparm, AP_Motors &motors, float dt)
 
virtual ~AC_AttitudeControl ()
 
AC_Pget_angle_roll_p ()
 
AC_Pget_angle_pitch_p ()
 
AC_Pget_angle_yaw_p ()
 
float get_accel_roll_max () const
 
float get_accel_roll_max_radss () const
 
void set_accel_roll_max (float accel_roll_max)
 
void save_accel_roll_max (float accel_roll_max)
 
float get_accel_pitch_max () const
 
float get_accel_pitch_max_radss () const
 
void set_accel_pitch_max (float accel_pitch_max)
 
void save_accel_pitch_max (float accel_pitch_max)
 
float get_accel_yaw_max () const
 
float get_accel_yaw_max_radss () const
 
void set_accel_yaw_max (float accel_yaw_max)
 
void save_accel_yaw_max (float accel_yaw_max)
 
void set_input_tc (float input_tc)
 
void relax_attitude_controllers ()
 
void reset_rate_controller_I_terms ()
 
void set_attitude_target_to_current_attitude ()
 
void set_yaw_target_to_current_heading ()
 
void shift_ef_yaw_target (float yaw_shift_cd)
 
void inertial_frame_reset ()
 
void input_quaternion (Quaternion attitude_desired_quat)
 
void input_euler_rate_roll_pitch_yaw (float euler_roll_rate_cds, float euler_pitch_rate_cds, float euler_yaw_rate_cds)
 
void input_rate_bf_roll_pitch_yaw_2 (float roll_rate_bf_cds, float pitch_rate_bf_cds, float yaw_rate_bf_cds)
 
void input_rate_bf_roll_pitch_yaw_3 (float roll_rate_bf_cds, float pitch_rate_bf_cds, float yaw_rate_bf_cds)
 
virtual void input_angle_step_bf_roll_pitch_yaw (float roll_angle_step_bf_cd, float pitch_angle_step_bf_cd, float yaw_angle_step_bf_cd)
 
void euler_rate_to_ang_vel (const Vector3f &euler_rad, const Vector3f &euler_rate_rads, Vector3f &ang_vel_rads)
 
bool ang_vel_to_euler_rate (const Vector3f &euler_rad, const Vector3f &ang_vel_rads, Vector3f &euler_rate_rads)
 
void use_sqrt_controller (bool use_sqrt_cont)
 
Vector3f get_att_target_euler_cd () const
 
float get_att_error_angle_deg () const
 
void rate_bf_roll_target (float rate_cds)
 
void rate_bf_pitch_target (float rate_cds)
 
void rate_bf_yaw_target (float rate_cds)
 
float max_rate_step_bf_roll ()
 
float max_rate_step_bf_pitch ()
 
float max_rate_step_bf_yaw ()
 
float max_angle_step_bf_roll ()
 
float max_angle_step_bf_pitch ()
 
float max_angle_step_bf_yaw ()
 
Vector3f rate_bf_targets () const
 
void bf_feedforward (bool enable_or_disable)
 
void bf_feedforward_save (bool enable_or_disable)
 
bool get_bf_feedforward ()
 
void accel_limiting (bool enable_or_disable)
 
void set_throttle_out_unstabilized (float throttle_in, bool reset_attitude_control, float filt_cutoff)
 
float get_throttle_in () const
 
float angle_boost () const
 
float get_althold_lean_angle_max () const
 
float lean_angle_max () const
 
void input_shaping_rate_predictor (Vector2f error_angle, Vector2f &target_ang_vel, float dt) const
 
void ang_vel_limit (Vector3f &euler_rad, float ang_vel_roll_max, float ang_vel_pitch_max, float ang_vel_yaw_max) const
 
Vector3f euler_accel_limit (Vector3f euler_rad, Vector3f euler_accel)
 
void thrust_heading_rotation_angles (Quaternion &att_to_quat, const Quaternion &att_from_quat, Vector3f &att_diff_angle, float &thrust_vec_dot)
 
void attitude_controller_run_quat ()
 
virtual void parameter_sanity_check ()
 
virtual bool is_throttle_mix_min () const
 
virtual void set_throttle_mix_min ()
 
virtual void set_throttle_mix_man ()
 
virtual void set_throttle_mix_max ()
 
virtual void set_throttle_mix_value (float value)
 
virtual float get_throttle_mix (void) const
 
void control_monitor_log (void)
 
float control_monitor_rms_output_roll (void) const
 
float control_monitor_rms_output_roll_P (void) const
 
float control_monitor_rms_output_roll_D (void) const
 
float control_monitor_rms_output_pitch_P (void) const
 
float control_monitor_rms_output_pitch_D (void) const
 
float control_monitor_rms_output_pitch (void) const
 
float control_monitor_rms_output_yaw (void) const
 

Static Public Attributes

static const struct AP_Param::GroupInfo var_info []
 
- Static Public Attributes inherited from AC_AttitudeControl
static const struct AP_Param::GroupInfo var_info []
 

Private Member Functions

void rate_bf_to_motor_roll_pitch (const Vector3f &rate_rads, float rate_roll_target_rads, float rate_pitch_target_rads)
 
float rate_target_to_motor_yaw (float rate_yaw_actual_rads, float rate_yaw_rads) override
 
float get_roll_trim_rad ()
 

Private Attributes

struct AC_AttitudeControl_Heli::AttControlHeliFlags _flags_heli
 
int16_t _passthrough_roll
 
int16_t _passthrough_pitch
 
int16_t _passthrough_yaw
 
float _hover_roll_trim_scalar = 0
 
Vector3f _att_error_rot_vec_rad
 
AP_Int8 _piro_comp_enabled
 
AP_Int16 _hover_roll_trim
 
AC_HELI_PID _pid_rate_roll
 
AC_HELI_PID _pid_rate_pitch
 
AC_HELI_PID _pid_rate_yaw
 
LowPassFilterFloat pitch_feedforward_filter
 
LowPassFilterFloat roll_feedforward_filter
 
LowPassFilterFloat yaw_velocity_feedforward_filter
 
LowPassFilterFloat yaw_acceleration_feedforward_filter
 

Additional Inherited Members

- Static Public Member Functions inherited from AC_AttitudeControl
static float sqrt_controller (float error, float p, float second_ord_lim, float dt)
 
static float stopping_point (float first_ord_mag, float p, float second_ord_lim)
 
static float input_shaping_angle (float error_angle, float smoothing_gain, float accel_max, float target_ang_vel, float dt)
 
static float input_shaping_ang_vel (float target_ang_vel, float desired_ang_vel, float accel_max, float dt)
 
- Protected Member Functions inherited from AC_AttitudeControl
Vector3f update_ang_vel_target_from_att_error (Vector3f attitude_error_rot_vec_rad)
 
float rate_target_to_motor_roll (float rate_actual_rads, float rate_target_rads)
 
float rate_target_to_motor_pitch (float rate_actual_rads, float rate_target_rads)
 
float get_slew_yaw_rads ()
 
void control_monitor_filter_pid (float value, float &rms_P)
 
void control_monitor_update (void)
 
- Protected Attributes inherited from AC_AttitudeControl
AP_Float _slew_yaw
 
AP_Float _ang_vel_roll_max
 
AP_Float _ang_vel_pitch_max
 
AP_Float _ang_vel_yaw_max
 
AP_Float _accel_roll_max
 
AP_Float _accel_pitch_max
 
AP_Float _accel_yaw_max
 
AP_Int8 _rate_bf_ff_enabled
 
AP_Int8 _angle_boost_enabled
 
AC_P _p_angle_roll
 
AC_P _p_angle_pitch
 
AC_P _p_angle_yaw
 
AP_Float _angle_limit_tc
 
AP_Float _input_tc
 
float _dt
 
Vector3f _attitude_target_euler_angle
 
Vector3f _attitude_target_euler_rate
 
Quaternion _attitude_target_quat
 
Vector3f _attitude_target_ang_vel
 
Vector3f _rate_target_ang_vel
 
Quaternion _attitude_ang_error
 
float _thrust_error_angle
 
float _throttle_in = 0.0f
 
float _angle_boost
 
bool _use_sqrt_controller
 
float _althold_lean_angle_max = 0.0f
 
float _throttle_rpy_mix_desired
 
float _throttle_rpy_mix
 
const AP_AHRS_View_ahrs
 
const AP_Vehicle::MultiCopter_aparm
 
AP_Motors_motors
 
struct {
   float   rms_roll_P
 
   float   rms_roll_D
 
   float   rms_pitch_P
 
   float   rms_pitch_D
 
   float   rms_yaw
 
_control_monitor
 
bool _inverted_flight
 

Detailed Description

Definition at line 32 of file AC_AttitudeControl_Heli.h.

Constructor & Destructor Documentation

◆ AC_AttitudeControl_Heli()

AC_AttitudeControl_Heli::AC_AttitudeControl_Heli ( AP_AHRS_View ahrs,
const AP_Vehicle::MultiCopter aparm,
AP_MotorsHeli motors,
float  dt 
)
inline

Definition at line 34 of file AC_AttitudeControl_Heli.h.

Here is the call graph for this function:

Member Function Documentation

◆ do_piro_comp()

void AC_AttitudeControl_Heli::do_piro_comp ( bool  piro_comp)
inline

Definition at line 91 of file AC_AttitudeControl_Heli.h.

◆ get_rate_pitch_pid()

AC_PID& AC_AttitudeControl_Heli::get_rate_pitch_pid ( )
inlinevirtual

Implements AC_AttitudeControl.

Definition at line 61 of file AC_AttitudeControl_Heli.h.

◆ get_rate_roll_pid()

AC_PID& AC_AttitudeControl_Heli::get_rate_roll_pid ( )
inlinevirtual

Implements AC_AttitudeControl.

Definition at line 60 of file AC_AttitudeControl_Heli.h.

◆ get_rate_yaw_pid()

AC_PID& AC_AttitudeControl_Heli::get_rate_yaw_pid ( )
inlinevirtual

Implements AC_AttitudeControl.

Definition at line 62 of file AC_AttitudeControl_Heli.h.

Here is the call graph for this function:

◆ get_roll_trim_rad()

float AC_AttitudeControl_Heli::get_roll_trim_rad ( )
inlineprivatevirtual

Reimplemented from AC_AttitudeControl.

Definition at line 146 of file AC_AttitudeControl_Heli.h.

Here is the call graph for this function:

◆ input_euler_angle_roll_pitch_euler_rate_yaw()

void AC_AttitudeControl_Heli::input_euler_angle_roll_pitch_euler_rate_yaw ( float  euler_roll_angle_cd,
float  euler_pitch_angle_cd,
float  euler_yaw_rate_cds 
)
overridevirtual

Reimplemented from AC_AttitudeControl.

Definition at line 442 of file AC_AttitudeControl_Heli.cpp.

Referenced by set_hover_roll_trim_scalar().

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

◆ input_euler_angle_roll_pitch_yaw()

void AC_AttitudeControl_Heli::input_euler_angle_roll_pitch_yaw ( float  euler_roll_angle_cd,
float  euler_pitch_angle_cd,
float  euler_yaw_angle_cd,
bool  slew_yaw 
)
overridevirtual

Reimplemented from AC_AttitudeControl.

Definition at line 451 of file AC_AttitudeControl_Heli.cpp.

Referenced by set_hover_roll_trim_scalar().

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

◆ input_rate_bf_roll_pitch_yaw()

void AC_AttitudeControl_Heli::input_rate_bf_roll_pitch_yaw ( float  roll_rate_bf_cds,
float  pitch_rate_bf_cds,
float  yaw_rate_bf_cds 
)
overridevirtual

Reimplemented from AC_AttitudeControl.

Definition at line 236 of file AC_AttitudeControl_Heli.cpp.

Referenced by get_rate_yaw_pid().

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

◆ integrate_bf_rate_error_to_angle_errors()

void AC_AttitudeControl_Heli::integrate_bf_rate_error_to_angle_errors ( )

Definition at line 224 of file AC_AttitudeControl_Heli.cpp.

Referenced by get_rate_yaw_pid(), and passthrough_bf_roll_pitch_rate_yaw().

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

◆ passthrough_bf_roll_pitch_rate_yaw()

void AC_AttitudeControl_Heli::passthrough_bf_roll_pitch_rate_yaw ( float  roll_passthrough,
float  pitch_passthrough,
float  yaw_rate_bf_cds 
)
overridevirtual

Reimplemented from AC_AttitudeControl.

Definition at line 157 of file AC_AttitudeControl_Heli.cpp.

Referenced by get_rate_yaw_pid().

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

◆ rate_bf_to_motor_roll_pitch()

void AC_AttitudeControl_Heli::rate_bf_to_motor_roll_pitch ( const Vector3f rate_rads,
float  rate_roll_target_rads,
float  rate_pitch_target_rads 
)
private

Definition at line 284 of file AC_AttitudeControl_Heli.cpp.

Referenced by rate_controller_run().

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

◆ rate_controller_run()

void AC_AttitudeControl_Heli::rate_controller_run ( )
virtual

Implements AC_AttitudeControl.

Definition at line 249 of file AC_AttitudeControl_Heli.cpp.

Referenced by get_rate_yaw_pid().

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

◆ rate_target_to_motor_yaw()

float AC_AttitudeControl_Heli::rate_target_to_motor_yaw ( float  rate_yaw_actual_rads,
float  rate_yaw_rads 
)
overrideprivatevirtual

Reimplemented from AC_AttitudeControl.

Definition at line 381 of file AC_AttitudeControl_Heli.cpp.

Referenced by rate_controller_run().

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

◆ set_hover_roll_trim_scalar()

void AC_AttitudeControl_Heli::set_hover_roll_trim_scalar ( float  scalar)
inlineoverridevirtual

Reimplemented from AC_AttitudeControl.

Definition at line 94 of file AC_AttitudeControl_Heli.h.

Here is the call graph for this function:

◆ set_inverted_flight()

void AC_AttitudeControl_Heli::set_inverted_flight ( bool  inverted)
inlineoverridevirtual

Reimplemented from AC_AttitudeControl.

Definition at line 106 of file AC_AttitudeControl_Heli.h.

◆ set_throttle_out()

void AC_AttitudeControl_Heli::set_throttle_out ( float  throttle_in,
bool  apply_angle_boost,
float  filt_cutoff 
)
overridevirtual

Implements AC_AttitudeControl.

Definition at line 431 of file AC_AttitudeControl_Heli.cpp.

Referenced by set_hover_roll_trim_scalar().

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

◆ update_althold_lean_angle_max()

void AC_AttitudeControl_Heli::update_althold_lean_angle_max ( float  throttle_in)
overridevirtual

Implements AC_AttitudeControl.

Definition at line 269 of file AC_AttitudeControl_Heli.cpp.

Referenced by get_rate_yaw_pid(), and set_throttle_out().

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

◆ use_flybar_passthrough()

void AC_AttitudeControl_Heli::use_flybar_passthrough ( bool  passthrough,
bool  tail_passthrough 
)
inlineoverridevirtual

Reimplemented from AC_AttitudeControl.

Definition at line 85 of file AC_AttitudeControl_Heli.h.

◆ use_leaky_i()

void AC_AttitudeControl_Heli::use_leaky_i ( bool  leaky_i)
inlineoverridevirtual

Reimplemented from AC_AttitudeControl.

Definition at line 81 of file AC_AttitudeControl_Heli.h.

Member Data Documentation

◆ _att_error_rot_vec_rad

Vector3f AC_AttitudeControl_Heli::_att_error_rot_vec_rad
private

◆ _flags_heli

struct AC_AttitudeControl_Heli::AttControlHeliFlags AC_AttitudeControl_Heli::_flags_heli
private

◆ _hover_roll_trim

AP_Int16 AC_AttitudeControl_Heli::_hover_roll_trim
private

Definition at line 159 of file AC_AttitudeControl_Heli.h.

Referenced by get_roll_trim_rad().

◆ _hover_roll_trim_scalar

float AC_AttitudeControl_Heli::_hover_roll_trim_scalar = 0
private

Definition at line 149 of file AC_AttitudeControl_Heli.h.

Referenced by get_roll_trim_rad(), and set_hover_roll_trim_scalar().

◆ _passthrough_pitch

int16_t AC_AttitudeControl_Heli::_passthrough_pitch
private

◆ _passthrough_roll

int16_t AC_AttitudeControl_Heli::_passthrough_roll
private

◆ _passthrough_yaw

int16_t AC_AttitudeControl_Heli::_passthrough_yaw
private

◆ _pid_rate_pitch

AC_HELI_PID AC_AttitudeControl_Heli::_pid_rate_pitch
private

Definition at line 161 of file AC_AttitudeControl_Heli.h.

Referenced by get_rate_pitch_pid(), and rate_bf_to_motor_roll_pitch().

◆ _pid_rate_roll

AC_HELI_PID AC_AttitudeControl_Heli::_pid_rate_roll
private

Definition at line 160 of file AC_AttitudeControl_Heli.h.

Referenced by get_rate_roll_pid(), and rate_bf_to_motor_roll_pitch().

◆ _pid_rate_yaw

AC_HELI_PID AC_AttitudeControl_Heli::_pid_rate_yaw
private

Definition at line 162 of file AC_AttitudeControl_Heli.h.

Referenced by get_rate_yaw_pid(), and rate_target_to_motor_yaw().

◆ _piro_comp_enabled

AP_Int8 AC_AttitudeControl_Heli::_piro_comp_enabled
private

Definition at line 158 of file AC_AttitudeControl_Heli.h.

Referenced by rate_bf_to_motor_roll_pitch().

◆ pitch_feedforward_filter

LowPassFilterFloat AC_AttitudeControl_Heli::pitch_feedforward_filter
private

Definition at line 167 of file AC_AttitudeControl_Heli.h.

Referenced by rate_bf_to_motor_roll_pitch().

◆ roll_feedforward_filter

LowPassFilterFloat AC_AttitudeControl_Heli::roll_feedforward_filter
private

Definition at line 168 of file AC_AttitudeControl_Heli.h.

Referenced by rate_bf_to_motor_roll_pitch().

◆ var_info

const AP_Param::GroupInfo AC_AttitudeControl_Heli::var_info
static

Definition at line 111 of file AC_AttitudeControl_Heli.h.

Referenced by AC_AttitudeControl_Heli().

◆ yaw_acceleration_feedforward_filter

LowPassFilterFloat AC_AttitudeControl_Heli::yaw_acceleration_feedforward_filter
private

Definition at line 170 of file AC_AttitudeControl_Heli.h.

◆ yaw_velocity_feedforward_filter

LowPassFilterFloat AC_AttitudeControl_Heli::yaw_velocity_feedforward_filter
private

Definition at line 169 of file AC_AttitudeControl_Heli.h.

Referenced by rate_target_to_motor_yaw().


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