SlimeVR / SlimeVR-Tracker-ESP

SlimeVR tracker firmware for ESP32/ESP8266 and different IMUs
Apache License 2.0
856 stars 292 forks source link

Two commands for enabling features #254

Open ImUrX opened 1 year ago

ImUrX commented 1 year ago

First is getting tracker features, this command should provide features by following this new type:

u8[u32]

u8 specifying the length of the array and then the amount of u32s :p

The features are done via bitfields so each bit of the u32 numbers means something, for now we will be using little endian for processing the data but its gonna be shown in the actual network packet as big endian but the spec would specify what each bit is so we are gonna use indexing for defining fields:

  1. RUNTIME_MAG_SUPPORT
  2. MAG_ENABLED
  3. CALIBRATION_SUPPORT
  4. BLINK_SUPPORT

So first bit (depends of endianness) tells you if the tracker itself has support for runtime magnetometer management #230 and second bit lets you know if it's enabled or disabled.

Second command is tracker trigger, this let's you trigger commands based on the previous feature, it has two arguments which the first one is based on u16 (which is bigger than 256*32) and second one should only be a boolean for setting stuff to one or zero but we could flex this dependent to the first argument (needs to be discussed). The first argument should refer to one of the index of tracker features (needs to be discussed) and it triggers that feature so you do TRIGGER 3 and then tracker should blink. But this doesn't mean every feature triggers stuff like TRIGGER 0 should do nothing. TRIGGER 1 true should set MAG_ENABLED to true and vice versa.

This is a very flexible idea and shouldnt be that complicated to implement

ImUrX commented 1 year ago

I must specify this is not a Serial command, its 3 network packets qwq

ImUrX commented 1 year ago

the command stuff was to simplify explaining things, im sorry

ImUrX commented 1 year ago

updated how the array would actually work ;-;

TheDevMinerTV commented 1 year ago

I've started working on this in impl/feature-retrieval.

Eirenliel commented 1 year ago

I've started working on this in impl/feature-retrieval.

istg someone already did it for some feature, but i can't find which PR it's in...

nekomona commented 1 year ago

istg someone already did it for some feature, but i can't find which PR it's in...

like this one? #241

TheDevMinerTV commented 1 year ago

We can integrate that into the code, I guess.

I'm currently refactoring the network code, which is pretty bad right now :D

Eirenliel commented 1 year ago

istg someone already did it for some feature, but i can't find which PR it's in...

like this one? #241

no