* 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>
* Reverse IMU I2C address from supplement to full
* Formatting fix
* More formatting
* Make suggested change to improve compatibility with lazy people
* Create CODEOWNERS
* Fix include and C++ standards
* Try to make WiFi printout more standard
* Handle ESP8266 WiFi encryption type
ESP8266 WiFi encryption type is according to 802.11, while ESP32 seems to report based on whatever... It would also be oh so convenient if we just report the name, so here it is
* Use tabs with quotes for WiFi scan
It was mentioned this would be easier for parsing, so I'll just leave it the same but with quotes, as it's still just as readable now
* Reformat with clang-format
* Designate all initializer clauses to fix compiler errors with newer
compilers
* ESP32C6 support
* fshelper: fixed ESP8266 regression caused by abstracting FS access #321 (#328)
* fshelper: fixed ESP8266 regression caused by abstracting FS access #321
* Removing not needed ifdef
l0ud spotted that this is not need.
Co-Authored-By: Przemyslaw Romaniak <przemyslaw.romaniak@intel.com>
---------
Co-authored-by: Przemyslaw Romaniak <przemyslaw.romaniak@intel.com>
* Fix enabling motion bias estimation (#325)
* fix pre-processor warning
* add macro for calculating radians (#317)
* feat: add macro for calculating radians
* style: silence unused variable warning
* remove unnecessary float cast in macro
* SoftFusion sensor framework with BMI, ICM, LSM6, MPU sensor implementations (#322)
* Update readme to mention BMI270 support.
* Soft fusion sensor initial code, wip
* Soft fusion ICM-42688-P lazy WIP implementation.
* sfusion: Cleanup, implemented sensor frequency calibration
* icm42688: add more comments, basic driver (no hw filtering) should be working
* sfustion: compilation fix
* sfusion: start calibration when upside down
* cleanup: remove confusing had data flag
* sensor manager: use unique_ptr instead of raw pointers
* sfusion: big refactoring wip
* sfusion: make aux work, at least sfusion sensors should now be functional
* sfusion: lightweight implementation of BMI270 sensor, no sensitivity cal yet
* sfusion: BMI270: added CRT and gyro zx factor. should be functionally equivalent to the old driver
* Added lsm6dsv
* Trying to work around esp32c3 compilation problem, not liking that solution
* sfusion: fix problems found after rebase
* Update README.md
* Bump Arduino core to 3.0 to match GCC12
* Remove fast pin swapping that is no longer compatible with arduino core v3
* Bring back fast pin swapping
* Update platformio-tools.ini
* Fix accel timescale (calibration no longer takes forever)
* Fix non-sfusion sensors
* Added LSM6DSO and DSR support and refactored DSV support
* Removed template float param from the implementation
* sfusion: port MPU6050 driver wip, not expecting to be functional yet
* sfusion: add headers specifying main code owners
* connection: fix warning
* update README.md
* fshelper: fixed ESP8266 regression caused by abstracting FS access
* sfusion: fix error on merge
* bno080: differentiate bno080, bno085, bno086 again
* sfusion: final touches
* restore hadData functionality, implementing it in every sensor, made configured flag bno-only
* fix address supplement in non-sfusion sensors, do i2c bus reset for all sensors
* sfusion: make MPU6050 driver use normal MPU6050 ImuID, change eatSamplesAndReturn function to take ms instead of seconds
* sfusion: hotfix, don't apply sensorOffset, it's applied in sensor base
* Log FIFO overruns on LSMs
* Reset the soft watchdog while eating or collecting calibration samples
Resolves an issue where the soft watchdog would trigger.
* Fix missing word in comment, switch to constexpr
* Update esp32/esp8266
---------
Co-authored-by: Gorbit99 <gorbitgames@gmail.com>
Co-authored-by: nekomona <nekomona@nekomona.com>
Co-authored-by: nekomona <nekomona@163.com>
Co-authored-by: unlogisch04 <98281608+unlogisch04@users.noreply.github.com>
Co-authored-by: kounocom <meia@kouno.xyz>
Co-authored-by: Kubuxu <oss@kubuxu.com>
* Add Haritora to consts (#333)
Add haritora consts, fix misspelling
* dont double scan i2c address on bus for ESP32C6
* add custom portmap for ESP32C6
* update to latest tasmota tools for ESP32C6
* serial over USB
* remove change that does nothing
* remove 2s wait in main.cpp it´s not required
* make it change neutral
* more change neutrality
---------
Co-authored-by: unlogisch04 <98281608+unlogisch04@users.noreply.github.com>
Co-authored-by: Przemyslaw Romaniak <przemyslaw.romaniak@intel.com>
Co-authored-by: Meia Kouno <71262281+kounocom@users.noreply.github.com>
Co-authored-by: Fredrik Hatletvedt <32248439+Pespiri@users.noreply.github.com>
Co-authored-by: Przemyslaw Romaniak <loudpl@gmail.com>
Co-authored-by: Gorbit99 <gorbitgames@gmail.com>
Co-authored-by: nekomona <nekomona@nekomona.com>
Co-authored-by: nekomona <nekomona@163.com>
Co-authored-by: kounocom <meia@kouno.xyz>
Co-authored-by: Kubuxu <oss@kubuxu.com>
Co-authored-by: JovannMC <jovannmc@femboyfurry.net>
Co-authored-by: Eiren Rain <Eirenliel@users.noreply.github.com>
On a normal reset, we set the CRT (motionless) registers at startup, and then apply the calibrated gryo offset to every gyro sample.
Previously, we performed gyro offset calibration before CRT calibration. This means that we are actually calculating the gyro offset based on a CRT of 0, instead of the actual CRT.
This change performs CRT calibration before gyro calibration, so that the gryo offset is based on the actual CRT.