APM:Copter
Public Member Functions | Static Public Attributes | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
Copter::ModeFlowHold Class Reference
Inheritance diagram for Copter::ModeFlowHold:
[legend]
Collaboration diagram for Copter::ModeFlowHold:
[legend]

Public Member Functions

 ModeFlowHold (void)
 
bool init (bool ignore_checks) override
 
void run (void) override
 
bool requires_GPS () const override
 
bool has_manual_throttle () const override
 
bool allows_arming (bool from_gcs) const override
 
bool is_autopilot () const override
 

Static Public Attributes

static const struct AP_Param::GroupInfo var_info []
 
- Static Public Attributes inherited from Copter::Mode
static AutoYaw auto_yaw
 

Protected Member Functions

const char * name () const override
 
const char * name4 () const override
 
- Protected Member Functions inherited from Copter::Mode
virtual bool landing_gear_should_be_deployed () const
 
void update_navigation ()
 
virtual void run_autopilot ()
 
virtual uint32_t wp_distance () const
 
virtual int32_t wp_bearing () const
 
virtual bool get_wp (Location_Class &loc)
 
virtual bool in_guided_mode () const
 
void get_pilot_desired_lean_angles (float &roll_out, float &pitch_out, float angle_max, float angle_limit) const
 
bool takeoff_triggered (float target_climb_rate) const
 
void zero_throttle_and_relax_ac ()
 
int32_t get_alt_above_ground (void)
 
void land_run_horizontal_control ()
 
void land_run_vertical_control (bool pause_descent=false)
 
float get_surface_tracking_climb_rate (int16_t target_rate, float current_alt_target, float dt)
 
float get_pilot_desired_yaw_rate (int16_t stick_angle)
 
float get_pilot_desired_climb_rate (float throttle_control)
 
float get_pilot_desired_throttle (int16_t throttle_control, float thr_mid=0.0f)
 
float get_non_takeoff_throttle (void)
 
void update_simple_mode (void)
 
bool set_mode (control_mode_t mode, mode_reason_t reason)
 
void set_land_complete (bool b)
 
GCS_Coptergcs ()
 
void Log_Write_Event (uint8_t id)
 
void set_throttle_takeoff (void)
 
void takeoff_timer_start (float alt_cm)
 
void takeoff_stop (void)
 
void takeoff_get_climb_rates (float &pilot_climb_rate, float &takeoff_climb_rate)
 
float get_avoidance_adjusted_climbrate (float target_rate)
 
uint16_t get_pilot_speed_dn (void)
 

Private Types

enum  FlowHoldModeState { FlowHold_MotorStopped, FlowHold_Takeoff, FlowHold_Flying, FlowHold_Landed }
 

Private Member Functions

void flow_to_angle (Vector2f &bf_angle)
 
bool flowhold_init (bool ignore_checks)
 
void flowhold_run ()
 
void flowhold_flow_to_angle (Vector2f &angle, bool stick_input)
 
void update_height_estimate (void)
 

Private Attributes

LowPassFilterVector2f flow_filter
 
const float height_min = 0.1
 
const float height_max = 3.0
 
AP_Float flow_max
 
AC_PI_2D flow_pi_xy {0.2, 0.3, 3000, 5, 0.0025}
 
AP_Float flow_filter_hz
 
AP_Int8 flow_min_quality
 
AP_Int8 brake_rate_dps
 
float quality_filtered
 
uint8_t log_counter
 
bool limited
 
Vector2f xy_I
 
Vector2f delta_velocity_ne
 
Vector2f last_flow_rate_rps
 
uint32_t last_flow_ms
 
float last_ins_height
 
float height_offset
 
bool braking
 
uint32_t last_stick_input_ms
 

Additional Inherited Members

- Protected Attributes inherited from Copter::Mode
Parametersg
 
ParametersG2g2
 
AC_WPNav *& wp_nav
 
AC_Loiter *& loiter_nav
 
AC_PosControl *& pos_control
 
AP_InertialNavinertial_nav
 
AP_AHRSahrs
 
AC_AttitudeControl_t *& attitude_control
 
MOTOR_CLASS *& motors
 
RC_Channel *& channel_roll
 
RC_Channel *& channel_pitch
 
RC_Channel *& channel_throttle
 
RC_Channel *& channel_yaw
 
float & G_Dt
 
ap_tap
 
takeoff_state_ttakeoff_state
 
float & ekfGndSpdLimit
 
float & ekfNavVelGainScaler
 

Detailed Description

Definition at line 665 of file Copter.h.

Member Enumeration Documentation

◆ FlowHoldModeState

Enumerator
FlowHold_MotorStopped 
FlowHold_Takeoff 
FlowHold_Flying 
FlowHold_Landed 

Definition at line 687 of file Copter.h.

Constructor & Destructor Documentation

◆ ModeFlowHold()

Copter::ModeFlowHold::ModeFlowHold ( void  )

Definition at line 70 of file mode_flowhold.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ allows_arming()

bool Copter::ModeFlowHold::allows_arming ( bool  from_gcs) const
inlineoverridevirtual

Implements Copter::Mode.

Definition at line 675 of file Copter.h.

◆ flow_to_angle()

void Copter::ModeFlowHold::flow_to_angle ( Vector2f bf_angle)
private

◆ flowhold_flow_to_angle()

void Copter::ModeFlowHold::flowhold_flow_to_angle ( Vector2f angle,
bool  stick_input 
)
private

Definition at line 119 of file mode_flowhold.cpp.

Referenced by run().

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

◆ flowhold_init()

bool Copter::ModeFlowHold::flowhold_init ( bool  ignore_checks)
private

◆ flowhold_run()

void Copter::ModeFlowHold::flowhold_run ( )
private

◆ has_manual_throttle()

bool Copter::ModeFlowHold::has_manual_throttle ( ) const
inlineoverridevirtual

Implements Copter::Mode.

Definition at line 674 of file Copter.h.

◆ init()

bool Copter::ModeFlowHold::init ( bool  ignore_checks)
overridevirtual

Implements Copter::Mode.

Definition at line 78 of file mode_flowhold.cpp.

Here is the call graph for this function:

◆ is_autopilot()

bool Copter::ModeFlowHold::is_autopilot ( ) const
inlineoverridevirtual

Reimplemented from Copter::Mode.

Definition at line 676 of file Copter.h.

◆ name()

const char* Copter::ModeFlowHold::name ( ) const
inlineoverrideprotectedvirtual

Implements Copter::Mode.

Definition at line 681 of file Copter.h.

◆ name4()

const char* Copter::ModeFlowHold::name4 ( ) const
inlineoverrideprotectedvirtual

Implements Copter::Mode.

Definition at line 682 of file Copter.h.

◆ requires_GPS()

bool Copter::ModeFlowHold::requires_GPS ( ) const
inlineoverridevirtual

Implements Copter::Mode.

Definition at line 673 of file Copter.h.

◆ run()

void Copter::ModeFlowHold::run ( void  )
overridevirtual

Implements Copter::Mode.

Definition at line 219 of file mode_flowhold.cpp.

Here is the call graph for this function:

◆ update_height_estimate()

void Copter::ModeFlowHold::update_height_estimate ( void  )
private

Definition at line 376 of file mode_flowhold.cpp.

Referenced by run().

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

Member Data Documentation

◆ brake_rate_dps

AP_Int8 Copter::ModeFlowHold::brake_rate_dps
private

Definition at line 714 of file Copter.h.

Referenced by flowhold_flow_to_angle().

◆ braking

bool Copter::ModeFlowHold::braking
private

Definition at line 735 of file Copter.h.

Referenced by flowhold_flow_to_angle().

◆ delta_velocity_ne

Vector2f Copter::ModeFlowHold::delta_velocity_ne
private

Definition at line 723 of file Copter.h.

Referenced by update_height_estimate().

◆ flow_filter

LowPassFilterVector2f Copter::ModeFlowHold::flow_filter
private

Definition at line 697 of file Copter.h.

Referenced by flowhold_flow_to_angle(), init(), and run().

◆ flow_filter_hz

AP_Float Copter::ModeFlowHold::flow_filter_hz
private

Definition at line 712 of file Copter.h.

Referenced by init(), and run().

◆ flow_max

AP_Float Copter::ModeFlowHold::flow_max
private

Definition at line 710 of file Copter.h.

Referenced by flowhold_flow_to_angle().

◆ flow_min_quality

AP_Int8 Copter::ModeFlowHold::flow_min_quality
private

Definition at line 713 of file Copter.h.

Referenced by run().

◆ flow_pi_xy

AC_PI_2D Copter::ModeFlowHold::flow_pi_xy {0.2, 0.3, 3000, 5, 0.0025}
private

Definition at line 711 of file Copter.h.

Referenced by flowhold_flow_to_angle(), init(), and run().

◆ height_max

const float Copter::ModeFlowHold::height_max = 3.0
private

Definition at line 708 of file Copter.h.

Referenced by flowhold_flow_to_angle().

◆ height_min

const float Copter::ModeFlowHold::height_min = 0.1
private

Definition at line 705 of file Copter.h.

Referenced by flowhold_flow_to_angle(), and update_height_estimate().

◆ height_offset

float Copter::ModeFlowHold::height_offset
private

Definition at line 732 of file Copter.h.

Referenced by flowhold_flow_to_angle(), init(), and update_height_estimate().

◆ last_flow_ms

uint32_t Copter::ModeFlowHold::last_flow_ms
private

Definition at line 729 of file Copter.h.

Referenced by update_height_estimate().

◆ last_flow_rate_rps

Vector2f Copter::ModeFlowHold::last_flow_rate_rps
private

Definition at line 726 of file Copter.h.

Referenced by update_height_estimate().

◆ last_ins_height

float Copter::ModeFlowHold::last_ins_height
private

Definition at line 731 of file Copter.h.

Referenced by init(), and update_height_estimate().

◆ last_stick_input_ms

uint32_t Copter::ModeFlowHold::last_stick_input_ms
private

Definition at line 738 of file Copter.h.

Referenced by flowhold_flow_to_angle().

◆ limited

bool Copter::ModeFlowHold::limited
private

Definition at line 719 of file Copter.h.

Referenced by flowhold_flow_to_angle(), and init().

◆ log_counter

uint8_t Copter::ModeFlowHold::log_counter
private

Definition at line 718 of file Copter.h.

Referenced by flowhold_flow_to_angle().

◆ quality_filtered

float Copter::ModeFlowHold::quality_filtered
private

Definition at line 716 of file Copter.h.

Referenced by flowhold_flow_to_angle(), init(), and run().

◆ var_info

const AP_Param::GroupInfo Copter::ModeFlowHold::var_info
static

Definition at line 678 of file Copter.h.

Referenced by ModeFlowHold().

◆ xy_I

Vector2f Copter::ModeFlowHold::xy_I
private

Definition at line 720 of file Copter.h.

Referenced by flowhold_flow_to_angle().


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