Skip to content

Commit

Permalink
Merge pull request #60 from senseshift/feature/opengloves
Browse files Browse the repository at this point in the history
Add OpenGloves module w/o force-feedback
  • Loading branch information
leon0399 authored Jun 14, 2023
2 parents d9dced7 + 3ccc213 commit b17ea3d
Show file tree
Hide file tree
Showing 24 changed files with 1,346 additions and 68 deletions.
118 changes: 114 additions & 4 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 Down Expand Up @@ -80,7 +80,9 @@ jobs:
- name: Cache PlatformIO
uses: actions/cache@v3
with:
path: ~/.platformio
path: |
~/.platformio/.cache
./.pio
key: ${{ runner.os }}-pio-${{ matrix.target }}-${{ hashFiles('platformio.ini') }}
restore-keys: |
${{ runner.os }}-pio-${{ matrix.target }}-
Expand Down Expand Up @@ -149,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 @@ -177,7 +282,9 @@ jobs:
- name: Cache PlatformIO
uses: actions/cache@v3
with:
path: ~/.platformio
path: |
~/.platformio/.cache
./.pio
key: ${{ runner.os }}-pio-${{ matrix.target }}-${{ hashFiles('platformio.ini') }}
restore-keys: |
${{ runner.os }}-pio-${{ matrix.target }}
Expand Down Expand Up @@ -214,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
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
Loading

1 comment on commit b17ea3d

@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.