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

Public Member Functions

bool init (bool ignore_checks) override
 
void run () override
 
void run (bool disarm_on_land)
 
bool requires_GPS () const override
 
bool has_manual_throttle () const override
 
bool allows_arming (bool from_gcs) const override
 
bool is_autopilot () const override
 
RTLState state ()
 
bool state_complete ()
 
bool landing_gear_should_be_deployed () const override
 
void restart_without_terrain ()
 

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
 
void descent_start ()
 
void descent_run ()
 
void land_start ()
 
void land_run (bool disarm_on_land)
 
void set_descent_target_alt (uint32_t alt)
 
- Protected Member Functions inherited from Copter::Mode
void update_navigation ()
 
virtual void run_autopilot ()
 
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 Member Functions

void climb_start ()
 
void return_start ()
 
void climb_return_run ()
 
void loiterathome_start ()
 
void loiterathome_run ()
 
void build_path (bool terrain_following_allowed)
 
void compute_return_target (bool terrain_following_allowed)
 

Private Attributes

RTLState _state = RTL_InitialClimb
 
bool _state_complete = false
 
struct {
   Location_Class   origin_point
 
   Location_Class   climb_target
 
   Location_Class   return_target
 
   Location_Class   descent_target
 
   bool   land
 
   bool   terrain_used
 
rtl_path
 
uint32_t _loiter_start_time = 0
 

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 928 of file Copter.h.

Member Function Documentation

◆ allows_arming()

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

Implements Copter::Mode.

Reimplemented in Copter::ModeSmartRTL.

Definition at line 942 of file Copter.h.

◆ build_path()

void Copter::ModeRTL::build_path ( bool  terrain_following_allowed)
private

Definition at line 381 of file mode_rtl.cpp.

Referenced by init(), and restart_without_terrain().

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

◆ climb_return_run()

void Copter::ModeRTL::climb_return_run ( )
private

Definition at line 131 of file mode_rtl.cpp.

Referenced by run().

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

◆ climb_start()

void Copter::ModeRTL::climb_start ( )
private

Definition at line 91 of file mode_rtl.cpp.

Referenced by init(), and restart_without_terrain().

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

◆ compute_return_target()

void Copter::ModeRTL::compute_return_target ( bool  terrain_following_allowed)
private

Definition at line 406 of file mode_rtl.cpp.

Referenced by build_path().

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

◆ descent_run()

void Copter::ModeRTL::descent_run ( )
protected

Definition at line 258 of file mode_rtl.cpp.

Referenced by run(), and Copter::ModeSmartRTL::run().

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

◆ descent_start()

void Copter::ModeRTL::descent_start ( )
protected

Definition at line 241 of file mode_rtl.cpp.

Referenced by Copter::ModeSmartRTL::pre_land_position_run(), and run().

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

◆ has_manual_throttle()

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

Implements Copter::Mode.

Reimplemented in Copter::ModeSmartRTL.

Definition at line 941 of file Copter.h.

◆ init()

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

Implements Copter::Mode.

Reimplemented in Copter::ModeSmartRTL.

Definition at line 11 of file mode_rtl.cpp.

Here is the call graph for this function:

◆ is_autopilot()

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

Reimplemented from Copter::Mode.

Reimplemented in Copter::ModeSmartRTL.

Definition at line 943 of file Copter.h.

◆ land_run()

void Copter::ModeRTL::land_run ( bool  disarm_on_land)
protected

Definition at line 353 of file mode_rtl.cpp.

Referenced by run(), and Copter::ModeSmartRTL::run().

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

◆ land_start()

void Copter::ModeRTL::land_start ( )
protected

Definition at line 320 of file mode_rtl.cpp.

Referenced by Copter::ModeSmartRTL::pre_land_position_run(), and run().

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

◆ landing_gear_should_be_deployed()

bool Copter::ModeRTL::landing_gear_should_be_deployed ( ) const
overridevirtual

Reimplemented from Copter::Mode.

Definition at line 338 of file mode_rtl.cpp.

◆ loiterathome_run()

void Copter::ModeRTL::loiterathome_run ( )
private

Definition at line 189 of file mode_rtl.cpp.

Referenced by run().

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

◆ loiterathome_start()

void Copter::ModeRTL::loiterathome_start ( )
private

Definition at line 173 of file mode_rtl.cpp.

Referenced by run().

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

◆ name()

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

Implements Copter::Mode.

Reimplemented in Copter::ModeSmartRTL.

Definition at line 956 of file Copter.h.

◆ name4()

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

Implements Copter::Mode.

Reimplemented in Copter::ModeSmartRTL.

Definition at line 957 of file Copter.h.

◆ requires_GPS()

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

Implements Copter::Mode.

Reimplemented in Copter::ModeSmartRTL.

Definition at line 940 of file Copter.h.

◆ restart_without_terrain()

void Copter::ModeRTL::restart_without_terrain ( )

Definition at line 25 of file mode_rtl.cpp.

Referenced by Copter::failsafe_terrain_on_event(), and return_start().

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

◆ return_start()

void Copter::ModeRTL::return_start ( )
private

Definition at line 115 of file mode_rtl.cpp.

Referenced by run().

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

◆ run() [1/2]

void Copter::ModeRTL::run ( void  )
inlineoverridevirtual

Implements Copter::Mode.

Reimplemented in Copter::ModeSmartRTL.

Definition at line 935 of file Copter.h.

◆ run() [2/2]

void Copter::ModeRTL::run ( bool  disarm_on_land)

Definition at line 38 of file mode_rtl.cpp.

Here is the call graph for this function:

◆ set_descent_target_alt()

void Copter::ModeRTL::set_descent_target_alt ( uint32_t  alt)
inlineprotected

Definition at line 967 of file Copter.h.

Referenced by Copter::ModeSmartRTL::pre_land_position_run().

Here is the caller graph for this function:

◆ state()

RTLState Copter::ModeRTL::state ( )
inline

Definition at line 945 of file Copter.h.

◆ state_complete()

bool Copter::ModeRTL::state_complete ( )
inline

Definition at line 948 of file Copter.h.

◆ wp_bearing()

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

Reimplemented from Copter::Mode.

Reimplemented in Copter::ModeSmartRTL.

Definition at line 486 of file mode_rtl.cpp.

Here is the call graph for this function:

◆ wp_distance()

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

Reimplemented from Copter::Mode.

Reimplemented in Copter::ModeSmartRTL.

Definition at line 481 of file mode_rtl.cpp.

Here is the call graph for this function:

Member Data Documentation

◆ _loiter_start_time

uint32_t Copter::ModeRTL::_loiter_start_time = 0
private

Definition at line 994 of file Copter.h.

Referenced by loiterathome_run(), and loiterathome_start().

◆ _state

RTLState Copter::ModeRTL::_state = RTL_InitialClimb
private

◆ _state_complete

bool Copter::ModeRTL::_state_complete = false
private

◆ climb_target

Location_Class Copter::ModeRTL::climb_target

Definition at line 986 of file Copter.h.

◆ descent_target

Location_Class Copter::ModeRTL::descent_target

Definition at line 988 of file Copter.h.

◆ land

bool Copter::ModeRTL::land

Definition at line 989 of file Copter.h.

◆ origin_point

Location_Class Copter::ModeRTL::origin_point

Definition at line 985 of file Copter.h.

◆ return_target

Location_Class Copter::ModeRTL::return_target

Definition at line 987 of file Copter.h.

◆ rtl_path

struct { ... } Copter::ModeRTL::rtl_path

◆ terrain_used

bool Copter::ModeRTL::terrain_used

Definition at line 990 of file Copter.h.


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