APM:Copter
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
ModeGuided Class Reference

#include <mode.h>

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

Public Member Functions

bool init (bool ignore_checks) override
 
void run () 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
 
bool in_guided_mode () const
 
void set_angle (const Quaternion &q, float climb_rate_cms, bool use_yaw_rate, float yaw_rate_rads)
 
bool set_destination (const Vector3f &destination, bool use_yaw=false, float yaw_cd=0.0, bool use_yaw_rate=false, float yaw_rate_cds=0.0, bool yaw_relative=false)
 
bool set_destination (const Location_Class &dest_loc, bool use_yaw=false, float yaw_cd=0.0, bool use_yaw_rate=false, float yaw_rate_cds=0.0, bool yaw_relative=false)
 
bool get_wp (Location_Class &loc) override
 
void set_velocity (const Vector3f &velocity, bool use_yaw=false, float yaw_cd=0.0, bool use_yaw_rate=false, float yaw_rate_cds=0.0, bool yaw_relative=false, bool log_request=true)
 
bool set_destination_posvel (const Vector3f &destination, const Vector3f &velocity, bool use_yaw=false, float yaw_cd=0.0, bool use_yaw_rate=false, float yaw_rate_cds=0.0, bool yaw_relative=false)
 
void limit_clear ()
 
void limit_init_time_and_pos ()
 
void limit_set (uint32_t timeout_ms, float alt_min_cm, float alt_max_cm, float horiz_max_cm)
 
bool limit_check ()
 
bool takeoff_start (float final_alt_above_home)
 
GuidedMode mode () const
 
void angle_control_start ()
 
void angle_control_run ()
 

Protected Member Functions

const char * name () const override
 
const char * name4 () const override
 
uint32_t wp_distance () const override
 
int32_t wp_bearing () const override
 
- Protected Member Functions inherited from Mode
virtual bool landing_gear_should_be_deployed () const
 
void update_navigation ()
 
virtual void run_autopilot ()
 
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 Member Functions

void pos_control_start ()
 
void vel_control_start ()
 
void posvel_control_start ()
 
void takeoff_run ()
 
void pos_control_run ()
 
void vel_control_run ()
 
void posvel_control_run ()
 
void set_desired_velocity_with_accel_and_fence_limits (const Vector3f &vel_des)
 
void set_yaw_state (bool use_yaw, float yaw_cd, bool use_yaw_rate, float yaw_rate_cds, bool relative_angle)
 

Private Attributes

GuidedMode guided_mode = Guided_TakeOff
 

Additional Inherited Members

- Static Public Attributes inherited from Mode
static AutoYaw auto_yaw
 
- Protected Attributes inherited from 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_t & ap
 
takeoff_state_t & takeoff_state
 
float & ekfGndSpdLimit
 
float & ekfNavVelGainScaler
 
heli_flags_t & heli_flags
 

Detailed Description

Definition at line 742 of file mode.h.

Member Function Documentation

◆ allows_arming()

bool ModeGuided::allows_arming ( bool  from_gcs) const
inlineoverridevirtual

Implements Mode.

Reimplemented in ModeFollow, ModeAvoidADSB, and ModeGuidedNoGPS.

Definition at line 753 of file mode.h.

◆ angle_control_run()

void ModeGuided::angle_control_run ( )

◆ angle_control_start()

void ModeGuided::angle_control_start ( )

◆ get_wp()

bool ModeGuided::get_wp ( Location_Class loc)
overridevirtual

Reimplemented from Mode.

◆ has_manual_throttle()

bool ModeGuided::has_manual_throttle ( ) const
inlineoverridevirtual

Implements Mode.

Reimplemented in ModeFollow, ModeAvoidADSB, and ModeGuidedNoGPS.

Definition at line 752 of file mode.h.

◆ in_guided_mode()

bool ModeGuided::in_guided_mode ( ) const
inlinevirtual

Reimplemented from Mode.

Definition at line 755 of file mode.h.

Here is the call graph for this function:

◆ init()

bool ModeGuided::init ( bool  ignore_checks)
overridevirtual

Implements Mode.

Reimplemented in ModeFollow, ModeAvoidADSB, and ModeGuidedNoGPS.

◆ is_autopilot()

bool ModeGuided::is_autopilot ( ) const
inlineoverridevirtual

Reimplemented from Mode.

Reimplemented in ModeFollow, ModeAvoidADSB, and ModeGuidedNoGPS.

Definition at line 754 of file mode.h.

◆ limit_check()

bool ModeGuided::limit_check ( )

◆ limit_clear()

void ModeGuided::limit_clear ( )

◆ limit_init_time_and_pos()

void ModeGuided::limit_init_time_and_pos ( )

◆ limit_set()

void ModeGuided::limit_set ( uint32_t  timeout_ms,
float  alt_min_cm,
float  alt_max_cm,
float  horiz_max_cm 
)

◆ mode()

GuidedMode ModeGuided::mode ( ) const
inline

Definition at line 771 of file mode.h.

◆ name()

const char* ModeGuided::name ( ) const
inlineoverrideprotectedvirtual

Implements Mode.

Reimplemented in ModeFollow, ModeAvoidADSB, and ModeGuidedNoGPS.

Definition at line 778 of file mode.h.

◆ name4()

const char* ModeGuided::name4 ( ) const
inlineoverrideprotectedvirtual

Implements Mode.

Reimplemented in ModeFollow, ModeAvoidADSB, and ModeGuidedNoGPS.

Definition at line 779 of file mode.h.

Here is the call graph for this function:

◆ pos_control_run()

void ModeGuided::pos_control_run ( )
private

◆ pos_control_start()

void ModeGuided::pos_control_start ( )
private

◆ posvel_control_run()

void ModeGuided::posvel_control_run ( )
private

◆ posvel_control_start()

void ModeGuided::posvel_control_start ( )
private

◆ requires_GPS()

bool ModeGuided::requires_GPS ( ) const
inlineoverridevirtual

Implements Mode.

Reimplemented in ModeFollow, ModeAvoidADSB, and ModeGuidedNoGPS.

Definition at line 751 of file mode.h.

◆ run()

void ModeGuided::run ( )
overridevirtual

Implements Mode.

Reimplemented in ModeFollow, ModeAvoidADSB, and ModeGuidedNoGPS.

◆ set_angle()

void ModeGuided::set_angle ( const Quaternion q,
float  climb_rate_cms,
bool  use_yaw_rate,
float  yaw_rate_rads 
)

◆ set_desired_velocity_with_accel_and_fence_limits()

void ModeGuided::set_desired_velocity_with_accel_and_fence_limits ( const Vector3f vel_des)
private

◆ set_destination() [1/2]

bool ModeGuided::set_destination ( const Vector3f destination,
bool  use_yaw = false,
float  yaw_cd = 0.0,
bool  use_yaw_rate = false,
float  yaw_rate_cds = 0.0,
bool  yaw_relative = false 
)

◆ set_destination() [2/2]

bool ModeGuided::set_destination ( const Location_Class dest_loc,
bool  use_yaw = false,
float  yaw_cd = 0.0,
bool  use_yaw_rate = false,
float  yaw_rate_cds = 0.0,
bool  yaw_relative = false 
)

◆ set_destination_posvel()

bool ModeGuided::set_destination_posvel ( const Vector3f destination,
const Vector3f velocity,
bool  use_yaw = false,
float  yaw_cd = 0.0,
bool  use_yaw_rate = false,
float  yaw_rate_cds = 0.0,
bool  yaw_relative = false 
)

◆ set_velocity()

void ModeGuided::set_velocity ( const Vector3f velocity,
bool  use_yaw = false,
float  yaw_cd = 0.0,
bool  use_yaw_rate = false,
float  yaw_rate_cds = 0.0,
bool  yaw_relative = false,
bool  log_request = true 
)

◆ set_yaw_state()

void ModeGuided::set_yaw_state ( bool  use_yaw,
float  yaw_cd,
bool  use_yaw_rate,
float  yaw_rate_cds,
bool  relative_angle 
)
private

◆ takeoff_run()

void ModeGuided::takeoff_run ( )
private

◆ takeoff_start()

bool ModeGuided::takeoff_start ( float  final_alt_above_home)

◆ vel_control_run()

void ModeGuided::vel_control_run ( )
private

◆ vel_control_start()

void ModeGuided::vel_control_start ( )
private

◆ wp_bearing()

int32_t ModeGuided::wp_bearing ( ) const
overrideprotectedvirtual

Reimplemented from Mode.

◆ wp_distance()

uint32_t ModeGuided::wp_distance ( ) const
overrideprotectedvirtual

Reimplemented from Mode.

Member Data Documentation

◆ guided_mode

GuidedMode ModeGuided::guided_mode = Guided_TakeOff
private

Definition at line 797 of file mode.h.


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