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.3.tar.gz (107.6 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.3-py3-none-any.whl (347.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: hakoniwa_pdu-0.8.3.tar.gz
  • Upload date:
  • Size: 107.6 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.3.tar.gz
Algorithm Hash digest
SHA256 3d47697a1c04ec310184e4656f915200bd96dda1b85e66f14bef336c75262b36
MD5 a8adbe0d1b45af3b06c9a7d6cbcad3ef
BLAKE2b-256 aa065ae038e26c7c3c431c53c502f2b7f4a4ba32bfe2c4eff2b1188d25c48cf1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hakoniwa_pdu-0.8.3-py3-none-any.whl
  • Upload date:
  • Size: 347.9 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 7e10ae801854b2c9343a7343404698fc8b20d125b3bc2e0d54f52d7c15ef0fc4
MD5 b06bb1e10b3287072c51ca009d8e7793
BLAKE2b-256 8be2ac6db720c9ede6ef4f35a179c3923093e514b5c85c3e1e88e152653c72d6

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