|
|
|
@ -191,7 +191,8 @@ void ModeRTL::climb_return_run()
@@ -191,7 +191,8 @@ void ModeRTL::climb_return_run()
|
|
|
|
|
float target_yaw_rate = 0; |
|
|
|
|
if (!copter.failsafe.radio) { |
|
|
|
|
// get pilot's desired yaw rate
|
|
|
|
|
// target_yaw_rate = get_pilot_desired_yaw_rate(channel_yaw->get_control_in());
|
|
|
|
|
if(g.zr_use_rc) |
|
|
|
|
target_yaw_rate = get_pilot_desired_yaw_rate(channel_yaw->get_control_in()); |
|
|
|
|
if (!is_zero(target_yaw_rate)) { |
|
|
|
|
auto_yaw.set_mode(AUTO_YAW_HOLD); |
|
|
|
|
} |
|
|
|
@ -248,7 +249,8 @@ void ModeRTL::loiterathome_run()
@@ -248,7 +249,8 @@ void ModeRTL::loiterathome_run()
|
|
|
|
|
float target_yaw_rate = 0; |
|
|
|
|
if (!copter.failsafe.radio) { |
|
|
|
|
// get pilot's desired yaw rate
|
|
|
|
|
// target_yaw_rate = get_pilot_desired_yaw_rate(channel_yaw->get_control_in());
|
|
|
|
|
if(g.zr_use_rc) |
|
|
|
|
target_yaw_rate = get_pilot_desired_yaw_rate(channel_yaw->get_control_in()); |
|
|
|
|
if (!is_zero(target_yaw_rate)) { |
|
|
|
|
auto_yaw.set_mode(AUTO_YAW_HOLD); |
|
|
|
|
} |
|
|
|
@ -333,7 +335,8 @@ void ModeRTL::descent_run()
@@ -333,7 +335,8 @@ void ModeRTL::descent_run()
|
|
|
|
|
update_simple_mode(); |
|
|
|
|
|
|
|
|
|
// convert pilot input to lean angles
|
|
|
|
|
// get_pilot_desired_lean_angles(target_roll, target_pitch, loiter_nav->get_angle_max_cd(), attitude_control->get_althold_lean_angle_max());
|
|
|
|
|
if(g.zr_use_rc) |
|
|
|
|
get_pilot_desired_lean_angles(target_roll, target_pitch, loiter_nav->get_angle_max_cd(), attitude_control->get_althold_lean_angle_max()); |
|
|
|
|
|
|
|
|
|
// record if pilot has overridden roll or pitch
|
|
|
|
|
if (!is_zero(target_roll) || !is_zero(target_pitch)) { |
|
|
|
@ -345,7 +348,8 @@ void ModeRTL::descent_run()
@@ -345,7 +348,8 @@ void ModeRTL::descent_run()
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// get pilot's desired yaw rate
|
|
|
|
|
// target_yaw_rate = get_pilot_desired_yaw_rate(channel_yaw->get_control_in());
|
|
|
|
|
if(g.zr_use_rc) |
|
|
|
|
target_yaw_rate = get_pilot_desired_yaw_rate(channel_yaw->get_control_in()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// set motors to full range
|
|
|
|
|