I am wondering if there is a possible solution to this. My vehicle is required to inside of buildings in tight spaces where speed is not critical, but also sometimes fly outside where speed is critical. Short of creating a new flight mode, is it possible to change parameters such as angle_max from a Lua script?
Here is the script I wrote thanks to input from @Michail_Belov :
local current_angle_max = 0
local desired_angle_max = 0
function update()
current_angle_max = param:get("ANGLE_MAX")
if rc:get_pwm(10) > 1500 then desired_angle_max = 4000
else desired_angle_max = 1000
end
if current_angle_max ~= desired_angle_max then
param:set("ANGLE_MAX", desired_angle_max)
gcs:send_text(0, "Angle limit set to: " .. desired_angle_max)
end
return update, 100
end
return update()
I thought maybe posting this script can help someone in the future.
This asignment will be reasigned, but if something goes wrong, you may end with 0 set, and uncontrollable copter, set it to a save value even if you assume it will never be used, something lilke 2000