Skip to main content

A Python library for diving station

Project description

Diving Station Python SDK

Diving Stationデバイスと通信するためのPython SDKです。 v1.5.6以降のDiving Stationに対応しています。

特徴

  • Diving Stationデバイスとの接続管理
  • デバイス情報の取得
  • ハンドジェスチャー(手の曲げ、クォータニオン)データの受信
  • 触覚フィードバックの制御
  • 手首の動きデータの受信

インストール

  • pip
pip install diving-station
  • rye
rye add diving-station

使用方法

import asyncio
from diving_station_py.client import DivingStationClient
from diving_station_py.constants import HandType

async def main():
    client = DivingStationClient()
    
    # デバイスに接続
    await client.connect()
    
    # メインデバイスが見つかるまで待機
    main_device = None
    while not main_device:
        await asyncio.sleep(0.1)
        main_device = client.devices[0] if client.devices else None
    
    if main_device:
        # 右手に触覚フィードバックを送信
        await client.send_haptic(
            device_id=main_device.id,
            hand_type=HandType.RIGHT,
            frequency=0.1,
            intensity=1.0,
            duration=0.2
        )
    
    # 切断
    await client.disconnect()

# 非同期実行
asyncio.run(main())

開発

依存関係のインストール

rye sync

テストの実行

テストの実行はDiving Stationを起動し, デバイスを接続してから行ってください。

rye pytest

ライセンス

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

diving_station_py-0.1.1.tar.gz (16.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

diving_station_py-0.1.1-py3-none-any.whl (12.6 kB view details)

Uploaded Python 3

File details

Details for the file diving_station_py-0.1.1.tar.gz.

File metadata

  • Download URL: diving_station_py-0.1.1.tar.gz
  • Upload date:
  • Size: 16.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for diving_station_py-0.1.1.tar.gz
Algorithm Hash digest
SHA256 14eec9af74c08b59fd741b9ac15ca939f08ac4474dba27b3640326fd21d084f2
MD5 73e7dcc6f2301d25c9b439f8e0d63c9e
BLAKE2b-256 8c7a17dce64cc8b18b56a0105a6e31d5d3dfe0df684b6a5cd2a432e04300da0c

See more details on using hashes here.

Provenance

The following attestation bundles were made for diving_station_py-0.1.1.tar.gz:

Publisher: publish.yml on OctSquid/diving-station-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file diving_station_py-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for diving_station_py-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a1928b97e5b479acd3842301b0a342f34c84b3436c5ed97b4c3761cf1be13f63
MD5 9c278fb909a9c4ee9fb116fc78c8d568
BLAKE2b-256 1565cb7b57054b2a14b5864e91eb3638da55b7c40ed3f3682294c589deeecf12

See more details on using hashes here.

Provenance

The following attestation bundles were made for diving_station_py-0.1.1-py3-none-any.whl:

Publisher: publish.yml on OctSquid/diving-station-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page