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.0.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.0-py3-none-any.whl (12.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: diving_station_py-0.1.0.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.0.tar.gz
Algorithm Hash digest
SHA256 8fe638001b6153a454fea85b5abd86ae402bb8b8c50ad32e75366d336712a289
MD5 3bc0dbb6d573c53cf32661247ec300dd
BLAKE2b-256 00406949f0c01a95462f7e33e205daa4296cc6bc4ab6806e4b3a2e1c80bab581

See more details on using hashes here.

Provenance

The following attestation bundles were made for diving_station_py-0.1.0.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.0-py3-none-any.whl.

File metadata

File hashes

Hashes for diving_station_py-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 58662bbb0d127f41427636af6f600f601ad94e486290af9bdc53a79472840b0e
MD5 34785a39289eefee097793b856601131
BLAKE2b-256 1722a174527eb1dfee2b8678455420ddad39ba6ebbd5a782dc8eac695241129d

See more details on using hashes here.

Provenance

The following attestation bundles were made for diving_station_py-0.1.0-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