APM:Copter
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
Copter::ModeGuided Class Reference
Inheritance diagram for Copter::ModeGuided:
[legend]
Collaboration diagram for Copter::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 Copter::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 Copter::Mode
static AutoYaw auto_yaw
 
- 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 743 of file Copter.h.

Member Function Documentation

◆ allows_arming()

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

Implements Copter::Mode.

Reimplemented in Copter::ModeFollow, Copter::ModeAvoidADSB, and Copter::ModeGuidedNoGPS.

Definition at line 754 of file Copter.h.

◆ angle_control_run()

void Copter::ModeGuided::angle_control_run ( )

Definition at line 578 of file mode_guided.cpp.

Referenced by Copter::ModeGuidedNoGPS::run().

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

◆ angle_control_start()

void Copter::ModeGuided::angle_control_start ( )

Definition at line 147 of file mode_guided.cpp.

Referenced by Copter::ModeGuidedNoGPS::init().

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

◆ get_wp()

bool Copter::ModeGuided::get_wp ( Location_Class loc)
overridevirtual

Reimplemented from Copter::Mode.

Definition at line 206 of file mode_guided.cpp.

◆ has_manual_throttle()

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

Implements Copter::Mode.

Reimplemented in Copter::ModeFollow, Copter::ModeAvoidADSB, and Copter::ModeGuidedNoGPS.

Definition at line 753 of file Copter.h.

◆ in_guided_mode()

bool Copter::ModeGuided::in_guided_mode ( ) const
inlinevirtual

Reimplemented from Copter::Mode.

Definition at line 756 of file Copter.h.

◆ init()

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

Implements Copter::Mode.

Reimplemented in Copter::ModeFollow, Copter::ModeAvoidADSB, and Copter::ModeGuidedNoGPS.

Definition at line 39 of file mode_guided.cpp.

Referenced by Copter::ModeAvoidADSB::init(), and Copter::ModeFollow::init().

Here is the caller graph for this function:

◆ is_autopilot()

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

Reimplemented from Copter::Mode.

Reimplemented in Copter::ModeFollow, Copter::ModeAvoidADSB, and Copter::ModeGuidedNoGPS.

Definition at line 755 of file Copter.h.

◆ limit_check()

bool Copter::ModeGuided::limit_check ( )

Definition at line 712 of file mode_guided.cpp.

Here is the call graph for this function:

◆ limit_clear()

void Copter::ModeGuided::limit_clear ( )

Definition at line 682 of file mode_guided.cpp.

◆ limit_init_time_and_pos()

void Copter::ModeGuided::limit_init_time_and_pos ( )

Definition at line 701 of file mode_guided.cpp.

Here is the call graph for this function:

◆ limit_set()

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

Definition at line 691 of file mode_guided.cpp.

◆ mode()

GuidedMode Copter::ModeGuided::mode ( ) const
inline

Definition at line 772 of file Copter.h.

◆ name()

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

Implements Copter::Mode.

Reimplemented in Copter::ModeFollow, Copter::ModeAvoidADSB, and Copter::ModeGuidedNoGPS.

Definition at line 779 of file Copter.h.

◆ name4()

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

Implements Copter::Mode.

Reimplemented in Copter::ModeFollow, Copter::ModeAvoidADSB, and Copter::ModeGuidedNoGPS.

Definition at line 780 of file Copter.h.

◆ pos_control_run()

void Copter::ModeGuided::pos_control_run ( )
private

Definition at line 414 of file mode_guided.cpp.

Here is the call graph for this function:

◆ pos_control_start()

void Copter::ModeGuided::pos_control_start ( )
private

Definition at line 82 of file mode_guided.cpp.

◆ posvel_control_run()

void Copter::ModeGuided::posvel_control_run ( )
private

Definition at line 510 of file mode_guided.cpp.

Here is the call graph for this function:

◆ posvel_control_start()

void Copter::ModeGuided::posvel_control_start ( )
private

Definition at line 120 of file mode_guided.cpp.

◆ requires_GPS()

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

Implements Copter::Mode.

Reimplemented in Copter::ModeFollow, Copter::ModeAvoidADSB, and Copter::ModeGuidedNoGPS.

Definition at line 752 of file Copter.h.

◆ run()

void Copter::ModeGuided::run ( void  )
overridevirtual

Implements Copter::Mode.

Reimplemented in Copter::ModeFollow, Copter::ModeAvoidADSB, and Copter::ModeGuidedNoGPS.

Definition at line 334 of file mode_guided.cpp.

Referenced by Copter::ModeAvoidADSB::run(), and Copter::ModeFollow::run().

Here is the caller graph for this function:

◆ set_angle()

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

Definition at line 303 of file mode_guided.cpp.

Here is the call graph for this function:

◆ set_desired_velocity_with_accel_and_fence_limits()

void Copter::ModeGuided::set_desired_velocity_with_accel_and_fence_limits ( const Vector3f vel_des)
private

Definition at line 636 of file mode_guided.cpp.

Here is the call graph for this function:

◆ set_destination() [1/2]

bool Copter::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 
)

Definition at line 178 of file mode_guided.cpp.

◆ set_destination() [2/2]

bool Copter::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 
)

Definition at line 217 of file mode_guided.cpp.

◆ set_destination_posvel()

bool Copter::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 
)

Definition at line 271 of file mode_guided.cpp.

Here is the call graph for this function:

◆ set_velocity()

void Copter::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 
)

Definition at line 250 of file mode_guided.cpp.

Referenced by Copter::ModeFollow::run(), and Copter::ModeAvoidADSB::set_velocity().

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

◆ set_yaw_state()

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

Definition at line 670 of file mode_guided.cpp.

◆ takeoff_run()

void Copter::ModeGuided::takeoff_run ( )
private

Definition at line 368 of file mode_guided.cpp.

Here is the call graph for this function:

◆ takeoff_start()

bool Copter::ModeGuided::takeoff_start ( float  final_alt_above_home)

Definition at line 54 of file mode_guided.cpp.

Referenced by Copter::do_user_takeoff().

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

◆ vel_control_run()

void Copter::ModeGuided::vel_control_run ( )
private

Definition at line 456 of file mode_guided.cpp.

Here is the call graph for this function:

◆ vel_control_start()

void Copter::ModeGuided::vel_control_start ( )
private

Definition at line 102 of file mode_guided.cpp.

◆ wp_bearing()

int32_t Copter::ModeGuided::wp_bearing ( ) const
overrideprotectedvirtual

Reimplemented from Copter::Mode.

Definition at line 759 of file mode_guided.cpp.

◆ wp_distance()

uint32_t Copter::ModeGuided::wp_distance ( ) const
overrideprotectedvirtual

Reimplemented from Copter::Mode.

Definition at line 745 of file mode_guided.cpp.

Member Data Documentation

◆ guided_mode

GuidedMode Copter::ModeGuided::guided_mode = Guided_TakeOff
private

Definition at line 798 of file Copter.h.


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