APM:Libraries
Public Types | Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | List of all members
AP_Motors6DOF Class Reference

#include <AP_Motors6DOF.h>

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

Public Types

enum  sub_frame_t {
  SUB_FRAME_BLUEROV1, SUB_FRAME_VECTORED, SUB_FRAME_VECTORED_6DOF, SUB_FRAME_VECTORED_6DOF_90DEG,
  SUB_FRAME_SIMPLEROV_3, SUB_FRAME_SIMPLEROV_4, SUB_FRAME_SIMPLEROV_5, SUB_FRAME_CUSTOM
}
 
- Public Types inherited from AP_MotorsMulticopter
enum  spool_up_down_mode {
  SHUT_DOWN = 0, SPIN_WHEN_ARMED = 1, SPOOL_UP = 2, THROTTLE_UNLIMITED = 3,
  SPOOL_DOWN = 4
}
 
- Public Types inherited from AP_Motors
enum  motor_frame_class {
  MOTOR_FRAME_UNDEFINED = 0, MOTOR_FRAME_QUAD = 1, MOTOR_FRAME_HEXA = 2, MOTOR_FRAME_OCTA = 3,
  MOTOR_FRAME_OCTAQUAD = 4, MOTOR_FRAME_Y6 = 5, MOTOR_FRAME_HELI = 6, MOTOR_FRAME_TRI = 7,
  MOTOR_FRAME_SINGLE = 8, MOTOR_FRAME_COAX = 9, MOTOR_FRAME_TAILSITTER = 10, MOTOR_FRAME_HELI_DUAL = 11,
  MOTOR_FRAME_DODECAHEXA = 12, MOTOR_FRAME_HELI_QUAD = 13
}
 
enum  motor_frame_type {
  MOTOR_FRAME_TYPE_PLUS = 0, MOTOR_FRAME_TYPE_X = 1, MOTOR_FRAME_TYPE_V = 2, MOTOR_FRAME_TYPE_H = 3,
  MOTOR_FRAME_TYPE_VTAIL = 4, MOTOR_FRAME_TYPE_ATAIL = 5, MOTOR_FRAME_TYPE_Y6B = 10, MOTOR_FRAME_TYPE_Y6F = 11
}
 
enum  spool_up_down_desired { DESIRED_SHUT_DOWN = 0, DESIRED_SPIN_WHEN_ARMED = 1, DESIRED_THROTTLE_UNLIMITED = 2 }
 
enum  pwm_type {
  PWM_TYPE_NORMAL = 0, PWM_TYPE_ONESHOT = 1, PWM_TYPE_ONESHOT125 = 2, PWM_TYPE_BRUSHED = 3,
  PWM_TYPE_DSHOT150 = 4, PWM_TYPE_DSHOT300 = 5, PWM_TYPE_DSHOT600 = 6, PWM_TYPE_DSHOT1200 = 7
}
 

Public Member Functions

 AP_Motors6DOF (uint16_t loop_rate, uint16_t speed_hz=AP_MOTORS_SPEED_DEFAULT)
 
void setup_motors (motor_frame_class frame_class, motor_frame_type frame_type) override
 
void output_min () override
 
int16_t calc_thrust_to_pwm (float thrust_in) const
 
void output_to_motors () override
 
- Public Member Functions inherited from AP_MotorsMatrix
 AP_MotorsMatrix (uint16_t loop_rate, uint16_t speed_hz=AP_MOTORS_SPEED_DEFAULT)
 Constructor. More...
 
void init (motor_frame_class frame_class, motor_frame_type frame_type)
 
void set_frame_class_and_type (motor_frame_class frame_class, motor_frame_type frame_type)
 
void set_update_rate (uint16_t speed_hz)
 
void output_test (uint8_t motor_seq, int16_t pwm)
 
void output_to_motors ()
 
uint16_t get_motor_mask ()
 
- Public Member Functions inherited from AP_MotorsMulticopter
 AP_MotorsMulticopter (uint16_t loop_rate, uint16_t speed_hz=AP_MOTORS_SPEED_DEFAULT)
 
virtual void output ()
 
void output_min ()
 
void set_yaw_headroom (int16_t pwm)
 
void set_throttle_range (int16_t radio_min, int16_t radio_max)
 
void update_throttle_hover (float dt)
 
virtual float get_throttle_hover () const
 
void set_throttle_passthrough_for_esc_calibration (float throttle_input)
 
float get_lift_max ()
 
float get_batt_voltage_filt () const
 
float get_throttle_limit () const
 
float get_throttle_thrust_max () const
 
bool spool_up_complete () const
 
virtual void output_motor_mask (float thrust, uint8_t mask)
 
int16_t get_pwm_output_min () const
 
int16_t get_pwm_output_max () const
 
 FUNCTOR_TYPEDEF (thrust_compensation_fn_t, void, float *, uint8_t)
 
void set_thrust_compensation_callback (thrust_compensation_fn_t callback)
 
- Public Member Functions inherited from AP_Motors
 AP_Motors (uint16_t loop_rate, uint16_t speed_hz=AP_MOTORS_SPEED_DEFAULT)
 
bool initialised_ok () const
 
bool armed () const
 
void armed (bool arm)
 
void set_interlock (bool set)
 
bool get_interlock () const
 
void set_roll (float roll_in)
 
void set_pitch (float pitch_in)
 
void set_yaw (float yaw_in)
 
void set_throttle (float throttle_in)
 
void set_throttle_avg_max (float throttle_avg_max)
 
void set_throttle_filter_cutoff (float filt_hz)
 
void set_forward (float forward_in)
 
void set_lateral (float lateral_in)
 
float get_roll () const
 
float get_pitch () const
 
float get_yaw () const
 
float get_throttle () const
 
float get_throttle_bidirectional () const
 
float get_forward () const
 
float get_lateral () const
 
virtual void set_desired_spool_state (enum spool_up_down_desired spool)
 
enum spool_up_down_desired get_desired_spool_state (void) const
 
void set_air_density_ratio (float ratio)
 
virtual void init (motor_frame_class frame_class, motor_frame_type frame_type)=0
 
virtual void set_frame_class_and_type (motor_frame_class frame_class, motor_frame_type frame_type)=0
 
void set_radio_passthrough (float roll_input, float pitch_input, float throttle_input, float yaw_input)
 
void set_loop_rate (uint16_t loop_rate)
 
pwm_type get_pwm_type (void) const
 

Static Public Attributes

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

Protected Member Functions

float get_current_limit_max_throttle () override
 
void add_motor_raw_6dof (int8_t motor_num, float roll_fac, float pitch_fac, float yaw_fac, float climb_fac, float forward_fac, float lat_fac, uint8_t testing_order)
 
void output_armed_stabilizing () override
 
void output_armed_stabilizing_vectored ()
 
void output_armed_stabilizing_vectored_6dof ()
 
- Protected Member Functions inherited from AP_MotorsMatrix
void output_armed_stabilizing ()
 
void add_motor_raw (int8_t motor_num, float roll_fac, float pitch_fac, float yaw_fac, uint8_t testing_order)
 
void add_motor (int8_t motor_num, float angle_degrees, float yaw_factor, uint8_t testing_order)
 
void add_motor (int8_t motor_num, float roll_factor_in_degrees, float pitch_factor_in_degrees, float yaw_factor, uint8_t testing_order)
 
void remove_motor (int8_t motor_num)
 
virtual void setup_motors (motor_frame_class frame_class, motor_frame_type frame_type)
 
void normalise_rpy_factors ()
 
void thrust_compensation (void) override
 
- Protected Member Functions inherited from AP_MotorsMulticopter
void output_logic ()
 
virtual void update_throttle_filter ()
 
float apply_thrust_curve_and_volt_scaling (float thrust) const
 
void update_lift_max_from_batt_voltage ()
 
float get_compensation_gain () const
 
int16_t calc_thrust_to_pwm (float thrust_in) const
 
int16_t calc_spin_up_to_pwm () const
 
virtual void output_boost_throttle (void)
 
void save_params_on_disarm ()
 
- Protected Member Functions inherited from AP_Motors
virtual void rc_write (uint8_t chan, uint16_t pwm)
 
virtual void rc_write_angle (uint8_t chan, int16_t angle_cd)
 
virtual void rc_set_freq (uint32_t mask, uint16_t freq_hz)
 
virtual uint32_t rc_map_mask (uint32_t mask) const
 
void add_motor_num (int8_t motor_num)
 
int16_t calc_pwm_output_1to1 (float input, const SRV_Channel *servo)
 
int16_t calc_pwm_output_0to1 (float input, const SRV_Channel *servo)
 

Protected Attributes

AP_Int8 _motor_reverse [AP_MOTORS_MAX_NUM_MOTORS]
 
AP_Float _forwardVerticalCouplingFactor
 
float _throttle_factor [AP_MOTORS_MAX_NUM_MOTORS]
 
float _forward_factor [AP_MOTORS_MAX_NUM_MOTORS]
 
float _lateral_factor [AP_MOTORS_MAX_NUM_MOTORS]
 
float _output_limited = 1.0f
 
float _batt_current_last = 0.0f
 
- Protected Attributes inherited from AP_MotorsMatrix
float _roll_factor [AP_MOTORS_MAX_NUM_MOTORS]
 
float _pitch_factor [AP_MOTORS_MAX_NUM_MOTORS]
 
float _yaw_factor [AP_MOTORS_MAX_NUM_MOTORS]
 
float _thrust_rpyt_out [AP_MOTORS_MAX_NUM_MOTORS]
 
uint8_t _test_order [AP_MOTORS_MAX_NUM_MOTORS]
 
motor_frame_class _last_frame_class
 
motor_frame_type _last_frame_type
 
- Protected Attributes inherited from AP_MotorsMulticopter
AP_Int16 _yaw_headroom
 
AP_Float _thrust_curve_expo
 
AP_Float _spin_min
 
AP_Float _spin_max
 
AP_Float _spin_arm
 
AP_Float _batt_voltage_max
 
AP_Float _batt_voltage_min
 
AP_Float _batt_current_max
 
AP_Float _batt_current_time_constant
 
AP_Int8 _batt_idx
 
AP_Int16 _pwm_min
 
AP_Int16 _pwm_max
 
AP_Float _throttle_hover
 
AP_Int8 _throttle_hover_learn
 
AP_Int8 _disarm_disable_pwm
 
AP_Float _yaw_servo_angle_max_deg
 
AP_Float _spool_up_time
 
AP_Float _boost_scale
 
bool motor_enabled [AP_MOTORS_MAX_NUM_MOTORS]
 
int16_t _throttle_radio_min
 
int16_t _throttle_radio_max
 
spool_up_down_mode _spool_mode
 
float _spin_up_ratio
 
LowPassFilterFloat _batt_voltage_filt
 
float _lift_max
 
float _throttle_limit
 
float _throttle_thrust_max
 
uint16_t _disarm_safety_timer
 
thrust_compensation_fn_t _thrust_compensation_callback
 
- Protected Attributes inherited from AP_Motors
struct AP_Motors::AP_Motors_flags _flags
 
uint16_t _loop_rate
 
uint16_t _speed_hz
 
float _roll_in
 
float _pitch_in
 
float _yaw_in
 
float _throttle_in
 
float _forward_in
 
float _lateral_in
 
float _throttle_avg_max
 
LowPassFilterFloat _throttle_filter
 
spool_up_down_desired _spool_desired
 
float _air_density_ratio
 
uint16_t _motor_fast_mask
 
float _roll_radio_passthrough
 
float _pitch_radio_passthrough
 
float _throttle_radio_passthrough
 
float _yaw_radio_passthrough
 
AP_Int8 _pwm_type
 

Additional Inherited Members

- Static Public Member Functions inherited from AP_Motors
static AP_Motorsget_instance (void)
 
- Public Attributes inherited from AP_Motors
struct AP_Motors::AP_Motors_limit limit
 
- Protected Types inherited from AP_MotorsMulticopter
enum  HoverLearn { HOVER_LEARN_DISABLED = 0, HOVER_LEARN_ONLY = 1, HOVER_LEARN_AND_SAVE = 2 }
 

Detailed Description

Definition at line 12 of file AP_Motors6DOF.h.

Member Enumeration Documentation

◆ sub_frame_t

Enumerator
SUB_FRAME_BLUEROV1 
SUB_FRAME_VECTORED 
SUB_FRAME_VECTORED_6DOF 
SUB_FRAME_VECTORED_6DOF_90DEG 
SUB_FRAME_SIMPLEROV_3 
SUB_FRAME_SIMPLEROV_4 
SUB_FRAME_SIMPLEROV_5 
SUB_FRAME_CUSTOM 

Definition at line 21 of file AP_Motors6DOF.h.

Constructor & Destructor Documentation

◆ AP_Motors6DOF()

AP_Motors6DOF::AP_Motors6DOF ( uint16_t  loop_rate,
uint16_t  speed_hz = AP_MOTORS_SPEED_DEFAULT 
)
inline

Definition at line 15 of file AP_Motors6DOF.h.

Here is the call graph for this function:

Member Function Documentation

◆ add_motor_raw_6dof()

void AP_Motors6DOF::add_motor_raw_6dof ( int8_t  motor_num,
float  roll_fac,
float  pitch_fac,
float  yaw_fac,
float  climb_fac,
float  forward_fac,
float  lat_fac,
uint8_t  testing_order 
)
protected

Definition at line 191 of file AP_Motors6DOF.cpp.

Referenced by setup_motors().

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

◆ calc_thrust_to_pwm()

int16_t AP_Motors6DOF::calc_thrust_to_pwm ( float  thrust_in) const

Definition at line 222 of file AP_Motors6DOF.cpp.

Referenced by output_to_motors().

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

◆ get_current_limit_max_throttle()

float AP_Motors6DOF::get_current_limit_max_throttle ( )
overrideprotectedvirtual

Reimplemented from AP_MotorsMulticopter.

Definition at line 270 of file AP_Motors6DOF.cpp.

◆ output_armed_stabilizing()

void AP_Motors6DOF::output_armed_stabilizing ( )
overrideprotectedvirtual

Implements AP_Motors.

Definition at line 279 of file AP_Motors6DOF.cpp.

Here is the call graph for this function:

◆ output_armed_stabilizing_vectored()

void AP_Motors6DOF::output_armed_stabilizing_vectored ( )
protected

Definition at line 390 of file AP_Motors6DOF.cpp.

Referenced by output_armed_stabilizing().

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

◆ output_armed_stabilizing_vectored_6dof()

void AP_Motors6DOF::output_armed_stabilizing_vectored_6dof ( )
protected

Definition at line 474 of file AP_Motors6DOF.cpp.

Referenced by output_armed_stabilizing().

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

◆ output_min()

void AP_Motors6DOF::output_min ( )
overridevirtual

Implements AP_Motors.

Definition at line 203 of file AP_Motors6DOF.cpp.

Here is the call graph for this function:

◆ output_to_motors()

void AP_Motors6DOF::output_to_motors ( )
overridevirtual

Implements AP_MotorsMulticopter.

Definition at line 227 of file AP_Motors6DOF.cpp.

Here is the call graph for this function:

◆ setup_motors()

void AP_Motors6DOF::setup_motors ( motor_frame_class  frame_class,
motor_frame_type  frame_type 
)
override

Definition at line 124 of file AP_Motors6DOF.cpp.

Here is the call graph for this function:

Member Data Documentation

◆ _batt_current_last

float AP_Motors6DOF::_batt_current_last = 0.0f
protected

Definition at line 68 of file AP_Motors6DOF.h.

Referenced by output_armed_stabilizing().

◆ _forward_factor

float AP_Motors6DOF::_forward_factor[AP_MOTORS_MAX_NUM_MOTORS]
protected

◆ _forwardVerticalCouplingFactor

AP_Float AP_Motors6DOF::_forwardVerticalCouplingFactor
protected

Definition at line 60 of file AP_Motors6DOF.h.

Referenced by output_armed_stabilizing_vectored().

◆ _lateral_factor

float AP_Motors6DOF::_lateral_factor[AP_MOTORS_MAX_NUM_MOTORS]
protected

◆ _motor_reverse

AP_Int8 AP_Motors6DOF::_motor_reverse[AP_MOTORS_MAX_NUM_MOTORS]
protected

◆ _output_limited

float AP_Motors6DOF::_output_limited = 1.0f
protected

Definition at line 67 of file AP_Motors6DOF.h.

Referenced by output_armed_stabilizing().

◆ _throttle_factor

float AP_Motors6DOF::_throttle_factor[AP_MOTORS_MAX_NUM_MOTORS]
protected

◆ var_info

const AP_Param::GroupInfo AP_Motors6DOF::var_info
static

Definition at line 45 of file AP_Motors6DOF.h.

Referenced by AP_Motors6DOF().


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