v3.1.0
The v3.1.0
release of the HaritoraX-Interpreter
package is now out to coincide with SlimeTora v1.3.0. This is a minor release containing many new features to GX dongles, bugfixes, and full BLE support for Linux via node-ble
.
Changelogs
- Add full support for wireless BT on Linux
- This makes use of the
node-ble
package which directly communicates with dbus on Linux. - Requires modification to dbus config to work, see https://github.com/chrvadala/node-ble?tab=readme-ov-file#provide-permissions
- This makes use of the
- Add many GX dongle features:
- Pairing/unpairing trackers (w/ events)
- Turning off trackers
- Set COM communication channel
- Manually request data from dongle
- Add getting interpreter's com.ts/bluetooth(-linux).ts instances
- Allows you to run methods inside those files with the instance currently being used by the interpreter
- Add processing of some wireless BT data when received
- Add TS types & definitions
- Add extra failsafes if receiving no data
- BT code times out if discovery of services/characteristics take too long
- Data timeouts in listenToDeviceEvents() that removes & disconnects the tracker if no "data" event is fired after 10 seconds
- Add numerous (un)known UUIDs for wireless BT trackers
- Increase canSendButtonData timeout to 2000
- Numerous logging changes
- Optimizations to writing to COM ports
- Update packages
- Fix BTSPP detection on Windows
- This is something I can't really test, I don't have any BTSPP devices
- Fix bluetooth initialization errors (even when perfectly fine)
- Fix GX dongle per-tracker settings
- Fully stable now, no need to "not recommend" anymore
- Fix battery processing breaking interpreter if trackers aren't assigned yet
- Fix removeActiveDevices() returning nothing
- Fix "null" and "DONGLE" tracker ids
- Fix "fireEventName()" methods with BT + COM enabled
- Fix fireTrackerBattery() not processing BT battery & add delay before reading battery for COM
- Remove "no button pressed" log
- Fix error printing
- Other bug fixes & optimizations
Installation
npm install haritorax-interpreter
Documentation
Will write actual documentation at some point, for now refer to the source code, examples, and JSDoc comments. You may also see how it's used in SlimeTora!
Supported devices
Device | Supported | Elbow/Hip support |
---|---|---|
HaritoraX Wireless | Y | Y |
HaritoraX 1.1B | Y | Y |
HaritoraX 1.1 | Y | Y |
HaritoraX 1.0 | Y | Y |
Haritora | ? | ? |
Communication mode | Supported |
---|---|
Bluetooth (Low Energy) | Y |
Bluetooth Classic (COM) | Y |
GX6 Communication Dongle | Y |
GX2 Communication Dongle | Y |
Example
import { HaritoraX } from "haritorax-interpreter";
// connect to haritorax wireless, enable debug logs, allow printing of processIMUData() logs (lots of spam), print raw unprocessed data (more spam!)
let device = new HaritoraX("wireless", true, true, true);
// start connecting to dongles via GX dongles (COM connection), with the ports COM4, COM5, COM6, and COM7
device.startConnection("com", ["COM4", "COM5", "COM6", "COM7"]);
device.on("imu", (trackerName, rotation, gravity, ankle) => {
// IMU data received, do stuff
});
setTimeout(() => {
// apply the following settings to the rightAnkle tracker:
// sensor mode: 1 (magnetometer enabled)
// posture data transfer rate: 100FPS
// sensor auto correction mode: accelerometer and gyroscope
// ankle motion detection: enabled
device.setTrackerSettings("rightAnkle", 1, 100, ['accel', 'gyro'], true);
}, 2000)
setTimeout(() => {
device.stopConnection("com");
}, 10000)
Full Changelog: v3.0.1...v3.1.0