このリポジトリには、Hakoniwa Core Proの機能を示すサンプルプログラムが含まれています。
各サンプルはexamplesディレクトリ以下に格納されています。
- hello_world: Hakoniwaアセットの基本的な作成方法とライフサイクルを示します。
- pdu_communication: 2つのアセット(コントローラとプラント)がPDU(Protocol Data Unit)を介して通信する方法を示します。
- service: アセットがクライアント・サーバーモデルでサービスを提供・利用する方法を示します。
- OS: Ubuntu 24.04 LTS 以上
- Python: 3.12
hakoniwa-pduのインストール:pip install hakoniwa-pdu
- その他:
git,cmake,build-essential
以下のコマンドを実行して、必要なパッケージをインストールしてください。
echo "deb [trusted=yes] https://hakoniwalab.github.io/apt stable main" \
| sudo tee /etc/apt/sources.list.d/hakoniwa.listsudo apt updatesudo apt install -y git cmake build-essentialsudo apt install -y hakoniwa-core-fullsudo usermod -aG hakoniwa <your-username>newgrp hakoniwa- ビルド用のディレクトリを作成します。
mkdir build cd build - CMakeを実行してビルドファイルを生成します。
examplesディレクトリを指定してください。cmake ../examples
- makeコマンドでビルドを実行します。
make
- ビルドが成功すると、
buildディレクトリ以下に各サンプルの実行ファイルが生成されます。hello_world/hello_worldpdu_communication/asset_controllerpdu_communication/asset_plantservice/asset_clientservice/asset_server
各サンプルの詳細な実行手順については、それぞれのディレクトリにあるREADME.mdファイルを参照してください。