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

Simplify components #93

Merged
merged 30 commits into from
Feb 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
9e33f0b
refactor: simplyfy overall setup and structure
leon0399 Jan 26, 2024
176f5e5
refactor(Battery): use analog float sensor
leon0399 Jan 27, 2024
2d163b6
refactor(Sensor): new sensor stack with filters
leon0399 Jan 29, 2024
fa661e7
refactor: improve overall code readability
leon0399 Feb 1, 2024
0be58cc
refactor(Calibration): apply SFINAE
leon0399 Feb 6, 2024
2f6cfe1
refactor(OpenGloves): universal encoder
leon0399 Feb 7, 2024
d105900
refactor(OpenGloves): reuse same structure for data and source sensors
leon0399 Feb 8, 2024
3b8a90e
refactor(FreeRTOS): make SensorUpdateTask universal for components
leon0399 Feb 8, 2024
13f3b54
test(Gestures): refactor old OG tests
leon0399 Feb 8, 2024
809f14e
fix: sensor template deduction
leon0399 Feb 8, 2024
f43319a
test(OpenGloves): update old alpha-encoding unit test
leon0399 Feb 8, 2024
48d8277
test: cover edge-cases
leon0399 Feb 9, 2024
01c9a06
feat(OpenGloves) re-introduce simple data sending
leon0399 Feb 9, 2024
825e6f0
test(Input): cover filters
leon0399 Feb 10, 2024
728bd79
fix(OpenGloves): tick input sensors
leon0399 Feb 10, 2024
54212c0
fix(OpenGloves): incorrect gesture alpha char
leon0399 Feb 10, 2024
637f561
test(OpenGloves): update Wokwi test
leon0399 Feb 11, 2024
a2fd378
perf(OpenGloves): fix slow tick rate
leon0399 Feb 11, 2024
9b493d2
feat(OpenGloves): add decoder for FFB
leon0399 Feb 11, 2024
529a0cc
feat(OpenGloves): bring back FFB
leon0399 Feb 18, 2024
dbf35e2
fix(BLE Serial): fix sending duplicate strings
leon0399 Feb 18, 2024
74cd0aa
fix(bHaptics): removed file being included
leon0399 Feb 18, 2024
ddff5a4
style(clang-format): lint-fix
leon0399 Feb 18, 2024
c2d34c6
ci(Wokwi): execute calibration
leon0399 Feb 18, 2024
2f0b216
refactor(OpenGloves): separate autoconfig for tracking/ffb
leon0399 Feb 19, 2024
0628ff6
style: format INI files
leon0399 Feb 19, 2024
581ef29
Merge remote-tracking branch 'origin/develop' into feature/simplify
leon0399 Feb 19, 2024
1d42b34
fix(OpenGloves): manually initialize sensor pointers
leon0399 Feb 19, 2024
dc59f87
feat(Arduino): bring back INA219 Current Sensor
leon0399 Feb 19, 2024
78431bb
chore: remove references of output serial plotter
leon0399 Feb 19, 2024
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
5 changes: 0 additions & 5 deletions .github/scripts/get_firmware_name.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,6 @@ getBhapticsName() {
target="$target+battery"
fi

if [[ $flags =~ SENSESHIFT_SERIAL_PLOTTER=true ]]; then
echo "::debug::Serial Plotter is enabled, appending +serialplotter to the target"
target="$target+serialplotter"
fi

echo "firmware=$target"
if [[ -n "$GITHUB_ACTIONS" ]]; then
echo "firmware=$target" >> "$GITHUB_OUTPUT"
Expand Down
28 changes: 11 additions & 17 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ on:

jobs:
build-bhaptics:
name: Build ${{ matrix.target }} ${{ matrix.coverage && 'with coverage' || 'without coverage' }}, -D ${{ matrix.battery_flag }} -D ${{ matrix.serial_plotter_flag }} -D ${{ matrix.nimble_flag }}
name: Build ${{ matrix.target }} ${{ matrix.coverage && 'with coverage' || 'without coverage' }}, -D ${{ matrix.battery_flag }} -D ${{ matrix.nimble_flag }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
os: [ ubuntu-latest ]
target:
- bhaptics_tactsuit_x16
- bhaptics_tactsuit_x16_pca9685
Expand All @@ -32,30 +32,26 @@ jobs:
- bhaptics_tactal
- bhaptics_tactvisor
- bhaptics_tactglove_right
battery_flag: [SENSESHIFT_BATTERY_ENABLED=true]
serial_plotter_flag: [SENSESHIFT_SERIAL_PLOTTER=false]
nimble_flag: [SENSESHIFT_BLE_USE_NIMBLE=false]
coverage: [false]
battery_flag: [ SENSESHIFT_BATTERY_ENABLED=true ]
nimble_flag: [ SENSESHIFT_BLE_USE_NIMBLE=false ]
coverage: [ false ]

include:
# Extra tests for x40, as it uses the most features
- target: bhaptics_tactsuit_x40
os: ubuntu-latest
coverage: true
battery_flag: SENSESHIFT_BATTERY_ENABLED=true
serial_plotter_flag: SENSESHIFT_SERIAL_PLOTTER=true
nimble_flag: SENSESHIFT_BLE_USE_NIMBLE=true
# - target: bhaptics_tactsuit_x40
# os: ubuntu-latest
# coverage: true
# battery_flag: SENSESHIFT_BATTERY_ENABLED=true
# serial_plotter_flag: SENSESHIFT_SERIAL_PLOTTER=true
# nimble_flag: SENSESHIFT_BLE_USE_NIMBLE=false
- target: bhaptics_tactsuit_x40
os: ubuntu-latest
coverage: false
battery_flag: SENSESHIFT_BATTERY_ENABLED=true
serial_plotter_flag: SENSESHIFT_SERIAL_PLOTTER=false
nimble_flag: SENSESHIFT_BLE_USE_NIMBLE=true

steps:
Expand All @@ -66,7 +62,7 @@ jobs:
- name: Get firmware name
id: firmware_name
run: |
./.github/scripts/get_firmware_name.sh ${{ matrix.target }} ${{ matrix.serial_plotter_flag }} ${{ matrix.battery_flag }} ${{ matrix.nimble_flag }}
./.github/scripts/get_firmware_name.sh ${{ matrix.target }} ${{ matrix.battery_flag }} ${{ matrix.nimble_flag }}

- name: Enable coverage (non-macOS)
if: runner.os != 'macOS' && matrix.coverage
Expand All @@ -81,13 +77,11 @@ jobs:
if: runner.os != 'macOS'
run: |
sed -i '/__OH_FIRMWARE__/p; s/__OH_FIRMWARE__/${{ matrix.battery_flag }}/' platformio.ini
sed -i '/__OH_FIRMWARE__/p; s/__OH_FIRMWARE__/${{ matrix.serial_plotter_flag }}/' platformio.ini
sed -i '/__OH_FIRMWARE__/p; s/__OH_FIRMWARE__/${{ matrix.nimble_flag }}/' platformio.ini
- name: Update build flags (macOS)
if: runner.os == 'macOS'
run: |
sed -i '' '/__OH_FIRMWARE__/p; s/__OH_FIRMWARE__/${{ matrix.battery_flag }}/' platformio.ini
sed -i '' '/__OH_FIRMWARE__/p; s/__OH_FIRMWARE__/${{ matrix.serial_plotter_flag }}/' platformio.ini
sed -i '' '/__OH_FIRMWARE__/p; s/__OH_FIRMWARE__/${{ matrix.nimble_flag }}/' platformio.ini

- name: Speedup package installation
Expand Down Expand Up @@ -165,7 +159,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
os: [ ubuntu-latest ]
target:
- lucidgloves-prototype3
- lucidgloves-prototype4
Expand All @@ -176,20 +170,20 @@ jobs:
comm_flag:
- COMMUNICATION_PROTOCOL=OPENGLOVES_COMM_SERIAL
- COMMUNICATION_PROTOCOL=OPENGLOVES_COMM_BTSERIAL
coverage: [false]
coverage: [ false ]

include:
- os: ubuntu-latest
target: lucidgloves-prototype4-ffb
curl_calibration_flag: CALIBRATION_CURL="::SenseShift::Calibration::MinMaxCalibrator<uint16_t, 0, ANALOG_MAX>"
curl_calibration_flag: CALIBRATION_CURL="new ::SenseShift::Input::Calibration::MinMaxCalibrator<float>()"
coverage: true
- os: ubuntu-latest
target: lucidgloves-prototype4-ffb
curl_calibration_flag: CALIBRATION_CURL="::SenseShift::Calibration::CenterPointDeviationCalibrator<uint16_t, 20, 270, 0, ANALOG_MAX>"
curl_calibration_flag: CALIBRATION_CURL="new ::SenseShift::Input::Calibration::CenterPointDeviationCalibrator<float>(0.66F, 0.005F)"
coverage: true
- os: ubuntu-latest
target: lucidgloves-prototype4-ffb
curl_calibration_flag: CALIBRATION_CURL="::SenseShift::Calibration::FixedCenterPointDeviationCalibrator<uint16_t, 20, 270, 0, ANALOG_MAX>"
curl_calibration_flag: CALIBRATION_CURL="new ::SenseShift::Input::Calibration::FixedCenterPointDeviationCalibrator<float>(0.66F, 0.005F)"
coverage: true
- os: ubuntu-latest
target: indexer-csf
Expand Down
165 changes: 81 additions & 84 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,89 +32,86 @@ jobs:
# Enabling all flags to test build for every feature
battery_flag:
- SENSESHIFT_BATTERY_ENABLED=true
serial_plotter_flag:
- SENSESHIFT_SERIAL_PLOTTER=true

steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
fetch-depth: 2
submodules: 'recursive'

# If this run was triggered by a pull request event, then checkout
# the head of the pull request instead of the merge commit.
# - run: git checkout HEAD^2
# if: ${{ github.event_name == 'pull_request' }}

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
config-file: ./.github/codeql/codeql-config.yml
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.

# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality


# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
# - name: Autobuild
# uses: github/codeql-action/autobuild@v2

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun

# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.

# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh

- name: Cache pip
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Cache PlatformIO
uses: actions/cache@v3
with:
path: ~/.platformio
key: ${{ runner.os }}-pio-${{ hashFiles('**/lockfiles') }}
restore-keys: |
${{ runner.os }}-pio-
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.9'

- name: Update build flags (non-macOS)
if: runner.os != 'macOS'
run: |
sed -i '/__OH_FIRMWARE__/p; s/__OH_FIRMWARE__/${{ matrix.battery_flag }}/' platformio.ini
sed -i '/__OH_FIRMWARE__/p; s/__OH_FIRMWARE__/${{ matrix.serial_plotter_flag }}/' platformio.ini

- name: Install PlatformIO
run: |
python -m pip install --upgrade pip
pip install --upgrade platformio
pio upgrade --dev
pio pkg update --global

- name: Build
run: |
pio run --environment bhaptics_tactsuit_x40

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
category: "/language:${{matrix.language}}"
- name: Checkout repository
uses: actions/checkout@v3
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
fetch-depth: 2
submodules: 'recursive'

# If this run was triggered by a pull request event, then checkout
# the head of the pull request instead of the merge commit.
# - run: git checkout HEAD^2
# if: ${{ github.event_name == 'pull_request' }}

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
config-file: ./.github/codeql/codeql-config.yml
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.

# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality


# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
# - name: Autobuild
# uses: github/codeql-action/autobuild@v2

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun

# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.

# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh

- name: Cache pip
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Cache PlatformIO
uses: actions/cache@v3
with:
path: ~/.platformio
key: ${{ runner.os }}-pio-${{ hashFiles('**/lockfiles') }}
restore-keys: |
${{ runner.os }}-pio-
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.9'

- name: Update build flags (non-macOS)
if: runner.os != 'macOS'
run: |
sed -i '/__OH_FIRMWARE__/p; s/__OH_FIRMWARE__/${{ matrix.battery_flag }}/' platformio.ini

- name: Install PlatformIO
run: |
python -m pip install --upgrade pip
pip install --upgrade platformio
pio upgrade --dev
pio pkg update --global

- name: Build
run: |
pio run --environment bhaptics_tactsuit_x40

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
category: "/language:${{matrix.language}}"
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,8 @@ jobs:
- indexer-cs
- indexer-csf
comm_flag:
- OPENGLOVES_COMMUNCATION=OPENGLOVES_COMM_SERIAL
- OPENGLOVES_COMMUNCATION=OPENGLOVES_COMM_BTSERIAL
- OPENGLOVES_COMMUNICATION=OPENGLOVES_COMM_SERIAL
- OPENGLOVES_COMMUNICATION=OPENGLOVES_COMM_BTSERIAL
steps:
- uses: actions/checkout@v3
with:
Expand Down
10 changes: 5 additions & 5 deletions .wokwi/lucidgloves-prototype3+serial/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,32 +45,32 @@ steps:
part-id: pot-thumb
control: position
value: 1
- wait-serial: "A4095B4095C0D0E0F2047G2047IM" # M is for Pinch gesture
- wait-serial: "A4095B4095C0D0E0F2047G2047MI" # M is for Pinch gesture

# Curl Middle finger
- set-control:
part-id: pot-middle
control: position
value: 1
- wait-serial: "A4095B4095C4095D0E0F2047G2047IM"
- wait-serial: "A4095B4095C4095D0E0F2047G2047MI"

# Curl Ring finger
- set-control:
part-id: pot-ring
control: position
value: 1
- wait-serial: "A4095B4095C4095D4095E0F2047G2047IM"
- wait-serial: "A4095B4095C4095D4095E0F2047G2047MI"

# Curl Pinky finger
- set-control:
part-id: pot-pinky
control: position
value: 1
- wait-serial: "A4095B4095C4095D4095E4095F2047G2047ILM" # L is for the Grab gesture
- wait-serial: "A4095B4095C4095D4095E4095F2047G2047MIL" # L is for the Grab gesture

# Partially Release Thumb finger
- set-control:
part-id: pot-thumb
control: position
value: 0.25
- wait-serial: 'A1024B4095C4095D4095E4095F2047G2047IL'
- wait-serial: "A1024B4095C4095D4095E4095F2047G2047IL"
23 changes: 19 additions & 4 deletions .wokwi/lucidgloves-prototype4+serial/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,21 @@ version: 1
author: Leonid Meleshin

steps:
- delay: 2000ms

# Press calibration button
- set-control:
part-id: btn3
control: pressed
value: 1

- delay: 250ms

- set-control:
part-id: btn3
control: pressed
value: 0

- wait-serial: "A0B0C0D0E0F2047G2047"

# Press the 'A' button
Expand Down Expand Up @@ -45,28 +60,28 @@ steps:
part-id: pot-thumb
control: position
value: 1
- wait-serial: "A4095B4095C0D0E0F2047G2047IM" # M is for Pinch gesture
- wait-serial: "A4095B4095C0D0E0F2047G2047MI" # M is for Pinch gesture

# Curl Middle finger
- set-control:
part-id: pot-middle
control: position
value: 1
- wait-serial: "A4095B4095C4095D0E0F2047G2047IM"
- wait-serial: "A4095B4095C4095D0E0F2047G2047MI"

# Curl Ring finger
- set-control:
part-id: pot-ring
control: position
value: 1
- wait-serial: "A4095B4095C4095D4095E0F2047G2047IM"
- wait-serial: "A4095B4095C4095D4095E0F2047G2047MI"

# Curl Pinky finger
- set-control:
part-id: pot-pinky
control: position
value: 1
- wait-serial: "A4095B4095C4095D4095E4095F2047G2047ILM" # L is for the Grab gesture
- wait-serial: "A4095B4095C4095D4095E4095F2047G2047MIL" # L is for the Grab gesture

# Partially Release Thumb finger
- set-control:
Expand Down
Loading
Loading