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.8.tar.gz (112.7 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.8-py3-none-any.whl (355.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: hakoniwa_pdu-0.8.8.tar.gz
  • Upload date:
  • Size: 112.7 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.8.tar.gz
Algorithm Hash digest
SHA256 f10ce31a01349fcf4434820a9f0666f0aa11a58dbbd75258937841debc1fb9f4
MD5 553493e115cf08d0954392002e420dcd
BLAKE2b-256 c242fa537a8aebc895bd60748493ad72edd2dd7c8c6ac34a52af10cfada773d5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hakoniwa_pdu-0.8.8-py3-none-any.whl
  • Upload date:
  • Size: 355.0 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.8-py3-none-any.whl
Algorithm Hash digest
SHA256 7b2e5018735af8a8eb41c836e833c46a80347ce0eb9d26afd40b725dd3c45c1c
MD5 3b0ba140b061677f4c2781028a54cb7b
BLAKE2b-256 652c12d492053ea3063f4d163303632b37dc1e788ea5f1969ea95614a651eae7

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