-
Notifications
You must be signed in to change notification settings - Fork 17.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AP_Scripting: fix some more of the easy luacheck warnings #25756
Conversation
@@ -25,7 +24,6 @@ local function PIFF(kFF,kP,kI,iMax) | |||
local _kFF = kFF | |||
local _kP = kP or 0.0 | |||
local _kI = kI or 0.0 | |||
local _kD = kD or 0.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
libraries/AP_Scripting/examples/OOP_example.lua:27:10: unused variable _kD
@@ -65,7 +61,7 @@ function doublet() | |||
pre_doublet_mode = vehicle:get_mode() | |||
-- are we doing a doublet on elevator or rudder? set the other controls to trim | |||
local doublet_choice_pwm = rc:get_pwm(DOUBLET_CHOICE_CHANNEL) | |||
local trim_funcs = {} | |||
local trim_funcs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
libraries/AP_Scripting/examples/plane-doublets.lua:64:19: value assigned to variable trim_funcs is unused
local MODE_FBWB = 6 | ||
local MODE_RTL = 11 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
libraries/AP_Scripting/examples/plane-doublets.lua:21:7: unused variable MODE_FBWB
libraries/AP_Scripting/examples/plane-doublets.lua:22:7: unused variable MODE_RTL
@@ -30,7 +27,6 @@ local K_RUDDER = 21 | |||
local start_time = -1 | |||
local end_time = -1 | |||
local now = -1 | |||
local desired_mode = -1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
libraries/AP_Scripting/examples/plane-doublets.lua:32:7: variable desired_mode is never accessed
@@ -23,9 +22,9 @@ function test_load() | |||
return | |||
end | |||
-- run the code within a protected call to catch any errors | |||
local success, err = pcall(f) | |||
local success, err2 = pcall(f) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
libraries/AP_Scripting/examples/test_load.lua:25:19: variable err was previously defined on line 19
@@ -183,7 +182,7 @@ end | |||
-- a) body rotations: body_rot_x, body_rot_y, body_rot_z | |||
-- b) body position: body_pos_x, body_pos_y, body_pos_z | |||
-- c) offset of the center of body | |||
function body_forward_kinematics(X, Y, Z, Xdist, Ydist, Zrot) | |||
function body_forward_kinematics(X, Y, _, Xdist, Ydist, Zrot) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
libraries/AP_Scripting/examples/quadruped.lua:185:40: unused argument Z
@@ -12,6 +11,7 @@ function update() | |||
-- deliberately make a bad call to cause a fault, asking for the 6th GPS status | |||
-- as this is done inside a pcall() the error will be caught instead of stopping the script | |||
local status = gps:status(5) | |||
gcs:send_text(0, "GPS status: " .. tostring(status)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
libraries/AP_Scripting/examples/protected_call.lua:13:13: unused variable status
@@ -57,8 +55,6 @@ function update() | |||
rc:run_aux_function(RC_OPTION.RunCamControl, AuxSwitchPos.LOW) | |||
end | |||
delay = DELAY_LONG | |||
else | |||
delay = DELAY_SHORT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
libraries/AP_Scripting/applets/runcam_on_arm.lua:47:10: value assigned to variable delay is unused
Slowly getting more of our scripts to pass.