Przejdź do treści
Biblioteka skilli
Programowanie · Budowanie i kod

tap-imu-motion

/tap-imu-motion

Wykorzystuje ruch dłoni z Tap, czyli dane IMU i zdarzenia myszy, do sterowania kursorem i interfejsem sterowanym pochyleniem.

Repozytorium
tap-python-sdk ↗
Licencja
MIT
Ostatnia zmiana repozytorium
20.10.2026

Ocena i bezpieczeństwo

100/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść35 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
1
Skrypty
0
Komentarze HTML
0
Adresy URL w SKILL.md
5
Przestarzałość

Brak sygnałów. Repozytorium zmienione 20.10.2026, bez odwołań do wycofanych modeli i API.

Licencja

MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.

Co robi i kiedy

Wykorzystuje ruch dłoni z Tap, czyli dane IMU i zdarzenia myszy, do sterowania kursorem i interfejsem sterowanym pochyleniem.

Oryginalny opis (EN)

Use Tap hand motion - IMU motion data (dx, dy, roll, pitch, yaw) and mouse events - to move a cursor, steer, tilt, or rotate things. Use for air mouse, pointer, cursor control, tilt, orientation, euler angles, roll/pitch/yaw, or motion-driven UI.

Jak działa

  1. TapSDK2: IMU motion feature
  2. TapSDK: mouse events
  3. Patterns
  4. Axes
  5. Docs
Sekcje z nagłówków SKILL.md, w oryginale · 87 linii, 384 słów
Podgląd SKILL.md
---
name: tap-imu-motion
description: Use Tap hand motion - IMU motion data (dx, dy, roll, pitch, yaw) and mouse events - to move a cursor, steer, tilt, or rotate things. Use for air mouse, pointer, cursor control, tilt, orientation, euler angles, roll/pitch/yaw, or motion-driven UI.
---

# IMU motion and mouse

Firmware gives motion in two ways. Use `hasattr` to pick the API.

## `TapSDK2`: IMU motion feature

TapXR developer firmware and TapBand (same BLE API; TapBand is coming soon).

```python
from tapsdk import DeviceFeatures

def on_motion(identifier, motion):
    dx, dy, is_mouse, (roll, pitch, yaw) = motion
    ...

sdk.register_imu_motion_data_events(on_motion)
await sdk.start()
await sdk.set_feature(DeviceFeatures.IMU_MOTION_DATA, True)
```

- `dx`, `dy`: signed int pointer deltas since the last packet. Add them to a cursor position.
- `is_mouse`: `True` when the device considers the motion a pointer movement.
- `roll`, `pitch`, `yaw`: signed ints, orientation in degrees.
- Turn off with `set_feature(DeviceFeatures.IMU_MOTION_DATA, False)` to save battery and bandwidth.
- Motion works together with `MODEL_DETECTION` (air gestures). The `tap-knob` and `tap-dpad` skills combine them.

## `TapSDK`: mouse events

Tap Strap and Tap Strap 2.

```python
from tapsdk import InputModeController

def on_mouse(identifier, vx, vy, proximity):
    ...

sdk.register_mouse_events(on_mouse)
await sdk.start()
await sdk.set_input_mode(InputModeController())
```

- `vx`, `vy`: signed velocities. `proximity`: `True` when a surface is detected (optical mouse on Tap Strap).
- `TapSDK` mouse events have no euler angles. For orientation, use raw IMU (`tap-raw-sensors`).
- TapXR Spatial Control: `await sdk.set_input_type(InputType.MOUSE)` forces air-mouse; `InputType.AUTO` returns to automatic.

## Patterns

**Cursor on a canvas** (clamp to bounds, optional gain):

```python
GAIN = 1.0
x, y = 400, 300

def on_motion(identifier, motion):
    global x, y
    dx, dy, _, _ = motion
    x = min(max(x + dx * GAIN, 0), WIDTH)
    y = min(max(y + dy * GAIN, 0), HEIGHT)
```

**Relative rotation (roll as a dial)**: store a reference roll when the user starts (for example on a pinch-hold), then use `roll - reference`. Do not use absolute roll; it depends on how the hand is held. See `tap-knob`.

**Smoothing**: an exponential moving average removes jitter:

```python
alpha = 0.3
smooth = alpha * value + (1 - alpha) * smooth
```

**Dead zone**: ignore `abs(dx) + abs(dy) < 2` to stop drift when the hand is still.

**Rate**: count packets per second if timing matters (see `examples/features.py` in the repo). Do not assume a fixed rate.

## Axes

- Tap Strap: https://raw.githubusercontent.com/TapWithUs/tap-python-sdk/master/docs/assets/TAP-axis-alpha.png
- TapXR: https://raw.githubusercontent.com/TapWithUs/tap-python-sdk/master/docs/assets/TAPXR-axis.png

If a direction is inverted on the user's device, flip the sign. Ask the user to test and tell you.

## Docs

- TapSDK2 events: https://tapwithus.github.io/tap-python-sdk/latest/v2/reference/events/
- TapSDK events: https://tapwithus.github.io/tap-python-sdk/latest/v1/reference/events/
- Spatial Control (TapXR): https://tapwithus.github.io/tap-python-sdk/latest/v1/how-to/use-spatial-control/

Wersje

W bazie nie ma innych skilli o nazwie tap-imu-motion.

Migawka bazy z 13.11.2026 · wersja paczki 4e862e4ab513 (skrót SHA-256 całej paczki)

Pobrania w ostatnich 30 dniach: 1 · ranking

Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 100tap-android-imu-motion
    Wykorzystuje ruch dłoni z Tap na Androidzie, czyli dane IMU i zdarzenia myszy, do sterowania kursorem, skrętem lub obrotem.
  • 100tapkit-motion
    Wykorzystuje ruch dłoni TAP z prędkości myszy i orientacji roll, pitch i yaw do przesuwania kursora lub obracania.
  • 100esp32-imu-calibration-frame
    Kalibruje ramkę układu IMU na ESP32, czyli orientację czujnika względem obudowy i osi urządzenia.
  • 100attitude-controller-planner
    Implementuje wewnętrzną pętlę sterowania kwadrokoptera: regulator PID orientacji (roll, pitch, yaw) i planer orientacji, który zamienia żądane przyspieszenie na kąty Eulera.
  • 100tap-raw-sensors
    Strumieniuje surowe próbki akcelerometru i żyroskopu z Tap, ustawia skalowanie, zapisuje dane do CSV i tworzy wykresy.
  • 100device-features
    Obsługuje sprzętowe funkcje G2 w aplikacjach Even Hub: mikrofon, IMU, lokalizację, album i aparat telefonu, informacje o urządzeniu i użytkowniku oraz pamięć lokalną.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.