bluerobotics / bluerobotics/ping-python

Add instructions on generating new Ping device type

オープン 初心者向け
#74 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Python
スター
60
フォーク
39
PR マージ指標
30日以内にマージされた PR はありません

説明

There are some users interested in extending Ping-Protocol to support other devices with new messages. I just tested what it would take for a normal user to do that and here are instructions:

Copy message definitions and template from a similar device.
```
cd lib/ping-protocol/src/definitions
cp ping1d.json pinghf.json
cd ../../../../generate
cp ping1d.py.in pinghf.py.in
```

Open `generate-python.py` and add the following to the end:
```
definitionFile = "%s/pinghf.json" % definitionPath
templateFile = "%s/pinghf.py.in" % templatePath
f = open("%s/pinghf.py" % args.output_directory, "w")
f.write(g.generate(definitionFile, templateFile, {"structToken": struct_token}))
f.close()
```

Generate the new files:
```
python3 generate/generate-python.py --output-directory brping
```

Now in `python3` you can `from brping import pinghf`.

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

調査の方向性

generate/generate-python.py と lib/ping-protocol/src/definitions および generate 配下のサンプルファイルから始め、ping1d.json と ping1d.py.in をコピーしてジェネレーターを実行するためのドキュメント化されたコマンドを検証します。完了とは、通常のユーザーが手順に従って pinghf ファイルを作成し、Python で brping.pinghf をインポートできることです。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
python
領域
documentation
issue の種類
ドキュメント
難易度
2/5
見積もり時間
1〜3時間
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
62/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。