|
|
|
@ -39,7 +39,6 @@ bool Sub::guided_init(bool ignore_checks)
@@ -39,7 +39,6 @@ bool Sub::guided_init(bool ignore_checks)
|
|
|
|
|
if (!position_ok() && !ignore_checks) { |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// initialise yaw
|
|
|
|
|
set_auto_yaw_mode(get_default_auto_yaw_mode(false)); |
|
|
|
|
// start in position control mode
|
|
|
|
@ -329,10 +328,10 @@ void Sub::guided_pos_control_run()
@@ -329,10 +328,10 @@ void Sub::guided_pos_control_run()
|
|
|
|
|
// call attitude controller
|
|
|
|
|
if (auto_yaw_mode == AUTO_YAW_HOLD) { |
|
|
|
|
// roll & pitch from waypoint controller, yaw rate from pilot
|
|
|
|
|
attitude_control.input_euler_angle_roll_pitch_euler_rate_yaw(channel_roll->get_control_in(), channel_pitch->get_control_in(), target_yaw_rate, get_smoothing_gain()); |
|
|
|
|
attitude_control.input_euler_angle_roll_pitch_euler_rate_yaw(channel_roll->get_control_in(), channel_pitch->get_control_in(), target_yaw_rate); |
|
|
|
|
} else { |
|
|
|
|
// roll, pitch from waypoint controller, yaw heading from auto_heading()
|
|
|
|
|
attitude_control.input_euler_angle_roll_pitch_yaw(channel_roll->get_control_in(), channel_pitch->get_control_in(), get_auto_heading(), true, get_smoothing_gain()); |
|
|
|
|
attitude_control.input_euler_angle_roll_pitch_yaw(channel_roll->get_control_in(), channel_pitch->get_control_in(), get_auto_heading(), true); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -383,10 +382,10 @@ void Sub::guided_vel_control_run()
@@ -383,10 +382,10 @@ void Sub::guided_vel_control_run()
|
|
|
|
|
// call attitude controller
|
|
|
|
|
if (auto_yaw_mode == AUTO_YAW_HOLD) { |
|
|
|
|
// roll & pitch from waypoint controller, yaw rate from pilot
|
|
|
|
|
attitude_control.input_euler_angle_roll_pitch_euler_rate_yaw(channel_roll->get_control_in(), channel_pitch->get_control_in(), target_yaw_rate, get_smoothing_gain()); |
|
|
|
|
attitude_control.input_euler_angle_roll_pitch_euler_rate_yaw(channel_roll->get_control_in(), channel_pitch->get_control_in(), target_yaw_rate); |
|
|
|
|
} else { |
|
|
|
|
// roll, pitch from waypoint controller, yaw heading from auto_heading()
|
|
|
|
|
attitude_control.input_euler_angle_roll_pitch_yaw(channel_roll->get_control_in(), channel_pitch->get_control_in(), get_auto_heading(), true, get_smoothing_gain()); |
|
|
|
|
attitude_control.input_euler_angle_roll_pitch_yaw(channel_roll->get_control_in(), channel_pitch->get_control_in(), get_auto_heading(), true); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -459,10 +458,10 @@ void Sub::guided_posvel_control_run()
@@ -459,10 +458,10 @@ void Sub::guided_posvel_control_run()
|
|
|
|
|
// call attitude controller
|
|
|
|
|
if (auto_yaw_mode == AUTO_YAW_HOLD) { |
|
|
|
|
// roll & pitch from waypoint controller, yaw rate from pilot
|
|
|
|
|
attitude_control.input_euler_angle_roll_pitch_euler_rate_yaw(channel_roll->get_control_in(), channel_pitch->get_control_in(), target_yaw_rate, get_smoothing_gain()); |
|
|
|
|
attitude_control.input_euler_angle_roll_pitch_euler_rate_yaw(channel_roll->get_control_in(), channel_pitch->get_control_in(), target_yaw_rate); |
|
|
|
|
} else { |
|
|
|
|
// roll, pitch from waypoint controller, yaw heading from auto_heading()
|
|
|
|
|
attitude_control.input_euler_angle_roll_pitch_yaw(channel_roll->get_control_in(), channel_pitch->get_control_in(), get_auto_heading(), true, get_smoothing_gain()); |
|
|
|
|
attitude_control.input_euler_angle_roll_pitch_yaw(channel_roll->get_control_in(), channel_pitch->get_control_in(), get_auto_heading(), true); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -509,7 +508,7 @@ void Sub::guided_angle_control_run()
@@ -509,7 +508,7 @@ void Sub::guided_angle_control_run()
|
|
|
|
|
motors.set_desired_spool_state(AP_Motors::DESIRED_THROTTLE_UNLIMITED); |
|
|
|
|
|
|
|
|
|
// call attitude controller
|
|
|
|
|
attitude_control.input_euler_angle_roll_pitch_yaw(roll_in, pitch_in, yaw_in, true, get_smoothing_gain()); |
|
|
|
|
attitude_control.input_euler_angle_roll_pitch_yaw(roll_in, pitch_in, yaw_in, true); |
|
|
|
|
|
|
|
|
|
// call position controller
|
|
|
|
|
pos_control.set_alt_target_from_climb_rate_ff(climb_rate_cms, G_Dt, false); |
|
|
|
|