Skip to content

Commit

Permalink
Squashed commit of the following:
Browse files Browse the repository at this point in the history
commit f1ac5aa
Author: kounocom <meia@kouno.xyz>
Date:   Fri Oct 11 17:02:48 2024 +0300

    ...and finally, change whatever these do

commit 2ef6306
Author: kounocom <meia@kouno.xyz>
Date:   Fri Oct 11 16:58:25 2024 +0300

    ...and then light the LED when rest is detected, as a debug step

commit 4950a17
Author: kounocom <meia@kouno.xyz>
Date:   Fri Oct 11 16:56:03 2024 +0300

    ...and then make them actually work per-sensor

commit 1faff26
Author: kounocom <meia@kouno.xyz>
Date:   Fri Oct 11 16:54:54 2024 +0300

    ...and some more

commit 2f2c248
Author: kounocom <meia@kouno.xyz>
Date:   Fri Oct 11 16:54:09 2024 +0300

    Adjust VQF params more

commit afb4d32
Author: gorbit99 <gorbitgames@gmail.com>
Date:   Tue Oct 8 18:33:54 2024 +0200

    Whoops

commit 3d9ad76
Author: gorbit99 <gorbitgames@gmail.com>
Date:   Tue Oct 8 18:27:55 2024 +0200

    Zero out accel calibration

commit 5222085
Author: gorbit99 <gorbitgames@gmail.com>
Date:   Tue Oct 8 18:25:53 2024 +0200

    ACTUALLY skip accel calibration

commit ea5ea1a
Merge: 1e47ff7 099fd9a
Author: gorbit99 <gorbitgames@gmail.com>
Date:   Tue Oct 8 18:06:25 2024 +0200

    Merge branch 'dynamic-sfusion' of https://github.com/kounocom/SlimeVR-Tracker-ESP into dynamic-sfusion

commit 1e47ff7
Author: gorbit99 <gorbitgames@gmail.com>
Date:   Tue Oct 8 17:56:29 2024 +0200

    Increase sensitivity when gyro is calibrated + skip accel calibration for now

commit 099fd9a
Author: kounocom <meia@kouno.xyz>
Date:   Wed Oct 2 08:48:46 2024 +0300

    Stuffs for dynamic

commit 6f74905
Merge: 44e2aaf 6eb1ef9
Author: gorbit99 <gorbitgames@gmail.com>
Date:   Wed Oct 2 07:29:34 2024 +0200

    Merge branch 'icm45686-firmware' into dynamic-sfusion

commit 6eb1ef9
Author: kounocom <meia@kouno.xyz>
Date:   Wed Oct 2 07:39:19 2024 +0300

    Use correct sensitivity

commit b84096c
Merge: 6515014 73faa41
Author: gorbit99 <gorbitgames@gmail.com>
Date:   Wed Oct 2 03:59:36 2024 +0200

    Merge branch 'icm45686-firmware' of https://github.com/gorbit99/SlimeVR-Tracker-ESP into icm45686-firmware

commit 6515014
Author: gorbit99 <gorbitgames@gmail.com>
Date:   Wed Oct 2 03:59:24 2024 +0200

    Hires mode maybe?

commit 73faa41
Author: kounocom <meia@kouno.xyz>
Date:   Wed Oct 2 03:11:08 2024 +0300

    Sleep more

commit 1aae55a
Author: kounocom <meia@kouno.xyz>
Date:   Wed Oct 2 03:00:55 2024 +0300

    Use 8KB FIFO

commit bc65001
Author: kounocom <meia@kouno.xyz>
Date:   Wed Oct 2 02:50:59 2024 +0300

    Use clock

commit eec8ac6
Author: gorbit99 <gorbitgames@gmail.com>
Date:   Tue Oct 1 23:56:46 2024 +0200

    Actually enable FIFO this time

commit 44e2aaf
Author: kounocom <meia@kouno.xyz>
Date:   Tue Oct 1 21:06:15 2024 +0300

    This works better

commit db71a05
Author: kounocom <meia@kouno.xyz>
Date:   Mon Sep 30 17:03:19 2024 +0300

    change to 4g, fill in missing stuff elsewhere

commit f219cc3
Author: kounocom <meia@kouno.xyz>
Date:   Sun Sep 29 09:58:35 2024 +0300

    Always limit TPS with aux (now to 90)

commit 8a63326
Author: gorbit99 <gorbitgames@gmail.com>
Date:   Wed Sep 25 21:09:51 2024 +0200

    In theory this works?

commit dbce4cb
Author: Butterscotch! <bscotchvanilla@gmail.com>
Date:   Wed Sep 25 12:02:37 2024 -0400

    Add dependabot & update workflows (SlimeVR#344)

    * Add dependabot & update workflows

    * Specify python-version & use pip cache

    * Add requirements.txt

    * Cache PIP generally instead & remove requirements

commit 8b00064
Author: Ondrej Hruska <11602729+ZycaR@users.noreply.github.com>
Date:   Sun Sep 1 10:46:47 2024 -0700

    GET.INFO Serial Command Should Returns Battery Voltage & Level (in Percentages) (SlimeVR#338)

    * GET.INFO serial command return also battery voltage & level in percents

    * move public headers together
  • Loading branch information
kounocom committed Oct 11, 2024
1 parent 1e29c53 commit 9d17241
Show file tree
Hide file tree
Showing 35 changed files with 1,391 additions and 1,403 deletions.
8 changes: 8 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: 2
updates:

- package-ecosystem: "github-actions"
directory: "/"
schedule:
# Check for updates to GitHub Actions every week
interval: "weekly"
18 changes: 13 additions & 5 deletions .github/workflows/actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,29 @@ jobs:
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: |
~/.cache/pip
~/.platformio/.cache
key: ${{ runner.os }}-pio

- name: Set up Python
uses: actions/setup-python@v1
uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Install pio and its dependencies
- name: Install PlatformIO and its dependencies
run: |
python -m pip install --upgrade pip
pip install platformio
pip install --upgrade platformio
- name: Run builds
run: python ./ci/build.py

- name: Upload binaries
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: binaries
path: ./build/*.bin
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Releases

on:
on:
push:
tags:
- '*'
Expand All @@ -12,9 +12,9 @@ jobs:
permissions:
contents: write
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- uses: ncipollo/release-action@v1
with:
artifacts: "./build/*.bin"
draft: true
token: ${{ secrets.GITHUB_TOKEN }}
token: ${{ secrets.GITHUB_TOKEN }}
6 changes: 3 additions & 3 deletions lib/vqf/vqf.h
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ struct VQFParams
*
* Default value: 0.1 °/s
*/
vqf_real_t biasSigmaMotion = 0.1;
vqf_real_t biasSigmaMotion = 0.1125;
/**
* @brief Forgetting factor for unobservable bias in vertical direction during motion.
*
Expand Down Expand Up @@ -153,7 +153,7 @@ struct VQFParams
*
* Default value: 1.5 s
*/
vqf_real_t restMinT = 1.0;
vqf_real_t restMinT = 0.5;
/**
* @brief Time constant for the low-pass filter used in rest detection (in seconds).
*
Expand All @@ -162,7 +162,7 @@ struct VQFParams
*
* Default value: 0.5 s
*/
vqf_real_t restFilterTau = 0.25;
vqf_real_t restFilterTau = 0.5;
/**
* @brief Angular velocity threshold for rest detection (in °/s).
*
Expand Down
2 changes: 2 additions & 0 deletions src/GlobalVars.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include "network/manager.h"
#include "sensors/SensorManager.h"
#include "status/StatusManager.h"
#include "batterymonitor.h"

extern Timer<> globalTimer;
extern SlimeVR::LEDManager ledManager;
Expand All @@ -40,5 +41,6 @@ extern SlimeVR::Configuration::Configuration configuration;
extern SlimeVR::Sensors::SensorManager sensorManager;
extern SlimeVR::Network::Manager networkManager;
extern SlimeVR::Network::Connection networkConnection;
extern BatteryMonitor battery;

#endif
3 changes: 3 additions & 0 deletions src/batterymonitor.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ class BatteryMonitor
void Setup();
void Loop();

float getVoltage() const { return voltage; }
float getLevel() const { return level; }

private:
unsigned long last_battery_sample = 0;
#if BATTERY_MONITOR == BAT_MCP3021 || BATTERY_MONITOR == BAT_INTERNAL_MCP3021
Expand Down
135 changes: 70 additions & 65 deletions src/consts.h
Original file line number Diff line number Diff line change
@@ -1,49 +1,50 @@
/*
SlimeVR Code is placed under the MIT license
Copyright (c) 2021 Eiren Rain & SlimeVR contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
SlimeVR Code is placed under the MIT license
Copyright (c) 2021 Eiren Rain & SlimeVR contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
#ifndef SLIMEVR_CONSTS_H_
#define SLIMEVR_CONSTS_H_

// List of constants used in other places

enum class ImuID {
Unknown = 0,
MPU9250,
MPU6500,
BNO080,
BNO085,
BNO055,
MPU6050,
BNO086,
BMI160,
ICM20948,
ICM42688,
BMI270,
LSM6DS3TRC,
LSM6DSV,
LSM6DSO,
LSM6DSR,
LSM6DS3,
Empty = 255
Unknown = 0,
MPU9250,
MPU6500,
BNO080,
BNO085,
BNO055,
MPU6050,
BNO086,
BMI160,
ICM20948,
ICM42688,
BMI270,
LSM6DS3TRC,
LSM6DSV,
LSM6DSO,
LSM6DSR,
LSM6DS3,
ICM45686,
Empty = 255
};

#define IMU_UNKNOWN ErroneousSensor
Expand All @@ -64,8 +65,9 @@ enum class ImuID {
#define IMU_LSM6DSR SoftFusionLSM6DSR
#define IMU_MPU6050_SF SoftFusionMPU6050
#define IMU_LSM6DS3 SoftFusionLSM6DS3
#define IMU_ICM45686 SoftFusionICM45686

#define IMU_DEV_RESERVED 250 // Reserved, should not be used in any release firmware
#define IMU_DEV_RESERVED 250 // Reserved, should not be used in any release firmware

#define BOARD_UNKNOWN 0
#define BOARD_SLIMEVR_LEGACY 1
Expand All @@ -80,13 +82,13 @@ enum class ImuID {
#define BOARD_LOLIN_C3_MINI 10
#define BOARD_BEETLE32C3 11
#define BOARD_ES32C3DEVKITM1 12
#define BOARD_OWOTRACK 13 // Only used by owoTrack mobile app
#define BOARD_WRANGLER 14 // Only used by wrangler app
#define BOARD_MOCOPI 15 // Used by mocopi/moslime
#define BOARD_OWOTRACK 13 // Only used by owoTrack mobile app
#define BOARD_WRANGLER 14 // Only used by wrangler app
#define BOARD_MOCOPI 15 // Used by mocopi/moslime
#define BOARD_WEMOSWROOM02 16
#define BOARD_XIAO_ESP32C3 17
#define BOARD_HARITORA 18 // Used by Haritora/SlimeTora
#define BOARD_DEV_RESERVED 250 // Reserved, should not be used in any release firmware
#define BOARD_HARITORA 18 // Used by Haritora/SlimeTora
#define BOARD_DEV_RESERVED 250 // Reserved, should not be used in any release firmware

#define BAT_EXTERNAL 1
#define BAT_INTERNAL 2
Expand All @@ -95,25 +97,28 @@ enum class ImuID {

#define LED_OFF 255

#define POWER_SAVING_LEGACY 0 // No sleeping, but PS enabled
#define POWER_SAVING_NONE 1 // No sleeping, no PS => for connection issues
#define POWER_SAVING_MINIMUM 2 // Sleeping and PS => default
#define POWER_SAVING_MODERATE 3 // Sleeping and better PS => might miss broadcasts, use at own risk
#define POWER_SAVING_MAXIMUM 4 // Actual CPU sleeping, currently has issues with disconnecting
#define POWER_SAVING_LEGACY 0 // No sleeping, but PS enabled
#define POWER_SAVING_NONE 1 // No sleeping, no PS => for connection issues
#define POWER_SAVING_MINIMUM 2 // Sleeping and PS => default
#define POWER_SAVING_MODERATE \
3 // Sleeping and better PS => might miss broadcasts, use at own risk
#define POWER_SAVING_MAXIMUM \
4 // Actual CPU sleeping, currently has issues with disconnecting

// Send rotation/acceleration data as separate frames.
// PPS: 1470 @ 5+1, 1960 @ 5+3
#define PACKET_BUNDLING_DISABLED 0
// Less packets. Pack data per sensor and send asap.
// Compared to PACKET_BUNDLING_DISABLED, reduces PPS by ~54% for 5+1, by ~63% for 5+3 setups.
// PPS: 680 @ 5+1, 740 @ 5+3
// Compared to PACKET_BUNDLING_DISABLED, reduces PPS by ~54% for 5+1, by ~63% for 5+3
// setups. PPS: 680 @ 5+1, 740 @ 5+3
#define PACKET_BUNDLING_LOWLATENCY 1
// Even less packets, if more than 1 sensor - wait for data from all sensors or until timeout, then send.
// Compared to PACKET_BUNDLING_LOWLATENCY, reduces PPS by ~5% for 5+1, by ~15% for 5+3 setups.
// PPS: 650 @ 5+1, 650 @ 5+3
// Even less packets, if more than 1 sensor - wait for data from all sensors or until
// timeout, then send. Compared to PACKET_BUNDLING_LOWLATENCY, reduces PPS by ~5% for
// 5+1, by ~15% for 5+3 setups. PPS: 650 @ 5+1, 650 @ 5+3
#define PACKET_BUNDLING_BUFFERED 2

// Get radian for a given angle from 0° to 360° (2*PI*r, solve for r given an angle, range -180° to 180°)
// Get radian for a given angle from 0° to 360° (2*PI*r, solve for r given an angle,
// range -180° to 180°)
#define DEG_X(deg) ((((deg) < 180.0f ? 0 : 360.0f) - (deg)) * PI / 180.0f)

#define DEG_0 DEG_X(0.0f)
Expand All @@ -133,22 +138,22 @@ enum class ImuID {
#define MCU_UNKNOWN 0
#define MCU_ESP8266 1
#define MCU_ESP32 2
#define MCU_OWOTRACK_ANDROID 3 // Only used by owoTrack mobile app
#define MCU_WRANGLER 4 // Only used by wrangler app
#define MCU_OWOTRACK_IOS 5 // Only used by owoTrack mobile app
#define MCU_OWOTRACK_ANDROID 3 // Only used by owoTrack mobile app
#define MCU_WRANGLER 4 // Only used by wrangler app
#define MCU_OWOTRACK_IOS 5 // Only used by owoTrack mobile app
#define MCU_ESP32_C3 6
#define MCU_MOCOPI 7 // Used by mocopi/moslime
#define MCU_HARITORA 8 // Used by Haritora/SlimeTora
#define MCU_DEV_RESERVED 250 // Reserved, should not be used in any release firmware
#define MCU_MOCOPI 7 // Used by mocopi/moslime
#define MCU_HARITORA 8 // Used by Haritora/SlimeTora
#define MCU_DEV_RESERVED 250 // Reserved, should not be used in any release firmware

#ifdef ESP8266
#define HARDWARE_MCU MCU_ESP8266
#define HARDWARE_MCU MCU_ESP8266
#elif defined(ESP32)
#define HARDWARE_MCU MCU_ESP32
#define HARDWARE_MCU MCU_ESP32
#else
#define HARDWARE_MCU MCU_UNKNOWN
#define HARDWARE_MCU MCU_UNKNOWN
#endif

#define CURRENT_CONFIGURATION_VERSION 1

#endif // SLIMEVR_CONSTS_H_
#endif // SLIMEVR_CONSTS_H_
Loading

0 comments on commit 9d17241

Please sign in to comment.