From 047b2d557875d59b7c6137f4c2fe4b1c0d69bac1 Mon Sep 17 00:00:00 2001 From: murata Date: Fri, 20 May 2022 00:30:20 +0900 Subject: [PATCH] Sub: Clarify that the target_yaw_rate variable is set --- ArduSub/control_stabilize.cpp | 3 +-- ArduSub/control_surface.cpp | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/ArduSub/control_stabilize.cpp b/ArduSub/control_stabilize.cpp index 8d135fa82a..356ce2479b 100644 --- a/ArduSub/control_stabilize.cpp +++ b/ArduSub/control_stabilize.cpp @@ -16,7 +16,6 @@ void Sub::stabilize_run() { uint32_t tnow = AP_HAL::millis(); float target_roll, target_pitch; - float target_yaw_rate; // if not armed set throttle to zero and exit immediately if (!motors.armed()) { @@ -34,7 +33,7 @@ void Sub::stabilize_run() get_pilot_desired_lean_angles(channel_roll->get_control_in(), channel_pitch->get_control_in(), target_roll, target_pitch, aparm.angle_max); // get pilot's desired yaw rate - target_yaw_rate = get_pilot_desired_yaw_rate(channel_yaw->get_control_in()); + float target_yaw_rate = get_pilot_desired_yaw_rate(channel_yaw->get_control_in()); // call attitude controller // update attitude controller targets diff --git a/ArduSub/control_surface.cpp b/ArduSub/control_surface.cpp index cd9e20bc51..407b04ab5a 100644 --- a/ArduSub/control_surface.cpp +++ b/ArduSub/control_surface.cpp @@ -21,7 +21,6 @@ bool Sub::surface_init() void Sub::surface_run() { float target_roll, target_pitch; - float target_yaw_rate; // if not armed set throttle to zero and exit immediately if (!motors.armed()) { @@ -43,7 +42,7 @@ void Sub::surface_run() get_pilot_desired_lean_angles(channel_roll->get_control_in(), channel_pitch->get_control_in(), target_roll, target_pitch, aparm.angle_max); // get pilot's desired yaw rate - target_yaw_rate = get_pilot_desired_yaw_rate(channel_yaw->get_control_in()); + float target_yaw_rate = get_pilot_desired_yaw_rate(channel_yaw->get_control_in()); // call attitude controller attitude_control.input_euler_angle_roll_pitch_euler_rate_yaw(target_roll, target_pitch, target_yaw_rate);