Beispiel #1
0
/*
  this gives the user control of the aircraft in stabilization modes
 */
void Plane::stabilize_stick_mixing_direct()
{
    if (!stick_mixing_enabled() ||
            control_mode == ACRO ||
            control_mode == FLY_BY_WIRE_A ||
            control_mode == AUTOTUNE ||
            control_mode == FLY_BY_WIRE_B ||
            control_mode == CRUISE ||
            control_mode == TRAINING) {
        return;
    }
    stick_mix_channel(channel_roll, channel_roll->servo_out);
    stick_mix_channel(channel_pitch, channel_pitch->servo_out);
}
Beispiel #2
0
/*
  this gives the user control of the aircraft in stabilization modes
 */
void Plane::stabilize_stick_mixing_direct()
{
    if (!stick_mixing_enabled() ||
        control_mode == ACRO ||
        control_mode == FLY_BY_WIRE_A ||
        control_mode == AUTOTUNE ||
        control_mode == FLY_BY_WIRE_B ||
        control_mode == CRUISE ||
        control_mode == QSTABILIZE ||
        control_mode == QHOVER ||
        control_mode == QLOITER ||
        control_mode == QLAND ||
        control_mode == QRTL ||
        control_mode == TRAINING) {
        return;
    }
    stick_mix_channel(channel_roll);
    stick_mix_channel(channel_pitch);
}
Beispiel #3
0
/*
  calculate yaw control for ground steering with specific course
 */
void Plane::calc_nav_yaw_course(void)
{
    // holding a specific navigation course on the ground. Used in
    // auto-takeoff and landing
    int32_t bearing_error_cd = nav_controller->bearing_error_cd();
    steering_control.steering = steerController.get_steering_out_angle_error(bearing_error_cd);
    if (stick_mixing_enabled()) {
        stick_mix_channel(channel_rudder, steering_control.steering);
    }
    steering_control.steering = constrain_int16(steering_control.steering, -4500, 4500);
}
Beispiel #4
0
/*
  this gives the user control of the aircraft in stabilization modes
 */
void Plane::stabilize_stick_mixing_direct()
{
    if (!stick_mixing_enabled() ||
        control_mode == ACRO ||
        control_mode == FLY_BY_WIRE_A ||
        control_mode == AUTOTUNE ||
        control_mode == FLY_BY_WIRE_B ||
        control_mode == CRUISE ||
        control_mode == QSTABILIZE ||
        control_mode == QHOVER ||
        control_mode == QLOITER ||
        control_mode == QLAND ||
        control_mode == QRTL ||
        control_mode == TRAINING) {
        return;
    }
    int16_t aileron = SRV_Channels::get_output_scaled(SRV_Channel::k_aileron);
    stick_mix_channel(channel_roll, aileron);
    SRV_Channels::set_output_scaled(SRV_Channel::k_aileron, aileron);

    int16_t elevator = SRV_Channels::get_output_scaled(SRV_Channel::k_elevator);
    stick_mix_channel(channel_pitch, elevator);
    SRV_Channels::set_output_scaled(SRV_Channel::k_elevator, elevator);
}
Beispiel #5
0
/*
  One argument version for when the servo out in the rc channel 
  is the target
 */
void Plane::stick_mix_channel(RC_Channel * channel)
{
   int16_t servo_out = channel->get_servo_out();
   stick_mix_channel(channel,servo_out);
   channel->set_servo_out(servo_out);
}