I have two servos, one controlling the left aileron and one controlling the right. I want to get the PWM value for each one, but I can only seem to acquire one of them using the following:
local aileron_pwm = SRV_Channels:get_output_pwm(4)
How can I get both values?
Well, to which outputs are they connected?
One is connected to servo7 and one to servo8.
No way to do this unfortunately, you can only get the PWM of the first function. The scaled output is the same of course, so you can manipulate it and then output to a scripting servo function. If you can explain what your trying to do we may be able to suggest a alternate approach.
Got it, thanks. That is essentially what I am currently doing.
The purpose is to reassign a bicopter’s tilt wings as ailerons after transitioning from VTOL to FW flight. Appears to be working on the ground as anticipated. I am having massive problems taking off in auto mode though (unrelated to scripting ), as discussed at Bicopter Takeoff Issues - ArduPlane / VTOL Plane - ArduPilot Discourse.