openmovementproject / openmovement

Open Movement devices are miniature, embeddable, open source sensors developed at Newcastle University, UK. The source code for the firmware and software is available under a BSD 2-clause license, and the hardware (PCB designs, layouts and schematics), enclosure designs and documentation are available under a Creative Commons 3.0 BY Attribution License.
https://openmovement.dev
146 stars 76 forks source link

jomapi does not work with AX6 #44

Closed ttruty closed 2 years ago

ttruty commented 3 years ago

jomapi throw error on startup that the device # for the AX6 is invalid. Using the updated AX6 C code to compile the jar seems to have fixed the problem for on start, unsure if there are any other issues with the jomapi working with the AX6.

danielgjackson commented 2 years ago

Apologies for the late reply.

The original JAR build of the Java binding for OMAPI predated the AX6 and the use of >16 bits for device IDs.

The library, libomapi, now has its own repository: github.com/digitalinteraction/libomapi

There's a newly built version of the JAR file: JOMAPI.jar

There is documentation for the underlying C API (which should closely match the Java API) at: OMAPI documentation

I'm afraid I've only been able to test the basics with the AX6, but almost all of the commands are the same. The AX6-specific overrides are quite hackily shoehorned into the original API calls, in particular: OmSetAccelConfig() using the upper 16-bits of the range parameter to set the gyroscope range (if left zero, the gyroscope will be disabled).