241 for (uint8_t i = 0; i < 5; i++) {
376 float yaw_offset = 0.0f;
385 coll_in = 1 - coll_in;
392 float total_out =
norm(pitch_out, roll_out);
402 float collective_out = coll_in;
403 if (collective_out <= 0.0
f) {
404 collective_out = 0.0f;
407 if (collective_out >= 1.0
f) {
408 collective_out = 1.0f;
440 float collective_out_scaled = collective_out * collective_scalar + (
_collective_min - 1000)*0.001
f;
444 collective_out_scaled = 1 - collective_out_scaled;
455 servo1_out = 2*servo1_out - 1;
456 servo2_out = 2*servo2_out - 1;
457 servo3_out = 2*servo3_out - 1;
472 if (yaw_out < -1.0
f) {
476 if (yaw_out > 1.0
f) {
567 gcs().
send_text(MAV_SEVERITY_CRITICAL,
"PreArm: H_PHANG out of range");
575 gcs().
send_text(MAV_SEVERITY_CRITICAL,
"PreArm: H_GYR_GAIN_ACRO out of range");
583 gcs().
send_text(MAV_SEVERITY_CRITICAL,
"PreArm: H_GYR_GAIN out of range");
float norm(const T first, const U second, const Params... parameters)
#define AP_MOTORS_HELI_SINGLE_TAILTYPE_SERVO_EXTGYRO
bool get_soft_armed() const
#define AP_MOTORS_HELI_NOFLYBAR
void calculate_roll_pitch_collective_factors() override
#define AP_MOTORS_HELI_SINGLE_AUX
#define AP_MOTORS_HELI_SINGLE_DDVP_SPEED_DEFAULT
AP_MotorsHeli_RSC _main_rotor
#define AP_MOTORS_HELI_SINGLE_TAILTYPE_DIRECTDRIVE_VARPITCH
int16_t constrain_int16(const int16_t amt, const int16_t low, const int16_t high)
float _rollFactor[AP_MOTORS_HELI_SINGLE_NUM_SWASHPLATE_SERVOS]
AP_Float _collective_yaw_effect
SRV_Channel * _swash_servo_2
void set_angle(int16_t angle)
bool init_outputs() override
#define AP_MOTORS_HELI_COLLECTIVE_MIN
engine kill switch, used for gas airplanes and helicopters
AP_Int16 _ext_gyro_gain_std
float _collective_mid_pct
#define AP_MOTORS_HELI_SINGLE_SERVO3_POS
void set_desired_speed(float desired_speed)
Interface definition for the various Ground Control System.
struct AP_Motors::AP_Motors_flags _flags
#define AP_GROUPINFO(name, idx, clazz, element, def)
void set_desired_rotor_speed(float desired_speed) override
AP_Int16 _direct_drive_tailspeed
AP_Int16 _ext_gyro_gain_acro
struct AP_Motors::AP_Motors_limit limit
const AP_HAL::HAL & hal
-*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*-
void set_critical_speed(float critical_speed)
static SRV_Channel * get_channel_for(SRV_Channel::Aux_servo_function_t function, int8_t default_chan=-1)
#define AP_MOTORS_HELI_COLLECTIVE_MAX
int16_t calc_pwm_output_1to1_swash_servo(float input, const SRV_Channel *servo)
struct AP_MotorsHeli::heliflags_type _heliflags
void move_actuators(float roll_out, float pitch_out, float coll_in, float yaw_out) override
#define AP_MOTORS_HELI_SINGLE_RSC
int16_t calc_pwm_output_0to1(float input, const SRV_Channel *servo)
AP_MotorsHeli_RSC _tail_rotor
void set_idle_output(float idle_output)
static void set_output_limit(SRV_Channel::Aux_servo_function_t function, SRV_Channel::LimitValue limit)
#define AP_MOTORS_HELI_SINGLE_SERVO1_POS
SRV_Channel * _swash_servo_3
bool is_runup_complete() const
#define AP_MOTORS_HELI_SINGLE_COLLECTIVE_DIRECTION_REVERSED
uint8_t _servo_test_cycle_counter
#define AP_MOTORS_HELI_SINGLE_SWASH_H3_140
float get_desired_speed() const
AP_Int16 _rsc_idle_output
virtual bool parameter_check(bool display_msg) const
float _pitchFactor[AP_MOTORS_HELI_SINGLE_NUM_SWASHPLATE_SERVOS]
void set_throttle_curve(float thrcrv[5], uint16_t slewrate)
float _collectiveFactor[AP_MOTORS_HELI_SINGLE_NUM_SWASHPLATE_SERVOS]
void servo_test() override
these allow remapping of copter motors
#define AP_MOTORS_HELI_SINGLE_TAILTYPE_DIRECTDRIVE_FIXEDPITCH
void set_control_mode(RotorControlMode mode)
void output_test(uint8_t motor_seq, int16_t pwm) override
#define AP_MOTORS_HELI_SINGLE_EXT_GYRO_GAIN
float get_control_output() const
#define AP_MOTORS_HELI_SINGLE_SWASH_H3
int16_t calc_pwm_output_1to1(float input, const SRV_Channel *servo)
void reset_swash_servo(SRV_Channel *servo)
void move_yaw(float yaw_out)
#define AP_MOTORS_HELI_SINGLE_SWASH_H1
#define AP_MOTORS_HELI_SINGLE_COLLECTIVE_DIRECTION_NORMAL
void send_text(MAV_SEVERITY severity, const char *fmt,...)
void output(RotorControlState state)
virtual void rc_write(uint8_t chan, uint16_t pwm)
LowPassFilterFloat _throttle_filter
bool parameter_check(bool display_msg) const override
float constrain_float(const float amt, const float low, const float high)
void write_aux(float servo_out)
void set_runup_time(int8_t runup_time)
#define AP_NESTEDGROUPINFO(clazz, idx)
float _servo_test_cycle_time
static constexpr float radians(float deg)
static const struct AP_Param::GroupInfo var_info[]
virtual void rc_set_freq(uint32_t mask, uint16_t freq_hz)
void calculate_scalars() override
uint8_t landing_collective
AP_Int16 _land_collective_min
uint16_t get_motor_mask() override
#define AP_MOTORS_HELI_SINGLE_COLYAW_RANGE
AP_Int8 _collective_direction
void set_update_rate(uint16_t speed_hz) override
SRV_Channel * _swash_servo_1
void calculate_armed_scalars() override
virtual uint32_t rc_map_mask(uint32_t mask) const
void set_ramp_time(int8_t ramp_time)
#define AP_MOTORS_HELI_SINGLE_SERVO2_POS
uint8_t rotor_runup_complete
void update_motor_control(RotorControlState state) override
void set_collective(float collective)
Motor control class for traditional heli.
#define AP_MOTORS_HELI_SINGLE_TAILTYPE_SERVO