* Send vendor information on handshake
Embed vendor information into build parameters & defines so SlimeVR vendors can maintain their own firmware updates without adding new boards
Bump protocol version to 21
* Fix build flags quotes
* Report in GET TEST if magnetometer is not found
* Remove vendor flags from platformio.ini
* Fix 0 byte string sending and check for lengths
* Formatting
* Make sure the size assert actually works
* Formatting
* Update src/globals.h
Co-authored-by: unlogisch04 <98281608+unlogisch04@users.noreply.github.com>
* Log vendor information
* Formatting
---------
Co-authored-by: gorbit99 <gorbitgames@gmail.com>
Co-authored-by: unlogisch04 <98281608+unlogisch04@users.noreply.github.com>
* Make SPI work
Move sensor building logic to a separate class and file
Don't use templates for RegisterInterface/I2CImpl/SPIImpl
This started getting ridiculous, now we can actually maintain it.
Make BNO085 work again
Add BNO to automatic detection, remove a bunch of others
Not all IMU types are enabled right now due to code size optimization, but it could be expanded in the future with optimization of Softfusion.
Pick IMU type automatically by asking it
* ESP32 spelling fix (#396)
Fix: ES32 -> ESP32
* (Probably) multiply acceleration by tracker rotation offset
* Remove stome stuff from softfusionsensor
* Missed stuff
* Undo defines changes
* Undo debug.h changes
* Uses32BitSensorData is unneccessary now
* Remove some unnecessary variables
* Cleanup some logging text
* Formatting
* Split SensorBuilder into a header-source file pair
* Fix copyright
* Fix some issues with glove after all the changes
Add definitions for SlimeVR v1.2
Fix typo and add comments to quaternion sandwich function
* Add NO_WIRE definition for SPI devices
* Fix formatting
* Minor fix
* If ICM-45686 not found, ask again nicely
* Fix MCP interface not building
* Remove uneccessary "default" ctor from SPIImpl
* Remove buildSensorReal
* Invert if statement in sensorbuilder+
* Fix formatting
* If ICM-45686 not found, ask again nicely
* Fix MCP interface not building
* Fix formatting
* Various cleanup
* Formattign
* Fix detected logic
* Remove unnecessary Self using
* For some reason this fixes memory corruption issues
* Formatting
* This actually works this time
* Small cleanup
* Remove some unused includes
* Formatting
* Mag support (Attempt 2) (#458)
* WhoAmI check working
* In theory this should be setting up the mag
* Not sure how that happened
* Add magnetometer status to GET TEST and GET INFO
* Formatting
* Formatting 2
---------
Co-authored-by: Eiren Rain <Eirenliel@users.noreply.github.com>
Co-authored-by: Butterscotch! <bscotchvanilla@gmail.com>
* fix debugbuild
* make all esp32 define the same
only check if ESP32 is defined. The value changed from "1" to "ESP32" in pioarduino and tasmota in newer versions.
* Run CI for new boards with own defines
* Do not redefine board when defined from CI or other places
* Move sensor defaults to the separate file too
* Add comment to sensor offset
* Add a way to ask for raw accel from BNO08X
* Merge fix
* Update from suggestions
* Fix typos
* Move some stuff around and apply suggestions
* Fix formatting
* Add defines for all other boards too
* Make glove buildable
* Make failed build report better
* Make SPI work
Move sensor building logic to a separate class and file
Don't use templates for RegisterInterface/I2CImpl/SPIImpl
This started getting ridiculous, now we can actually maintain it.
Make BNO085 work again
Add BNO to automatic detection, remove a bunch of others
Not all IMU types are enabled right now due to code size optimization, but it could be expanded in the future with optimization of Softfusion.
Pick IMU type automatically by asking it
* ESP32 spelling fix (#396)
Fix: ES32 -> ESP32
* (Probably) multiply acceleration by tracker rotation offset
* Split SensorBuilder into a header-source file pair
* Fix copyright
* Fix some issues with glove after all the changes
Add definitions for SlimeVR v1.2
Fix typo and add comments to quaternion sandwich function
* Add NO_WIRE definition for SPI devices
* Fix formatting
* Minor fix
* If ICM-45686 not found, ask again nicely
* Fix MCP interface not building
* Remove uneccessary "default" ctor from SPIImpl
* Remove buildSensorReal
* Invert if statement in sensorbuilder+
* Fix formatting
* If ICM-45686 not found, ask again nicely
* Fix MCP interface not building
* Fix formatting
* Various cleanup
* Formattign
---------
Co-authored-by: Butterscotch! <bscotchvanilla@gmail.com>
Co-authored-by: gorbit99 <gorbitgames@gmail.com>
* [ICM45*] Fix processing bad samples and stack overflow panics
1. At startup, we were receiving invalid samples from the IMU and passing it to
VQF. This causes huge initial rotations and accelerations that takes time
for VQF to eliminate.
Fix is to check the header to see if the data is present. Also had to add a
check for invalid gyro samples even though it is present.
2. During play, the tracker would rarely go haywire and jump into a random
position. I suspect this is caused by a stack overflow, which causes the
tracker to panic. Combined with problem (1), whenever the tracker restarts,
it would send huge rotations and accelerations to the server. This causes
the jump.
Fix is to make the read_buffer static, so that it's reserved on the BSS
segment instead of the stack. I noticed this because I was getting panics
when I tried to increase the size of the read buffer, or declared some new
stack variables.
After implementing these two fixes, rotation and acceleration are stable at
startup, and I am able to make modifications to the icm45base code without
randomly encountering panics.
* Always read one fewer packet to prevent AN-000364 2.16 errata
* BNO085 add more Features and Readouts to the lib
* BNO085 add
- Experimental compiler flags for disable Calibration
- Temp Readout (all 1 sec)
- Inspection only send when updated
- added conginue as 1 imu.dataAvailable() only reads out 1 packet of data
* BNO085 add source of info
After a reboot of the tracker the optional sensor did show up on the server too.
This is because a sensor packet was sent from all sensors including empty and unknown.
This should hopefully fix the issue.
It is a fast fix. It probably would be better to move all this check to sensor, and if the sensor has a chang set the flag, and reset the flag if the function gets called.
* Refactor toggles into separate class
* Add vqf toggles to config bits
* Load toggles into the sensor
* Mark correct toggles as supported for VQF
* Zero out calibration if it's disabled for softfusioncalibration
* Fix BNO085 typo
* Formatting
* hotfix: scan for IMU on bus twice
* hotfix: never fully empty icm45 fifo
* leave one packet, not one byte
* Formatting
---------
Co-authored-by: gorbit99 <gorbitgames@gmail.com>
* fix_sensorConfigData Magnetometer not avaliable on Server
* fix formating
* Send Sensor Configuration changes to Server.
before the Magnetometerchanges would not have been sent to the Server.
* Formating
* Refactor packets into structures
* Remove left in packet code
* Swap multi-byte data to big endian
* Refactor convert_to_bytes to use std::reverse instead
* Missed removing some old code
* Fix convert_to_chars refactor
* Add comment to legacy fields
* Add back rest of cut off comment
* Move temperature reading into the FIFO whenever possible (no love for MPU)
* Calculate gradient and feed into VQF
* Per sensor VQF params
* Split out classic softfusion calibration
* Cleanup
* Nonblocking calibration implemented
* Oops
* Formatting
* Make sure it actually compiles
* Use calibrated ZRO values
* Fix compilation errors and warnings
* Send temperature in correct place
* Add DELCAL command
* Slightly optimize ICM45 fifo handling
* Implement time taken measurer
* Precalculate nonblocking zro change
* Adjusted debug.h
* Reduced ICM45 accel rate to 102.4Hz
* Poll sensor at the same time we send data
* I hate git again
* Undo icm45 optimization
* Don't copy memory on ICM45 reads
* Change relevant doubles to floats
* Remove unnecessary union
* Fix guards to profiler
* Move temperature reading into the FIFO whenever possible (no love for MPU)
* Calculate gradient and feed into VQF
* Per sensor VQF params
* Split out classic softfusion calibration
* Cleanup
* Nonblocking calibration implemented
* Oops
* Formatting
* Make sure it actually compiles
* Use calibrated ZRO values
* Fix compilation errors and warnings
* Send temperature in correct place
* Add DELCAL command
* Slightly optimize ICM45 fifo handling
* Implement time taken measurer
* Precalculate nonblocking zro change
* Adjusted debug.h
* Reduced ICM45 accel rate to 102.4Hz
* Poll sensor at the same time we send data
* Undo icm45 optimization
* Don't copy memory on ICM45 reads
* Change relevant doubles to floats
* Remove unnecessary union
* Fix guards to profiler
* Fixes after rebase
* Fix after rebase
* Fix formatting
* Make SPI work
* Revert "Make SPI work"
This reverts commit 92bc946eaa.
* Rename to RuntimeCalibration
* Disable profiling
---------
Co-authored-by: Eiren Rain <Eirenliel@users.noreply.github.com>
* Add calibration reading commands for BNO08X
* Disable accelerometer calibration 1 minute after start up on BNO08X
Also save dynamic calibration periodically
* Work on new sensor interface to abstract I2C hardware
* Fix compile errors
* Abstract int pin and add multiplexer libraries
* Update IMU list to use new interfaces
* Make other IMUs definable, not only BNOx
* Fix build for ESP32
* Add TPS tracking code
Rename IMU_DESC_LIST to SENSOR_DESC_LIST
Start work on many-imu glove support
* Add PCA9546A support & glove imus list
* WIP use pointers properly
* I love C++ <3
* c++ is magic
* Fix build error because of typo
* Fix warnings
* Fix pinouts and some other issues
* Fix I2C with multiplexer
* Implement sending bone position
Implement sending flex data,
Minor refactoring
* Add tracker type to the protocol
* Work on analog sensors support
* Fix build errors
* Fix rebase conflict
* Apply formatting
* Update protocol to match server
* Fix thumb bone names
* Add an important comment
* Fix protocol compatibility
* Update defines for default configuration
* Minor comments and cleanups
* Format defines
* Formatting
* Formatting with proper clang
* Fucking clang
* Minor fixes after merge
* Fix formatting
* Remove unnecessary virtual keyword
* Remove delay on I2C clear error so OTA doesn't break
* Address some of the review comments
* Fix formatting
* Minor include imporvement
* Make new defines enums
* Fix build for sfusion
* Add IMU timeout detection to `SoftFusionSensor`
* Early return, use constexpr
* Define a sensor timeout error code
* Use enum instead of define
* Avoid false timeout on timer overflow
* Revert "Avoid false timeout on timer overflow"
This reverts commit f4c2835c7f.
* Use millis instead of micros
* Use SH-2 error codes
* Add rest calibration detection for the sensors that support it
* Resend sensor packet on calibration
* Renamed completedRestCalibration to hasCompletedRestCalibration
* Log when rest calibration is completed
---------
Co-authored-by: Eiren Rain <Eirenliel@users.noreply.github.com>
* Make I2Cscan non-blocking
* Address suggestions
* Use portExclude again
* Re-add some comments
* It's 8 AM and I'm allowed to be stupid
* No more while(true)
* More cleanup
* ...and more
* even more!
* Thanks clang-format
* Do not scan the same port twice
---------
Co-authored-by: Eiren Rain <Eirenliel@users.noreply.github.com>