Skip to content

Commit

Permalink
Merge pull request #58 from senseshift/develop
Browse files Browse the repository at this point in the history
Release-Candidate 0.6.0
  • Loading branch information
leon0399 authored Jun 19, 2023
2 parents 419faca + b17ea3d commit 4337383
Show file tree
Hide file tree
Showing 53 changed files with 2,015 additions and 200 deletions.
133 changes: 125 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ on:
- '**/*.md'

jobs:
build:
build-bhaptics:
name: Build ${{ matrix.target }} on ${{ matrix.os }} ${{ matrix.coverage && 'with coverage' || 'without coverage' }}, -D ${{ matrix.battery_flag }} -D ${{ matrix.serial_plotter_flag }} -D ${{ matrix.nimble_flag }}
runs-on: ${{ matrix.os }}
strategy:
Expand All @@ -30,6 +30,7 @@ jobs:
- bhaptics_tactosyh_hand_right
- bhaptics_tactosyf_foot_right
- bhaptics_tactal
- bhaptics_tactvisor
- bhaptics_tactglove_right
battery_flag: [ BATTERY_ENABLED=true ]
serial_plotter_flag: [ SERIAL_PLOTTER=false ]
Expand Down Expand Up @@ -76,11 +77,15 @@ jobs:
restore-keys: |
${{ runner.os }}-pip-
- uses: actions/cache@v3
- name: Cache PlatformIO
uses: actions/cache@v3
with:
path: ~/.platformio/.cache
key: ${{ runner.os }}-pio-${{ matrix.target }}
path: |
~/.platformio/.cache
./.pio
key: ${{ runner.os }}-pio-${{ matrix.target }}-${{ hashFiles('platformio.ini') }}
restore-keys: |
${{ runner.os }}-pio-${{ matrix.target }}-
${{ runner.os }}-pio-
- name: Set up Python
Expand Down Expand Up @@ -118,7 +123,7 @@ jobs:
pio pkg update --global
- name: Install libs
run: pio lib -e ${{matrix.target}} install
run: pio pkg install -e ${{matrix.target}}

- name: Change memory segments
if: matrix.coverage
Expand Down Expand Up @@ -146,6 +151,109 @@ jobs:
path: ./build/lcov/lcov.info.${{matrix.target}}
retention-days: 5

build-opengloves:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest ]
target:
- opengloves
curl_calibration_flag:
- CALIBRATION_CURL="OH::MinMaxCalibrator<uint16_t, 0, ANALOG_MAX>"
- CALIBRATION_CURL="OH::CenterPointDeviationCalibrator<uint16_t, 20, 270, 0, ANALOG_MAX>"
- CALIBRATION_CURL="OH::FixedCenterPointDeviationCalibrator<uint16_t, 20, 270, 0, ANALOG_MAX>"
coverage: [ true ]

steps:
- uses: actions/checkout@v3

- name: Speedup package installation
if: matrix.coverage
uses: abbbi/github-actions-tune@v1

- name: Setup LCOV
if: matrix.coverage
uses: hrishikesh-kadam/setup-lcov@v1

- 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/.cache
./.pio
key: ${{ runner.os }}-pio-${{ matrix.target }}-${{ hashFiles('platformio.ini') }}
restore-keys: |
${{ runner.os }}-pio-${{ matrix.target }}-
${{ runner.os }}-pio-
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.9'

- name: Enable coverage (non-macOS)
if: runner.os != 'macOS' && matrix.coverage
run: |
sed -i '/__OH_FIRMWARE__/p; s/-D __OH_FIRMWARE__/-lgcov --coverage/' platformio.ini
- name: Enable coverage (macOS)
if: runner.os == 'macOS' && matrix.coverage
run: |
sed -i '' '/__OH_FIRMWARE__/p; s/-D __OH_FIRMWARE__/-lgcov --coverage/' platformio.ini
- name: Update build flags (non-macOS)
if: runner.os != 'macOS'
run: |
sed -i '/__OH_FIRMWARE__/p; s/__OH_FIRMWARE__/${{ matrix.curl_calibration_flag }}/' platformio.ini
- name: Update build flags (macOS)
if: runner.os == 'macOS'
run: |
sed -i '' '/__OH_FIRMWARE__/p; s/__OH_FIRMWARE__/${{ matrix.curl_calibration_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: Install libs
run: pio pkg install -e ${{matrix.target}}

- name: Change memory segments
if: matrix.coverage
run: |
sed -i "s/len\s=\s0x2c200\s-\s0xdb5c/len = 289888/" ~/.platformio/packages/framework-arduinoespressif32/tools/sdk/esp32/ld/memory.ld
- name: Build
run: |
echo "::group::platformio.ini"
cat platformio.ini
echo "::endgroup::"
pio run --environment ${{matrix.target}}
- name: Collect initial coverage
if: matrix.coverage
run: |
mkdir -p ./build/lcov
lcov -i -d ./.pio/build/${{matrix.target}}/ -c -o ./build/lcov/lcov.info.${{matrix.target}}-${{ hashFiles('platformio.ini') }} -gcov-tool ~/.platformio/packages/toolchain-xtensa-esp32/bin/xtensa-esp32-elf-gcov
- name: Upload coverage Artifact
uses: actions/upload-artifact@v3
if: matrix.coverage
with:
name: lcov.info.${{matrix.target}}-${{ hashFiles('platformio.ini') }}
path: ./build/lcov/lcov.info.${{matrix.target}}-*
retention-days: 5

test:
runs-on: ubuntu-latest
strategy:
Expand Down Expand Up @@ -174,9 +282,12 @@ jobs:
- name: Cache PlatformIO
uses: actions/cache@v3
with:
path: ~/.platformio
key: ${{ runner.os }}-pio-${{ hashFiles('**/lockfiles') }}
path: |
~/.platformio/.cache
./.pio
key: ${{ runner.os }}-pio-${{ matrix.target }}-${{ hashFiles('platformio.ini') }}
restore-keys: |
${{ runner.os }}-pio-${{ matrix.target }}
${{ runner.os }}-pio-
- name: Set up Python
Expand All @@ -191,6 +302,9 @@ jobs:
pio upgrade --dev
pio pkg update --global
- name: Install libs
run: pio pkg install -e ${{matrix.target}}

- name: Run Unit Tests
run: pio test -e ${{matrix.target}}

Expand All @@ -207,7 +321,10 @@ jobs:
retention-days: 5

coverage-report:
needs: [build, test]
needs:
- build-bhaptics
- build-opengloves
- test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ jobs:
- bhaptics_tactosyf_foot_left
- bhaptics_tactosyf_foot_right
- bhaptics_tactal
- bhaptics_tactvisor
- bhaptics_tactglove_left
- bhaptics_tactglove_right
battery_flag:
Expand Down
7 changes: 6 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,12 @@
"bit": "cpp",
"set": "cpp",
"iostream": "cpp",
"*.hpp": "cpp"
"*.hpp": "cpp",
"xlocmon": "cpp",
"xmemory": "cpp",
"xtree": "cpp",
"xhash": "cpp",
"xlocnum": "cpp"
},
"files.eol": "\n",
"files.insertFinalNewline": true,
Expand Down
24 changes: 15 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,21 +73,27 @@ Please note, that documentation is still work-in-progress

## Supported devices

| Device | Supported Devices | Retail price | DIY Price | Hardware |
| :-------------------- | :------------------- | -----------: | --------: | :-------------------------------------------------------------------------------------------------- |
| Haptics Face Interface | Tactal | US $149 | ~20$ | See [Hardware Reference](https://github.com/senseshift/senseshift-hardware#haptic-face-interface) |
| Haptic Gloves | TactGlove | US $299 | ~20$ | See [Hardware Reference](https://github.com/senseshift/senseshift-hardware#haptic-glove) |
| Haptic Sleeves | Tactosy for arms | US $249 | ~20$ | See [Hardware Reference](https://github.com/senseshift/senseshift-hardware#haptic-forearm-sleeve) |
| Haptic Hand Gauntlet | Tactosy for hands | US $249 | ~20$ | See [Hardware Reference](https://github.com/senseshift/senseshift-hardware#haptic-gauntlet) |
| Haptic Feet Device | Tactosy for feet | US $249 | ~20$ | See [Hardware Reference](https://github.com/senseshift/senseshift-hardware#haptic-feet-device) |
| X16 Haptic Vest | TactSuit X16 | US $299 | ~40$ | See [Hardware Reference](https://github.com/senseshift/senseshift-hardware#x16-haptic-vest) |
| X40 Haptic Vest | TactSuit X40, Tactot | US $499 | ~70$ | See [Hardware Reference](https://github.com/senseshift/senseshift-hardware#x40-haptic-vest) |
| Device | Supported Devices | Retail price | DIY Price | Hardware |
| :-------------------- | :------------------- | -----------: | ----------------: | :------------------------------------------------------------------------------------------------ |
| Haptics Face Interface | Tactal, TactVisor | US $149 | ~$20 | See [Hardware Reference](https://github.com/senseshift/senseshift-hardware#haptic-face-interface) |
| Haptic Gloves | TactGlove | US $299 | ~$20 | See [Hardware Reference](https://github.com/senseshift/senseshift-hardware#haptic-glove) |
| Haptic Sleeves | Tactosy for arms | US $249 | ~$20 | See [Hardware Reference](https://github.com/senseshift/senseshift-hardware#haptic-forearm-sleeve) |
| Haptic Hand Gauntlet | Tactosy for hands | US $249 | ~$20 | See [Hardware Reference](https://github.com/senseshift/senseshift-hardware#haptic-gauntlet) |
| Haptic Feet Device | Tactosy for feet | US $249 | ~$20 | See [Hardware Reference](https://github.com/senseshift/senseshift-hardware#haptic-feet-device) |
| X16 Haptic Vest | TactSuit X16 | US $299 | ~$40 | See [Hardware Reference](https://github.com/senseshift/senseshift-hardware#x16-haptic-vest) |
| X40 Haptic Vest | TactSuit X40, Tactot | US $499 | ~$70 | See [Hardware Reference](https://github.com/senseshift/senseshift-hardware#x40-haptic-vest) |
| VR Glove / OpenGloves | LucidGloves | N/A | ~$40 &mdash; ~$80 | See [Original Wiki](https://github.com/LucidVR/lucidgloves/wiki) |

## For Developers

* [Code of Conduct](./CODE_OF_CONDUCT.md)
* [Contributing Guidelines](./CONTRIBUTING.md)

## Credits

* [LucasVRTech](https://github.com/lucas-vrtech) of the LucidGlove project
* [JohnRThomas](https://github.com/JohnRThomas) for the his implementation of LucidGlove firmware

## Licensing

[![GPL-3.0](https://www.gnu.org/graphics/gplv3-or-later-sm.png)](./LICENSE)
Expand Down
7 changes: 6 additions & 1 deletion firmware/mode_configs/bhaptics/tactal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,12 @@ void setupMode() {
bhBleConnection->begin();

#if defined(BATTERY_ENABLED) && BATTERY_ENABLED == true
auto* battery = new ADCNaiveBattery(36, { .sampleRate = BATTERY_SAMPLE_RATE }, &App, tskNO_AFFINITY);
auto* battery = new BatterySensor(
new ADCNaiveBattery(36),
&App,
{ .sampleRate = BATTERY_SAMPLE_RATE },
{ "ADC Battery", 4096, BATTERY_TASK_PRIORITY, tskNO_AFFINITY }
);
battery->begin();
#endif
}
Expand Down
7 changes: 6 additions & 1 deletion firmware/mode_configs/bhaptics/tactglove.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,12 @@ void setupMode() {
bhBleConnection->begin();

#if defined(BATTERY_ENABLED) && BATTERY_ENABLED == true
auto* battery = new ADCNaiveBattery(36, { .sampleRate = BATTERY_SAMPLE_RATE }, app, tskNO_AFFINITY);
auto* battery = new BatterySensor(
new ADCNaiveBattery(36),
&App,
{ .sampleRate = BATTERY_SAMPLE_RATE },
{ "ADC Battery", 4096, BATTERY_TASK_PRIORITY, tskNO_AFFINITY }
);
battery->begin();
#endif
}
Expand Down
7 changes: 6 additions & 1 deletion firmware/mode_configs/bhaptics/tactosy2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,12 @@ void setupMode() {
bhBleConnection->begin();

#if defined(BATTERY_ENABLED) && BATTERY_ENABLED == true
auto* battery = new ADCNaiveBattery(36, { .sampleRate = BATTERY_SAMPLE_RATE }, app, tskNO_AFFINITY);
auto* battery = new BatterySensor(
new ADCNaiveBattery(36),
&App,
{ .sampleRate = BATTERY_SAMPLE_RATE },
{ "ADC Battery", 4096, BATTERY_TASK_PRIORITY, tskNO_AFFINITY }
);
battery->begin();
#endif
}
Expand Down
7 changes: 6 additions & 1 deletion firmware/mode_configs/bhaptics/tactosyf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,12 @@ void setupMode() {
bhBleConnection->begin();

#if defined(BATTERY_ENABLED) && BATTERY_ENABLED == true
auto* battery = new ADCNaiveBattery(36, { .sampleRate = BATTERY_SAMPLE_RATE }, app, tskNO_AFFINITY);
auto* battery = new BatterySensor(
new ADCNaiveBattery(36),
&App,
{ .sampleRate = BATTERY_SAMPLE_RATE },
{ "ADC Battery", 4096, BATTERY_TASK_PRIORITY, tskNO_AFFINITY }
);
battery->begin();
#endif
}
Expand Down
7 changes: 6 additions & 1 deletion firmware/mode_configs/bhaptics/tactosyh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,12 @@ void setupMode() {
bhBleConnection->begin();

#if defined(BATTERY_ENABLED) && BATTERY_ENABLED == true
auto* battery = new ADCNaiveBattery(36, { .sampleRate = BATTERY_SAMPLE_RATE }, app, tskNO_AFFINITY);
auto* battery = new BatterySensor(
new ADCNaiveBattery(36),
&App,
{ .sampleRate = BATTERY_SAMPLE_RATE },
{ "ADC Battery", 4096, BATTERY_TASK_PRIORITY, tskNO_AFFINITY }
);
battery->begin();
#endif
}
Expand Down
7 changes: 6 additions & 1 deletion firmware/mode_configs/bhaptics/tactsuit_x16.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,12 @@ void setupMode() {
bhBleConnection->begin();

#if defined(BATTERY_ENABLED) && BATTERY_ENABLED == true
auto* battery = new ADCNaiveBattery(36, { .sampleRate = BATTERY_SAMPLE_RATE }, app, tskNO_AFFINITY);
auto* battery = new BatterySensor(
new ADCNaiveBattery(36),
&App,
{ .sampleRate = BATTERY_SAMPLE_RATE },
{ "ADC Battery", 4096, BATTERY_TASK_PRIORITY, tskNO_AFFINITY }
);
battery->begin();
#endif
}
Expand Down
7 changes: 6 additions & 1 deletion firmware/mode_configs/bhaptics/tactsuit_x16_pca9685.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,12 @@ void setupMode() {
bhBleConnection->begin();

#if defined(BATTERY_ENABLED) && BATTERY_ENABLED == true
auto* battery = new ADCNaiveBattery(36, { .sampleRate = BATTERY_SAMPLE_RATE }, app, tskNO_AFFINITY);
auto* battery = new BatterySensor(
new ADCNaiveBattery(36),
&App,
{ .sampleRate = BATTERY_SAMPLE_RATE },
{ "ADC Battery", 4096, BATTERY_TASK_PRIORITY, tskNO_AFFINITY }
);
battery->begin();
#endif
}
Expand Down
7 changes: 6 additions & 1 deletion firmware/mode_configs/bhaptics/tactsuit_x40.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,12 @@ void setupMode() {
bhBleConnection->begin();

#if defined(BATTERY_ENABLED) && BATTERY_ENABLED == true
auto* battery = new ADCNaiveBattery(36, { .sampleRate = BATTERY_SAMPLE_RATE }, app, tskNO_AFFINITY);
auto* battery = new BatterySensor(
new ADCNaiveBattery(36),
&App,
{ .sampleRate = BATTERY_SAMPLE_RATE },
{ "ADC Battery", 4096, BATTERY_TASK_PRIORITY, tskNO_AFFINITY }
);
battery->begin();
#endif
}
Expand Down
Loading

1 comment on commit 4337383

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverage for this commit

41.45%

Please sign in to comment.