====== Differences ====== This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
specifications:protocol [2015/10/10 02:23] Guvalif |
specifications:protocol [2021/04/01 13:51] (current) |
||
---|---|---|---|
Line 1: | Line 1: | ||
< | < | ||
Protocol | Protocol | ||
- | ======== | + | =============================================================================== |
- | Translate me. | + | ## Basic Specification |
+ | In sending a command, firstly send header that defined as 3 characters. | ||
+ | Secondly formatting and send each argument. | ||
- | ## 基本仕様 | + | Before sending a command, client must convert binary-expression to ascii-expression. |
- | 命令を送信するにあたり、3文字で定義されたヘッダをまず送信し、 | + | (If the client sending a command without conversion, PLEN's moving is different from you intended.) |
- | それに続いて各構成要素を定められたフォーマットのもと順次送信していきます。 | + | |
- | クライアント側では全ての表現を文字列にしてから送信する必要があります。 | + | No differences the command line made of upper case or lower case. |
- | (バイナリをそのまま送信した場合、意図しない動作をすることがあります。) | + | Required baud-rate is **2, |
- | なお、コマンドラインが大文字か小文字かは区別されません。 | ||
+ | ## Group of Controller Command | ||
+ | ### $AN (Apply Native Value) | ||
- | ## Controller関連のコマンド | + | |Args |
- | ### $OV (指示値の適用) | + | |: |
+ | |DEVICE_ID|Set a device id. |0 |23 |0 padding,hex,2 bytes| | ||
+ | |VALUE | ||
- | |タグ | + | *example*: |
- | |: | + | If you want to apply **1000** to device |
- | |DEVICE_ID|デバイス番号の指定 | + | |
- | |VALUE | + | |
- | + | ||
- | *examples* | + | |
- | デバイス**10**に**1000**を出力したい場合、送信するコマンドラインは以下の通りです。 | + | |
``` | ``` | ||
- | $ov0a3e8 | + | $an0a3e8 |
``` | ``` | ||
- | ### $OD (指示値差分の適用) | + | ### $AD (Apply Diff Value) |
- | |タグ | + | |Args |Roles |Min (dec)|Max (dec)|Format |
- | |: | + | |: |
- | |DEVICE_ID|デバイス番号の指定 | + | |DEVICE_ID|Set a device id. |
- | |VALUE | + | |VALUE |
- | *examples* | + | *example*: |
- | デバイス**4**の初期値に**-100**した値を出力したい場合、送信するコマンドラインは以下の通りです。 | + | If you want to apply **home value - 100** to device |
``` | ``` | ||
- | $od043e8f9c | + | $ad04f9c |
``` | ``` | ||
- | ### $PM (モーションの再生) | + | ### $PM (Play a Motion) |
**Attention!** | **Attention!** | ||
- | 後方互換性のために**$MP**も利用可能ですが、[[deprecated]]扱いです。 | + | You could also use "$MP", but this is **deprecated**. |
- | |タグ|役割 | + | |Args|Roles |
- | |:---|:---------------------|: | + | |: |
- | |SLOT|読み出しスロットの指定|0 |89 | + | |SLOT|Set to read slot.|0 |89 |
- | *examples* | + | *example*: |
- | スロット**4**のモーションを再生したい場合、送信するコマンドラインは以下の通りです。 | + | If you want to play slot **4**, send command below. [See also...](http:// |
``` | ``` | ||
Line 60: | Line 59: | ||
``` | ``` | ||
- | ### $SM (モーションの停止) | + | ### $SM (Stop a Motion) |
**Attention!** | **Attention!** | ||
- | 後方互換性のために**$MS**も利用可能ですが、[[deprecated]]扱いです。 | + | You could also use "$MS", but this is **deprecated**. |
- | *examples* | + | *example*: |
- | モーションを停止したい場合、送信するコマンドラインは以下の通りです。 | + | If you want to stop a motion, send command below. |
``` | ``` | ||
Line 72: | Line 71: | ||
``` | ``` | ||
- | ### $HP (初期姿勢への移行) | + | ### $HP (Apply Home Position) |
- | *examples* | + | *example*: |
- | 初期姿勢に移行したい場合、送信するコマンドラインは以下の通りです。 | + | If you want to apply home position, send command below. |
``` | ``` | ||
Line 82: | Line 81: | ||
- | ## Interpreter関連のコマンド | + | ## Group of Interpreter |
- | ### #PU (関数のプッシュ) | + | ### #PU (Push a Function) |
- | |タグ | + | |Args |Roles |
- | |: | + | |: |
- | |SLOT |読出しスロットの指定 | + | |SLOT |Set to read slot. |
- | |LOOP_COUNT|ループ回数の指定 | + | |LOOP_COUNT|Set number of play.|0 |255 |0 padding,hex,2 bytes| |
- | *examples* | + | *example*: |
- | スロット**10**のモーションを**3**回再生する関数をプッシュしたい場合、送信するコマンドラインは以下の通りです。 | + | If you want to push function that plays slot **10** **three** times, send command below. |
``` | ``` | ||
Line 97: | Line 96: | ||
``` | ``` | ||
- | ### #PO (関数のポップ) | + | ### #PO (Pop a Function) |
- | *examples* | + | *example*: |
- | 関数をポップしたい場合、送信するコマンドラインは以下の通りです。 | + | If you want to pop a function, send command below. |
``` | ``` | ||
Line 106: | Line 105: | ||
``` | ``` | ||
- | ### #RI (インタプリタの初期化) | + | ### #RI (Reset the Interpreter) |
- | *examples* | + | *example*: |
- | インタプリタを初期化したい場合、送信するコマンドラインは以下の通りです。 | + | If you want to reset the interpreter, |
``` | ``` | ||
Line 116: | Line 115: | ||
- | ## Setter関連のコマンド | + | ## Group of Setter |
- | ### >IN (モーションのインストール) | + | ### >MH (Set a Motion Header) |
- | **Attention!** | + | |Args |Roles |
- | [[deprecated]]扱いです。ver.1.2.0では廃止予定なので、基本的に後述の**> | + | |: |
+ | |SLOT |Set to write slot. |0 |89 |0 padding,hex,2 bytes | | ||
+ | |NAME |Set a motion name. |--- |--- |White space padding,20 bytes| | ||
+ | |USE_LOOP | ||
+ | |LOOP_BEGIN | ||
+ | |LOOP_END | ||
+ | |LOOP_COUNT | ||
+ | |USE_JUMP | ||
+ | |JUMP_SLOT | ||
+ | |USE_EXTRA | ||
+ | |FRAME_LENGTH|Set a frame length. | ||
- | |タグ | + | *example*: |
- | |: | + | Please get more details at "> |
- | |SLOT |書き込みスロットの指定 | + | |
- | |NAME |モーション名の指定 | + | |
- | |FUNC |関数の指定 (*1) |0 |255 |0埋め,16進数表現,2byte| | + | |
- | |ARG0 |制御機能に渡す引数0 (*1) |0 |255 |0埋め,16進数表現,2byte| | + | |
- | |ARG1 |制御機能に渡す引数1 (*1) |0 |255 |0埋め,16進数表現,2byte| | + | |
- | |FRAME_LENGTH | + | |
- | |TRANSITION_TIME_MS|遷移時間の指定 | + | |
- | |VALUE[DEVICE_ID] | + | |
- | **(*1) 関数の種類と引数の意味は下表の通りです。** | + | ### > |
- | |" | + | |Args |
- | |: | + | |:-----------------|: |
- | |0 | + | |SLOT |Set to write slot. |0 |89 |0 padding,hex,2 bytes| |
- | |1 | + | |FRAME_ID |
- | |2 |jump,再生終了後、" | + | |TRANSITION_TIME_MS|Set a transition time (msec).|32 |
+ | |VALUE[DEVICE_ID] | ||
- | **(*2) デバイスの個数は現状24個で、全てサーボモータです。** | + | **(*1) Sum of devices is 24 and the all are servo motors in current implementation.** |
- | *example*: | + | *example* |
- | 以下のようなモーションをインストールするとします。 | + | Introduce how to install a motion below. |
- | |タグ | + | |Args |Values| |
- | |: | + | |: |
- | |SLOT |0 | + | |SLOT |0 |
- | |NAME |Test| | + | |NAME |Test | |
- | |FUNC | + | |USE_LOOP |
- | |ARG0 | + | |LOOP_BEGIN |
- | |ARG1 | + | |LOOP_END |
- | |FRAME_LENGTH | + | |LOOP_COUNT |
- | |TRANSITION_TIME_MS|100 | | + | |USE_JUMP |
- | |OUTPUT[EVEN] | + | |JUMP_SLOT |
- | |OUTPUT[ODD] | + | |USE_EXTRA |
+ | |FRAME_LENGTH | ||
- | その際、送信するコマンドラインは以下の通りです。(改行は実際には必要ありません。) | + | |Args |Values| |
+ | |: | ||
+ | |TRANSITION_TIME_MS|100 | ||
+ | |VALUE[EVEN] | ||
+ | |VALUE[ODD] | ||
+ | |||
+ | Please send command below. | ||
``` | ``` | ||
- | >in | + | >MH00 |
- | 00Test | + | Test |
+ | 1 | ||
+ | 00 | ||
+ | 01 | ||
+ | 03 | ||
+ | 1 | ||
+ | 32 | ||
+ | 0 | ||
+ | 02 | ||
+ | |||
+ | >MF | ||
+ | 00 | ||
+ | 00 | ||
0064 | 0064 | ||
- | 000fff000fff000fff000fff | + | 0000ffff0000ffff0000ffff0000ffff |
- | 000fff000fff000fff000fff | + | 0000ffff0000ffff0000ffff0000ffff |
- | 000fff000fff000fff000fff | + | 0000ffff0000ffff0000ffff0000ffff |
+ | |||
+ | >MF | ||
+ | 00 | ||
+ | 01 | ||
0064 | 0064 | ||
- | 000fff000fff000fff000fff | + | 0000ffff0000ffff0000ffff0000ffff |
- | 000fff000fff000fff000fff | + | 0000ffff0000ffff0000ffff0000ffff |
- | 000fff000fff000fff000fff | + | 0000ffff0000ffff0000ffff0000ffff |
``` | ``` | ||
- | ### >MH (モーションヘッダの設定) | + | If you are interested deeply, please see also |
- | + | [the implementation on the Control Server](https:// | |
- | |タグ | + | |
- | |:-----------|: | + | |
- | |SLOT |書き込みスロットの指定|0 | + | |
- | |NAME |モーション名の指定 | + | |
- | |FUNC |関数の指定 (*1) |0 |255 |0埋め,16進数表現,2byte| | + | |
- | |ARG0 |制御機能に渡す引数0 | + | |
- | |ARG1 |制御機能に渡す引数1 | + | |
- | |FRAME_LENGTH|フレーム総数の指定 | + | |
- | + | ||
- | 細かい仕様については、"> | + | |
- | + | ||
- | ### >MF (モーションフレームの設定) | + | |
- | + | ||
- | |タグ | + | |
- | |: | + | |
- | |SLOT |書き込みスロットの指定 | + | |
- | |FRAME_ID | + | |
- | |TRANSITION_TIME_MS|遷移時間の指定 | + | |
- | |VALUE[DEVICE_ID] | + | |
- | + | ||
- | 細かい仕様については、"> | + | |
- | ### >JS (関節設定の初期化) | + | ### >JS (Reset the Joint Settings) |
*example*: | *example*: | ||
- | 関節設定を初期化したい場合に、送信するコマンドラインは以下の通りです。 | + | If you want to reset the joint settings, send command below. |
``` | ``` | ||
Line 206: | Line 210: | ||
``` | ``` | ||
- | ### >HO (初期値の設定) | + | ### >HO (Set a Home Value) |
- | |タグ | + | |Args |Roles |Min (dec)|Max (dec)|Format |
- | |: | + | |: |
- | |DEVICE_ID|デバイス番号の指定|0 |23 | + | |DEVICE_ID|Set a device id. |
- | |VALUE | + | |VALUE |
- | *example* | + | *example*: |
- | デバイス**0**の初期値を**100**に設定したい場合、送信するコマンドラインは以下の通りです。 | + | If you want to apply **100** as home value to device |
``` | ``` | ||
Line 220: | Line 224: | ||
``` | ``` | ||
- | ### >MA (最大値の設定) | + | ### >MA (Set a Max Value) |
- | |タグ | + | |Args |Roles |
- | |: | + | |: |
- | |DEVICE_ID|デバイス番号の指定|0 |23 | + | |DEVICE_ID|Set a device id. |0 |23 |
- | |VALUE | + | |VALUE |
- | *example* | + | *example*: |
- | デバイス**0**の最大値を**100**に設定したい場合、送信するコマンドラインは以下の通りです。 | + | If you want to apply **100** as max value to device |
``` | ``` | ||
Line 234: | Line 238: | ||
``` | ``` | ||
- | ### >MI (最小値の設定) | + | ### >MI (Set a Min Value) |
- | |タグ | + | |Args |Roles |
- | |: | + | |: |
- | |DEVICE_ID|デバイス番号の指定|0 |23 | + | |DEVICE_ID|Set a device id. |0 |23 |
- | |VALUE | + | |VALUE |
- | *example* | + | *example*: |
- | デバイス**10**の最小値を**-1**に設定したい場合、送信するコマンドラインは以下の通りです。 | + | If you want to apply **-1** as min value to device |
``` | ``` | ||
Line 248: | Line 252: | ||
``` | ``` | ||
- | ## Getter関連のコマンド | + | ## Group of Getter |
- | ### <JS (関節設定のダンプ) | + | ### <JS (Dump the Joint Settings) |
- | *examples* | + | *example*: |
- | 関節設定をダンプしたい場合、送信するコマンドラインは以下の通りです。 | + | If you want to dump the joint settings, send command below. |
``` | ``` | ||
Line 258: | Line 262: | ||
``` | ``` | ||
- | その際、以下のような書式のJSONが出力されます。 | + | At that time, outputting result like json below. |
``` | ``` | ||
- | { | + | [ |
- | " | + | { |
- | { | + | "@device": < |
- | "joint": < | + | "max": < |
- | "MAX": < | + | "min": < |
- | "MIN": < | + | "home": < |
- | "HOME": < | + | }, |
- | }, | + | ... |
- | ... | + | ] |
- | ] | + | |
- | } | + | |
``` | ``` | ||
- | ### <MO (モーションのダンプ) | + | ### <MO (Dump a Motion) |
- | |タグ|役割 | + | |Args|Roles |
- | |:---|:-------------------|: | + | |: |
- | |SLOT|読出しスロットの指定|0 |89 | + | |SLOT|Set to read slot.|0 |89 |
- | *example* | + | *example*: |
- | スロット**0**のモーションをダンプしたい場合、送信するコマンドラインは以下の通りです。 | + | If you want to dump slot **0**, send command below. |
``` | ``` | ||
Line 287: | Line 289: | ||
``` | ``` | ||
- | その際、motion.jsonと同様な形式のJSONが出力されます。 | + | At that time, outputting result like "motion.json". ([See also...](https:// |
- | ただし、" | + | However, property |
- | device_map.jsonで定義されているようなIDの**ineteger**です。 | + | |
- | ### <VI (バージョン情報のダンプ) | + | ### <VI (Dump the Version Information) |
- | *examples* | + | *example*: |
- | バージョン情報をダンプしたい場合、送信するコマンドラインは以下の通りです。 | + | If you want to dump the version information, |
``` | ``` | ||
Line 300: | Line 301: | ||
``` | ``` | ||
- | その際、以下のような書式のJSONが出力されます。 | + | At that time, outputting result like json below. |
``` | ``` | ||
{ | { | ||
- | " | + | |
- | " | + | " |
- | " | + | " |
} | } | ||
``` | ``` | ||
</ | </ |