Unsupported Sensors? Try Arduino + Lua!

I’m afraid there are some limitations within scripting, and I don’t see a way to make compass data available to the EKF through the scripting engine.

You’ll be able to get raw magnetometer data using my library and an accompanying script on your autopilot, but I don’t think there is a way to calibrate it and use it for native position and navigation.

As an alternative, Matek makes an inexpensive, firmware supported GPS/compass module.

If you were very motivated, you could have a look at ardupilot/AP_Compass_Backend.h and write a C++ class to extend it for direct support of your module or a scripting driver for native use of scripted compass modules. However, this will require a custom build of the firmware, and I don’t anticipate much motivation from the dev team to accept a pull request for either of these options, since supported GPS/compass modules are cheap and readily available (coupled with this concern for flash size).

1 Like