Skip to main content

Hakoniwa PDU communication library for Python

Project description

hakoniwa-pdu-python

This is a Python PDU communication library for the Hakoniwa simulator.
It allows easy sending/receiving of PDU binary data and conversion to/from JSON over WebSocket.


📦 Installation

pip install hakoniwa-pdu

Check the installed version:

pip show hakoniwa-pdu

🔧 Environment Variables

You can specify the directory containing .offset files used for PDU conversion:

export HAKO_BINARY_PATH=/your/path/to/offset

If not set, the default path will be:

/usr/local/lib/hakoniwa/hako_binary/offset

🚀 Example Usage

Read a PDU from drone using test script

The following sample script receives the pos PDU from the drone and converts it into JSON.

tests/sample.py:

# (your existing sample.py content goes here)

Run example

python tests/sample.py \
  --config ./config/pdudef/webavatar.json \
  --uri ws://localhost:8765

📁 Package Structure

hakoniwa_pdu/
├── pdu_manager.py                  # Manages PDU lifecycle
├── impl/
│   ├── websocket_communication_service.py  # WebSocket implementation
│   ├── pdu_convertor.py            # Binary ⇔ JSON conversion
│   ├── hako_binary/
│   │   └── *.py (Handles offsets and binary layout)
├── resources/
│   └── offset/                     # Offset definition files

🔗 Links


📚 Documentation

For detailed API usage, refer to the full API reference:

➡️ API Reference (api-doc.md)


📜 License

MIT License - see LICENSE for details.

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

hakoniwa_pdu-0.8.2.tar.gz (107.2 kB view details)

Uploaded Source

Built Distribution

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

hakoniwa_pdu-0.8.2-py3-none-any.whl (345.1 kB view details)

Uploaded Python 3

File details

Details for the file hakoniwa_pdu-0.8.2.tar.gz.

File metadata

  • Download URL: hakoniwa_pdu-0.8.2.tar.gz
  • Upload date:
  • Size: 107.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for hakoniwa_pdu-0.8.2.tar.gz
Algorithm Hash digest
SHA256 1bdb8ab2e8833ae57f30dfd80aaa9b07f8b50b0015f528e7a83c1c7faf09a86f
MD5 9ba3b19d7c5723cdb1d1b63f6a10bcf9
BLAKE2b-256 dbaa47a05f6e0fa077c26155a8e1b8acc750ed68c65d416dcf2a8a14a8ff9b73

See more details on using hashes here.

File details

Details for the file hakoniwa_pdu-0.8.2-py3-none-any.whl.

File metadata

  • Download URL: hakoniwa_pdu-0.8.2-py3-none-any.whl
  • Upload date:
  • Size: 345.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for hakoniwa_pdu-0.8.2-py3-none-any.whl
Algorithm Hash digest
SHA256 94bbef6ce986302ecaa42248c44a1186ffd99a80940e2fe4a7b25c134089627e
MD5 0865a678bd4d8f6d0280cd7b7c61a156
BLAKE2b-256 d444d3e46249f2f26982c29ccfc41c8761afc6fe388f7485ae6cfbb08ae0e0f7

See more details on using hashes here.

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