Hello everyone!
I’m currently encountering an issue. I have a large 8-axis, 16-propeller drone, and I wrote a Lua script to modify its motor mixer:
MotorsMatrix:add_motor_raw(0, -0.414, 1, 1, 1)
MotorsMatrix:add_motor_raw(1, 0.414, -1, 1, 2)
MotorsMatrix:add_motor_raw(2, -1, 0.414, -1, 3)
MotorsMatrix:add_motor_raw(3, -0.414, -1, -1, 4)
MotorsMatrix:add_motor_raw(4, 0.414, 1, -1, 5)
MotorsMatrix:add_motor_raw(5, 1, -0.414, -1, 6)
MotorsMatrix:add_motor_raw(6, 1, 0.414, 1, 7)
MotorsMatrix:add_motor_raw(7, -1, -0.414, 1, 8)
MotorsMatrix:add_motor_raw(8, -0.414, 1, -1, 9)
MotorsMatrix:add_motor_raw(9, 0.414, -1, -1, 10)
MotorsMatrix:add_motor_raw(10, -1, 0.414, 1, 11)
MotorsMatrix:add_motor_raw(11, -0.414, -1, 1, 12)
MotorsMatrix:add_motor_raw(12, 0.414, 1, 1, 13)
MotorsMatrix:add_motor_raw(13, 1, -0.414, 1, 14)
MotorsMatrix:add_motor_raw(14, 1, 0.414, -1, 15)
MotorsMatrix:add_motor_raw(15, -1, -0.414, -1, 16)
assert(MotorsMatrix:init(16), “Failed to init MotorsMatrix”) motors:set_frame_string(“motors_16”)
However, after uploading the script to the flight controller, it reports the error:
bad argument #1 to 'add_motor_raw' (out of range)
I haven’t found any related documentation online, and I’ve seen developers mention that Lua scripts support 16 or even 32 motors. Does this mean I need to try modifying the ArduPilot source code? Or is there a simpler solution?