Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamic Sfusion #363

Closed
wants to merge 105 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
105 commits
Select commit Hold shift + click to select a range
5cc67f2
sfusion: Use MBE
kounocom Jul 14, 2024
9c3bb73
sfusion: Tune MBE parameters
kounocom Jul 14, 2024
bfa3df9
sfusion: Unify full-scale ranges for all sensors (1000DPS/4G)
kounocom May 29, 2024
d383d45
sfusion: Perform custom motionless calibration before gyro offset
kounocom Jul 14, 2024
6b53da1
LSM6DSV: Increase accel ODR to 240Hz
kounocom Aug 21, 2024
9f52744
LSM6DSO: Increase accel ODR to 208Hz
kounocom Aug 21, 2024
ea1dfbd
BMI270: Increase accel ODR to 200Hz
kounocom Aug 21, 2024
1e0fc4a
sfusion: Adjust VQF params
kounocom Aug 21, 2024
04895aa
sfusion: Disable calibration entirely
kounocom Aug 21, 2024
9275f62
Skip loading sensor calibration
gorbit99 Aug 25, 2024
5c26f04
Put temperature into the FIFO wherever possible
gorbit99 Sep 11, 2024
28f37ef
Average temperatures and calculate change from that
gorbit99 Sep 11, 2024
52c84cc
Make biasForgettingTime temperature dependant
gorbit99 Sep 11, 2024
52ab595
Moved over some lines I missed
gorbit99 Sep 11, 2024
c627d0f
Decouple direct temperature sampling and sending
gorbit99 Sep 11, 2024
4171284
Add temperature stability constants for LSMs
kounocom Sep 11, 2024
4d992d6
Increase trust for MBE
kounocom Sep 11, 2024
e0c219b
Added per sensor VQF params
gorbit99 Sep 11, 2024
5da7022
Merge branch 'random-dev-branch-do-not-use' of https://github.com/kou…
gorbit99 Sep 11, 2024
aeb0291
There's definitely a better way to do this
kounocom Sep 12, 2024
f9caa07
Fix crash
gorbit99 Sep 12, 2024
7cfaa3e
Merge branch 'random-dev-branch-do-not-use' of https://github.com/kou…
gorbit99 Sep 12, 2024
4caaec7
Fix shaky tracker issue
gorbit99 Sep 12, 2024
4b4e055
Added non-blocking calibration
gorbit99 Sep 14, 2024
dcea19b
Don't use non-blocking calibration without USE_NONBLOCKING_CALIBRATION
gorbit99 Sep 14, 2024
a6ea9c0
Default to non-blocking calibration
kounocom Sep 16, 2024
01e97b1
Fifo overrun detection for bmi270
gorbit99 Sep 16, 2024
27b28d5
Fixed oddities during calibration
gorbit99 Sep 16, 2024
e80aaed
Fixed calibrations being calculated improperly
gorbit99 Sep 16, 2024
35344c2
Add the ability to calibrate all accel axes
gorbit99 Sep 16, 2024
7eda85a
Skip accel until next rest
gorbit99 Sep 16, 2024
fab0e3a
Calibrate gyro at 2 temperatures
gorbit99 Sep 16, 2024
7755b56
Lerp gyro offset between temperatures
gorbit99 Sep 16, 2024
5042735
Calibrate ZRO change rate
gorbit99 Sep 16, 2024
c14a0c6
make it 10x worse i guess
kounocom Sep 17, 2024
9b24282
Update more vqf params
kounocom Sep 17, 2024
498db44
Only print the calibration that was performed
gorbit99 Sep 17, 2024
60212a2
Blink LED when calibration step completed
gorbit99 Sep 17, 2024
c23ce1e
Merge branch 'random-dev-branch-do-not-use' of https://github.com/kou…
gorbit99 Sep 17, 2024
63bfa55
use logger
kounocom Sep 17, 2024
0040998
don't log that
kounocom Sep 17, 2024
68695a1
Fix BMI270 temperature reading
gorbit99 Sep 17, 2024
f7391b7
overclock 8266 by default
kounocom Sep 17, 2024
1b40787
Merge branch 'random-dev-branch-do-not-use' of https://github.com/kou…
kounocom Sep 17, 2024
c004563
reset defines
kounocom Sep 17, 2024
174e484
Implement getActiveSensorCount
gorbit99 Sep 17, 2024
c343959
Merge branch 'random-dev-branch-do-not-use' of https://github.com/kou…
gorbit99 Sep 17, 2024
cae480c
Merge branch 'random-dev-branch-do-not-use' of https://github.com/kou…
kounocom Sep 17, 2024
3fcc5d3
Cap TPS when esp8266 & aux
kounocom Sep 17, 2024
f18dfa8
overclock in platformio-tools
kounocom Sep 17, 2024
7bb5c36
Automatically expand the gyro calibration
gorbit99 Sep 18, 2024
4f026d2
Separate LSM6DS3 and LSM6DS3TR-C
kounocom Sep 18, 2024
dacbf76
Unify IMU params further
kounocom Sep 18, 2024
fc55aad
Merge branch 'dynamic-sfusion' of https://github.com/kounocom/SlimeVR…
kounocom Sep 18, 2024
54dc7a8
Refactor nonblocking calibration code
gorbit99 Sep 18, 2024
0dbd452
Merge branch 'dynamic-sfusion' of https://github.com/kounocom/SlimeVR…
gorbit99 Sep 18, 2024
8a63326
In theory this works?
gorbit99 Sep 25, 2024
9c2055c
Actually allow the calibration to be cancelled
gorbit99 Sep 29, 2024
8500fee
Add delay into calibration steps
gorbit99 Sep 29, 2024
9798738
Make rest detection more sensitive
kounocom Sep 29, 2024
f219cc3
Always limit TPS with aux (now to 90)
kounocom Sep 29, 2024
db71a05
change to 4g, fill in missing stuff elsewhere
kounocom Sep 30, 2024
44e2aaf
This works better
kounocom Oct 1, 2024
eec8ac6
Actually enable FIFO this time
gorbit99 Oct 1, 2024
bc65001
Use clock
kounocom Oct 1, 2024
1aae55a
Use 8KB FIFO
kounocom Oct 2, 2024
73faa41
Sleep more
kounocom Oct 2, 2024
6515014
Hires mode maybe?
gorbit99 Oct 2, 2024
b84096c
Merge branch 'icm45686-firmware' of https://github.com/gorbit99/Slime…
gorbit99 Oct 2, 2024
6eb1ef9
Use correct sensitivity
kounocom Oct 2, 2024
6f74905
Merge branch 'icm45686-firmware' into dynamic-sfusion
gorbit99 Oct 2, 2024
099fd9a
Stuffs for dynamic
kounocom Oct 2, 2024
1e47ff7
Increase sensitivity when gyro is calibrated + skip accel calibration…
gorbit99 Oct 8, 2024
ea5ea1a
Merge branch 'dynamic-sfusion' of https://github.com/kounocom/SlimeVR…
gorbit99 Oct 8, 2024
5222085
ACTUALLY skip accel calibration
gorbit99 Oct 8, 2024
3d9ad76
Zero out accel calibration
gorbit99 Oct 8, 2024
afb4d32
Whoops
gorbit99 Oct 8, 2024
2f2c248
Adjust VQF params more
kounocom Oct 11, 2024
1faff26
...and some more
kounocom Oct 11, 2024
4950a17
...and then make them actually work per-sensor
kounocom Oct 11, 2024
2ef6306
...and then light the LED when rest is detected, as a debug step
kounocom Oct 11, 2024
f1ac5aa
...and finally, change whatever these do
kounocom Oct 11, 2024
fede1e3
Merge commit 'b278bcfcf4d5bcc4a71d25d4485510c11bd8d530' into dynamic-…
gorbit99 Nov 12, 2024
5457a0d
Merge commit '2946a6a7a69ce2b0052cc5ba44ba020429bce2f3' into dynamic-…
gorbit99 Nov 12, 2024
325a5ce
Merge commit '85dead25f339bc3a6d79a147b6ca0e9e55741f1d' into dynamic-…
gorbit99 Nov 12, 2024
9ab9ee7
Merge commit 'a9f5b1ae8c65e13856d14dacdef5dc341e42f7b5' into dynamic-…
gorbit99 Nov 12, 2024
56a3507
Merge commit 'a4a9778f62d0b962c46898d03e9ce70171a1ca12' into dynamic-…
gorbit99 Nov 12, 2024
35cc25b
Merge commit '50fa801653022f5b2604cfdb06915b6211b28f43' into dynamic-…
gorbit99 Nov 12, 2024
ff5836c
Merge commit '0b882db74f6565fc8b63f6ae638f951dec4441d4' into dynamic-…
gorbit99 Nov 12, 2024
14e3891
Merge commit '628fe209609956c8d5ba8af83cb54d52fdf7e71b' into dynamic-…
gorbit99 Nov 12, 2024
9d96d19
ICM45 implementation
gorbit99 Nov 12, 2024
4ba3b5b
Make sure it builds even without nonblocking calibration
gorbit99 Nov 12, 2024
69951cb
Fix clangformat errors
gorbit99 Nov 12, 2024
ca68392
Apply suggestions from code review
gorbit99 Nov 12, 2024
c7fb10c
define USE_NONBLOCKING_CALIBRATION as true instead
gorbit99 Nov 12, 2024
4ff6e1b
Increase clang format version to 18
gorbit99 Nov 12, 2024
b9aad36
Apply formatting
gorbit99 Nov 12, 2024
7a8d980
Apply even more formatting
gorbit99 Nov 13, 2024
e20c0d2
Even more linting
gorbit99 Nov 13, 2024
49ef1ef
Linting test
gorbit99 Nov 13, 2024
75fc842
Base formatting
gorbit99 Nov 13, 2024
b7e05ca
Manually clear up issues
gorbit99 Nov 13, 2024
8a10e2b
Remove unnecessary change to includes
gorbit99 Nov 13, 2024
f388d8f
fuck
kounocom Dec 11, 2024
3e6ef0d
Make ICM45 rest detection more lenient
kounocom Jan 1, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
use logger
kounocom committed Sep 17, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 63bfa55147add781eee62be09006b9c91af53ce5
36 changes: 18 additions & 18 deletions src/sensors/softfusion/NonBlockingCalibration.h
Original file line number Diff line number Diff line change
@@ -40,6 +40,8 @@ namespace SlimeVR::Sensors {
template <typename IMU>
class NonBlockingCalibrator {
public:
mutable SlimeVR::Logging::Logger logger{"DynamicCalibration"};

NonBlockingCalibrator(
SensorFusionRestDetect& fusion,
float accelScale,
@@ -278,8 +280,6 @@ class NonBlockingCalibrator {
configuration.setCalibration(sensorId, calibration);
configuration.save();

printf("New calibration saved!\n");

ledManager.blink(100);
}

@@ -295,45 +295,45 @@ class NonBlockingCalibrator {
| CalibrationPrintFlags::GYRO_BIAS | CalibrationPrintFlags::ACCEL_BIAS;

void printCalibration(CalibrationPrintFlags toPrint = PrintAllCalibration) {
printf("Current calibration:\n");
logger.info("Current calibration:");

if (any(toPrint & CalibrationPrintFlags::TIMESTEPS)) {
if (calibrationConfig.sensorTimestepsCalibrated) {
printf(
"\tCalibrated timesteps: Accel %f, Gyro %f, Temperature %f\n",
logger.info(
"Calibrated timesteps: Accel %f, Gyro %f, Temperature %f",
calibrationConfig.A_Ts,
calibrationConfig.G_Ts,
calibrationConfig.T_Ts
);
} else {
printf("\tSensor timesteps not calibrated\n");
logger.info("Sensor timesteps not calibrated");
}
}

if (HasMotionlessCalib && any(toPrint & CalibrationPrintFlags::MOTIONLESS)) {
if (calibrationConfig.motionlessCalibrated) {
printf("\tMotionless calibration done\n");
logger.info("Motionless calibration done");
} else {
printf("\tMotionless calibration not done\n");
logger.info("Motionless calibration not done");
}
}

if (any(toPrint & CalibrationPrintFlags::GYRO_BIAS)) {
if (calibrationConfig.gyroPointsCalibrated != 0) {
printf(
"\tCalibrated gyro bias at %fC: %f %f %f\n",
logger.info(
"Calibrated gyro bias at %fC: %f %f %f",
calibrationConfig.gyroMeasurementTemperature1,
calibrationConfig.G_off1[0],
calibrationConfig.G_off1[1],
calibrationConfig.G_off1[2]
);
} else {
printf("\tGyro bias not calibrated\n");
logger.info("Gyro bias not calibrated");
}

if (calibrationConfig.gyroPointsCalibrated == 2) {
printf(
"\tCalibrated gyro bias at %fC: %f %f %f\n",
logger.info(
"Calibrated gyro bias at %fC: %f %f %f",
calibrationConfig.gyroMeasurementTemperature2,
calibrationConfig.G_off2[0],
calibrationConfig.G_off2[1],
@@ -344,21 +344,21 @@ class NonBlockingCalibrator {

if (any(toPrint & CalibrationPrintFlags::ACCEL_BIAS)) {
if (allAccelAxesCalibrated()) {
printf(
"\tCalibrated accel bias: %f %f %f\n",
logger.info(
"Calibrated accel bias: %f %f %f",
calibrationConfig.A_off[0],
calibrationConfig.A_off[1],
calibrationConfig.A_off[2]
);
} else if (anyAccelAxesCalibrated()) {
printf(
"\tPartially calibrated accel bias: %f %f %f\n",
logger.info(
"Partially calibrated accel bias: %f %f %f",
calibrationConfig.A_off[0],
calibrationConfig.A_off[1],
calibrationConfig.A_off[2]
);
} else {
printf("\tAccel bias not calibrated\n");
logger.info("Accel bias not calibrated");
}
}
}