41 if (strstr(frame_str,
"-dual")) {
43 }
else if (strstr(frame_str,
"-compound")) {
48 gas_heli = (strstr(frame_str,
"-gas") !=
nullptr);
69 float torque_effect_accel = 0;
70 float lateral_x_thrust = 0;
71 float lateral_y_thrust = 0;
73 float swash1 = (input.
servos[0]-1000) / 1000.0
f;
74 float swash2 = (input.
servos[1]-1000) / 1000.0
f;
75 float swash3 = (input.
servos[2]-1000) / 1000.0
f;
77 if (!ignition_enabled) {
86 float tail_rotor = (input.
servos[3]-1000) / 1000.0
f;
88 thrust = (rsc/
rsc_setpoint) * (swash1+swash2+swash3) / 3.0f;
91 roll_rate = swash1 - swash2;
92 pitch_rate = (swash1+swash2) / 2.0
f - swash3;
93 yaw_rate = tail_rotor - 0.5f;
102 float swash4 = (input.
servos[3]-1000) / 1000.0
f;
103 float swash5 = (input.
servos[4]-1000) / 1000.0
f;
104 float swash6 = (input.
servos[5]-1000) / 1000.0
f;
106 thrust = (rsc /
rsc_setpoint) * (swash1+swash2+swash3+swash4+swash5+swash6) / 6.0f;
109 roll_rate = (swash1-swash2) + (swash4-swash5);
110 pitch_rate = (swash1+swash2+swash3) - (swash4+swash5+swash6);
111 yaw_rate = (swash1-swash2) + (swash5-swash4);
118 float right_rotor = (input.
servos[3]-1000) / 1000.0
f;
119 float left_rotor = (input.
servos[4]-1000) / 1000.0
f;
121 thrust = (rsc/
rsc_setpoint) * (swash1+swash2+swash3) / 3.0f;
124 roll_rate = swash1 - swash2;
125 pitch_rate = (swash1+swash2) / 2.0
f - swash3;
126 yaw_rate = right_rotor - left_rotor;
133 roll_rate *= rsc_scale;
134 pitch_rate *= rsc_scale;
135 yaw_rate *= rsc_scale;
149 rot_accel.
z += torque_effect_accel;
155 rpm1 = thrust * 1300;
void update_wind(const struct sitl_input &input)
Vector3< float > Vector3f
void update(const struct sitl_input &input)
Matrix3< T > transposed(void) const
Helicopter(const char *home_str, const char *frame_str)
void update_mag_field_bf(void)
float constrain_float(const float amt, const float low, const float high)
void update_position(void)
static constexpr float radians(float deg)
void update_dynamics(const Vector3f &rot_accel)
enum SITL::Helicopter::frame_types frame_type
enum SITL::Aircraft::@199 ground_behavior
float terminal_rotation_rate