APM:Libraries
|
#include <AP_MotorsMulticopter.h>
Public Member Functions | |
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 | set_update_rate (uint16_t speed_hz) |
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 |
virtual void | output_test (uint8_t motor_seq, int16_t pwm)=0 |
virtual uint16_t | get_motor_mask ()=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 [] |
Protected Types | |
enum | HoverLearn { HOVER_LEARN_DISABLED = 0, HOVER_LEARN_ONLY = 1, HOVER_LEARN_AND_SAVE = 2 } |
Protected Member Functions | |
void | output_logic () |
virtual void | output_to_motors ()=0 |
virtual void | update_throttle_filter () |
virtual float | get_current_limit_max_throttle () |
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 | thrust_compensation (void) |
virtual void | output_boost_throttle (void) |
void | save_params_on_disarm () |
Protected Member Functions inherited from AP_Motors | |
virtual void | output_armed_stabilizing ()=0 |
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) |
Additional Inherited Members | |
Static Public Member Functions inherited from AP_Motors | |
static AP_Motors * | get_instance (void) |
Public Attributes inherited from AP_Motors | |
struct AP_Motors::AP_Motors_limit | limit |
Definition at line 33 of file AP_MotorsMulticopter.h.
|
protected |
Enumerator | |
---|---|
HOVER_LEARN_DISABLED | |
HOVER_LEARN_ONLY | |
HOVER_LEARN_AND_SAVE |
Definition at line 141 of file AP_MotorsMulticopter.h.
Enumerator | |
---|---|
SHUT_DOWN | |
SPIN_WHEN_ARMED | |
SPOOL_UP | |
THROTTLE_UNLIMITED | |
SPOOL_DOWN |
Definition at line 57 of file AP_MotorsMulticopter.h.
AP_MotorsMulticopter::AP_MotorsMulticopter | ( | uint16_t | loop_rate, |
uint16_t | speed_hz = AP_MOTORS_SPEED_DEFAULT |
||
) |
|
protected |
Definition at line 310 of file AP_MotorsMulticopter.cpp.
Referenced by calc_thrust_to_pwm().
|
protected |
Definition at line 377 of file AP_MotorsMulticopter.cpp.
Referenced by AP_MotorsMatrix::output_to_motors(), AP_MotorsTri::output_to_motors(), AP_MotorsSingle::output_to_motors(), and AP_MotorsCoax::output_to_motors().
|
protected |
Definition at line 371 of file AP_MotorsMulticopter.cpp.
Referenced by output_motor_mask(), AP_MotorsMatrix::output_to_motors(), AP_MotorsTri::output_to_motors(), AP_MotorsCoax::output_to_motors(), and AP_MotorsSingle::output_to_motors().
AP_MotorsMulticopter::FUNCTOR_TYPEDEF | ( | thrust_compensation_fn_t | , |
void | , | ||
float * | , | ||
uint8_t | |||
) |
|
inline |
|
protected |
Definition at line 353 of file AP_MotorsMulticopter.cpp.
Referenced by AP_MotorsMatrix::output_armed_stabilizing(), AP_MotorsTri::output_armed_stabilizing(), AP_MotorsSingle::output_armed_stabilizing(), and AP_MotorsCoax::output_armed_stabilizing().
|
protectedvirtual |
Reimplemented in AP_Motors6DOF.
Definition at line 274 of file AP_MotorsMulticopter.cpp.
Referenced by output_logic().
|
inline |
Definition at line 70 of file AP_MotorsMulticopter.h.
int16_t AP_MotorsMulticopter::get_pwm_output_max | ( | ) | const |
Definition at line 392 of file AP_MotorsMulticopter.cpp.
Referenced by calc_spin_up_to_pwm(), calc_thrust_to_pwm(), set_throttle_passthrough_for_esc_calibration(), set_throttle_range(), and spool_up_complete().
int16_t AP_MotorsMulticopter::get_pwm_output_min | ( | ) | const |
Definition at line 382 of file AP_MotorsMulticopter.cpp.
Referenced by calc_spin_up_to_pwm(), calc_thrust_to_pwm(), output_motor_mask(), AP_MotorsMatrix::output_to_motors(), AP_MotorsTri::output_to_motors(), AP_MotorsCoax::output_to_motors(), AP_MotorsSingle::output_to_motors(), set_throttle_passthrough_for_esc_calibration(), set_throttle_range(), and spool_up_complete().
|
inlinevirtual |
Implements AP_Motors.
Definition at line 54 of file AP_MotorsMulticopter.h.
Referenced by get_current_limit_max_throttle().
|
inline |
Definition at line 76 of file AP_MotorsMulticopter.h.
|
inline |
Definition at line 79 of file AP_MotorsMulticopter.h.
Referenced by AC_AttitudeControl_Sub::update_althold_lean_angle_max(), and AC_AttitudeControl_Multi::update_althold_lean_angle_max().
|
virtual |
Implements AP_Motors.
Definition at line 214 of file AP_MotorsMulticopter.cpp.
Referenced by output_min(), and update_motors().
|
protectedvirtual |
Definition at line 239 of file AP_MotorsMulticopter.cpp.
Referenced by output(), and thrust_compensation().
|
protected |
Definition at line 426 of file AP_MotorsMulticopter.cpp.
Referenced by output().
|
virtual |
Implements AP_Motors.
Definition at line 249 of file AP_MotorsMulticopter.cpp.
Referenced by setup().
|
virtual |
Reimplemented in AP_MotorsTri.
Definition at line 604 of file AP_MotorsMulticopter.cpp.
Referenced by AP_MotorsTri::output_motor_mask(), and spool_up_complete().
|
protectedpure virtual |
Implemented in AP_MotorsCoax, AP_MotorsSingle, AP_Motors6DOF, AP_MotorsTri, AP_MotorsMatrix, and AP_MotorsTailsitter.
Referenced by output().
|
protectedvirtual |
Reimplemented from AP_Motors.
Definition at line 620 of file AP_MotorsMulticopter.cpp.
Referenced by thrust_compensation().
void AP_MotorsMulticopter::set_throttle_passthrough_for_esc_calibration | ( | float | throttle_input | ) |
void AP_MotorsMulticopter::set_throttle_range | ( | int16_t | radio_min, |
int16_t | radio_max | ||
) |
Definition at line 403 of file AP_MotorsMulticopter.cpp.
Referenced by set_yaw_headroom(), and setup().
|
inline |
Definition at line 95 of file AP_MotorsMulticopter.h.
|
inline |
|
inline |
|
inlineprotectedvirtual |
Reimplemented in AP_MotorsMatrix, and AP_MotorsTri.
Definition at line 132 of file AP_MotorsMulticopter.h.
Referenced by output().
|
protected |
Definition at line 329 of file AP_MotorsMulticopter.cpp.
Referenced by output().
|
protectedvirtual |
Implements AP_Motors.
Definition at line 257 of file AP_MotorsMulticopter.cpp.
Referenced by output().
void AP_MotorsMulticopter::update_throttle_hover | ( | float | dt | ) |
Definition at line 417 of file AP_MotorsMulticopter.cpp.
Referenced by set_yaw_headroom().
|
protected |
Definition at line 155 of file AP_MotorsMulticopter.h.
Referenced by get_current_limit_max_throttle(), and AP_Motors6DOF::output_armed_stabilizing().
|
protected |
Definition at line 156 of file AP_MotorsMulticopter.h.
Referenced by get_current_limit_max_throttle(), and AP_Motors6DOF::output_armed_stabilizing().
|
protected |
Definition at line 157 of file AP_MotorsMulticopter.h.
Referenced by get_current_limit_max_throttle(), and update_lift_max_from_batt_voltage().
|
protected |
Definition at line 183 of file AP_MotorsMulticopter.h.
Referenced by AP_MotorsMulticopter(), apply_thrust_curve_and_volt_scaling(), get_batt_voltage_filt(), and update_lift_max_from_batt_voltage().
|
protected |
Definition at line 153 of file AP_MotorsMulticopter.h.
Referenced by update_lift_max_from_batt_voltage().
|
protected |
Definition at line 154 of file AP_MotorsMulticopter.h.
Referenced by get_current_limit_max_throttle(), and update_lift_max_from_batt_voltage().
|
protected |
Definition at line 171 of file AP_MotorsMulticopter.h.
Referenced by output_boost_throttle().
|
protected |
Definition at line 162 of file AP_MotorsMulticopter.h.
Referenced by AP_MotorsMatrix::output_to_motors().
|
protected |
Definition at line 187 of file AP_MotorsMulticopter.h.
Referenced by output_logic(), and AP_MotorsMatrix::output_to_motors().
|
protected |
Definition at line 184 of file AP_MotorsMulticopter.h.
Referenced by apply_thrust_curve_and_volt_scaling(), get_compensation_gain(), get_lift_max(), and update_lift_max_from_batt_voltage().
|
protected |
Definition at line 159 of file AP_MotorsMulticopter.h.
Referenced by get_pwm_output_max(), and get_pwm_output_min().
|
protected |
Definition at line 158 of file AP_MotorsMulticopter.h.
Referenced by get_pwm_output_max(), and get_pwm_output_min().
|
protected |
Definition at line 152 of file AP_MotorsMulticopter.h.
Referenced by output_logic().
|
protected |
Definition at line 151 of file AP_MotorsMulticopter.h.
Referenced by calc_thrust_to_pwm().
|
protected |
Definition at line 150 of file AP_MotorsMulticopter.h.
Referenced by calc_spin_up_to_pwm(), calc_thrust_to_pwm(), output_logic(), and AP_MotorsTailsitter::output_to_motors().
|
protected |
Definition at line 180 of file AP_MotorsMulticopter.h.
Referenced by calc_spin_up_to_pwm(), output_logic(), AP_MotorsTailsitter::output_to_motors(), AP_MotorsCoax::output_to_motors(), and AP_MotorsSingle::output_to_motors().
|
protected |
Definition at line 179 of file AP_MotorsMulticopter.h.
Referenced by output_logic(), output_min(), AP_MotorsTailsitter::output_to_motors(), AP_MotorsMatrix::output_to_motors(), AP_MotorsTri::output_to_motors(), AP_Motors6DOF::output_to_motors(), AP_MotorsSingle::output_to_motors(), AP_MotorsCoax::output_to_motors(), and spool_up_complete().
|
protected |
Definition at line 168 of file AP_MotorsMulticopter.h.
Referenced by output_logic().
|
protected |
Definition at line 160 of file AP_MotorsMulticopter.h.
Referenced by get_throttle_hover(), AP_MotorsSingle::output_armed_stabilizing(), AP_MotorsCoax::output_armed_stabilizing(), save_params_on_disarm(), and update_throttle_hover().
|
protected |
Definition at line 161 of file AP_MotorsMulticopter.h.
Referenced by save_params_on_disarm(), and update_throttle_hover().
|
protected |
Definition at line 185 of file AP_MotorsMulticopter.h.
Referenced by get_current_limit_max_throttle(), and get_throttle_limit().
|
protected |
Definition at line 176 of file AP_MotorsMulticopter.h.
Referenced by AP_MotorsMulticopter(), AP_Motors6DOF::calc_thrust_to_pwm(), get_pwm_output_max(), and set_throttle_range().
|
protected |
Definition at line 175 of file AP_MotorsMulticopter.h.
Referenced by AP_MotorsMulticopter(), AP_Motors6DOF::calc_thrust_to_pwm(), get_pwm_output_min(), and set_throttle_range().
|
protected |
Definition at line 186 of file AP_MotorsMulticopter.h.
Referenced by get_throttle_thrust_max(), AP_MotorsTailsitter::output_armed_stabilizing(), AP_MotorsMatrix::output_armed_stabilizing(), AP_MotorsTri::output_armed_stabilizing(), AP_Motors6DOF::output_armed_stabilizing(), AP_MotorsCoax::output_armed_stabilizing(), AP_MotorsSingle::output_armed_stabilizing(), AP_Motors6DOF::output_armed_stabilizing_vectored(), AP_Motors6DOF::output_armed_stabilizing_vectored_6dof(), and output_logic().
|
protected |
Definition at line 190 of file AP_MotorsMulticopter.h.
Referenced by set_thrust_compensation_callback(), AP_MotorsTri::thrust_compensation(), and AP_MotorsMatrix::thrust_compensation().
|
protected |
Definition at line 149 of file AP_MotorsMulticopter.h.
Referenced by apply_thrust_curve_and_volt_scaling(), and update_lift_max_from_batt_voltage().
|
protected |
Definition at line 148 of file AP_MotorsMulticopter.h.
Referenced by AP_MotorsMatrix::output_armed_stabilizing(), AP_MotorsSingle::output_armed_stabilizing(), AP_MotorsCoax::output_armed_stabilizing(), and set_yaw_headroom().
|
protected |
Definition at line 165 of file AP_MotorsMulticopter.h.
Referenced by AP_MotorsTri::output_armed_stabilizing(), and AP_MotorsTri::output_to_motors().
|
protected |
Definition at line 174 of file AP_MotorsMulticopter.h.
Referenced by AP_MotorsMatrix::add_motor_raw(), AP_MotorsMulticopter(), AP_MotorsMatrix::get_motor_mask(), AP_MotorsTri::init(), AP_MotorsCoax::init(), AP_MotorsSingle::init(), AP_MotorsMatrix::normalise_rpy_factors(), AP_MotorsMatrix::output_armed_stabilizing(), AP_Motors6DOF::output_armed_stabilizing(), AP_Motors6DOF::output_armed_stabilizing_vectored(), AP_Motors6DOF::output_armed_stabilizing_vectored_6dof(), AP_Motors6DOF::output_min(), output_motor_mask(), AP_MotorsMatrix::output_test(), AP_MotorsMatrix::output_to_motors(), AP_Motors6DOF::output_to_motors(), AP_MotorsMatrix::remove_motor(), set_throttle_passthrough_for_esc_calibration(), and AP_MotorsMatrix::set_update_rate().
|
static |
Definition at line 100 of file AP_MotorsMulticopter.h.
Referenced by AP_MotorsMulticopter().