User Tools

Site Tools


specifications:protocol

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
specifications:protocol [2015/10/12 04:55]
Guvalif
specifications:protocol [2021/04/01 13:51] (current)
Line 1: Line 1:
 <markdown> <markdown>
 Protocol Protocol
-========+===============================================================================
  
 ## Basic Specification ## Basic Specification
Line 11: Line 11:
  
 No differences the command line made of upper case or lower case. No differences the command line made of upper case or lower case.
 +Required baud-rate is **2,000,000**.
  
  
Line 16: Line 17:
 ### $AN (Apply Native Value) ### $AN (Apply Native Value)
  
-|Args     |Roles                     |Min (dec)|Max (dec)|Format               +|Args     |Roles                     |Min (dec)|Max (dec)|Format                 
-|:--------|:-------------------------|:-------:|:-------:|:--------------------| +|:--------|:-------------------------|:-------:|:-------:|:----------------------| 
-|DEVICE_ID|Set a device id.          |0        |23       |0 padding,hex,2byte+|DEVICE_ID|Set a device id.          |0        |23       |0 padding,hex,2 bytes
-|VALUE    |Set to apply native value.|-2048    |2047     |0 padding,hex,3byte|+|VALUE    |Set to apply native value.|-2048    |2047     |0 padding,hex,3 bytes|
  
 *example*:   *example*:  
Line 30: Line 31:
 ### $AD (Apply Diff Value) ### $AD (Apply Diff Value)
  
-|Args     |Roles                   |Min (dec)|Max (dec)|Format               +|Args     |Roles                   |Min (dec)|Max (dec)|Format                 
-|:--------|:-----------------------|:-------:|:-------:|:--------------------| +|:--------|:-----------------------|:-------:|:-------:|:----------------------| 
-|DEVICE_ID|Set a device id.        |0        |23       |0 padding,hex,2byte+|DEVICE_ID|Set a device id.        |0        |23       |0 padding,hex,2 bytes
-|VALUE    |Set to apply diff value.|-2048    |2047     |0 padding,hex,3byte|+|VALUE    |Set to apply diff value.|-2048    |2047     |0 padding,hex,3 bytes|
  
 *example*:   *example*:  
Line 45: Line 46:
  
 **Attention!**   **Attention!**  
-You could also use "$MP", but this is **[[deprecated]]**.+You could also use "$MP", but this is **deprecated**.
  
-|Args|Roles            |Min (dec)|Max (dec)|Format               +|Args|Roles            |Min (dec)|Max (dec)|Format                 
-|:---|:----------------|:-------:|:-------:|:--------------------| +|:---|:----------------|:-------:|:-------:|:----------------------| 
-|SLOT|Set to read slot.|0        |89       |0 padding,hex,2byte|+|SLOT|Set to read slot.|0        |89       |0 padding,hex,2 bytes|
  
 *example*:   *example*:  
-If you want to play slot **4**, send command below.+If you want to play slot **4**, send command below. [See also...](http://plen.jp/playground/wiki/specifications/motion_assignment)
  
 ``` ```
Line 61: Line 62:
  
 **Attention!**   **Attention!**  
-You could also use "$MS", but this is **[[deprecated]]**.+You could also use "$MS", but this is **deprecated**.
  
 *example*:   *example*:  
Line 83: Line 84:
 ### #PU (Push a Function) ### #PU (Push a Function)
  
-|Args      |Roles              |Min (dec)|Max (dec)|Format               +|Args      |Roles              |Min (dec)|Max (dec)|Format                 
-|:---------|:------------------|:-------:|:-------:|:--------------------| +|:---------|:------------------|:-------:|:-------:|:----------------------| 
-|SLOT      |Set to read slot.  |0        |89       |0 padding,hex,2byte+|SLOT      |Set to read slot.  |0        |89       |0 padding,hex,2 bytes
-|LOOP_COUNT|Set number of play.|0        |255      |0 padding,hex,2byte|+|LOOP_COUNT|Set number of play.|0        |255      |0 padding,hex,2 bytes|
  
 *example*:   *example*:  
Line 115: Line 116:
  
 ## Group of Setter Command ## Group of Setter Command
-### >IN (Install a Motion)+### >MH (Set a Motion Header)
  
-**Attention!**   +|Args        |Roles                                     |Min (dec)|Max (dec)|Format                       | 
-This is **[[deprecated]]**Obsolescent at firmware version 1.2.0. +|:-----------|:-----------------------------------------|:-------:|:-------:|:----------------------------| 
-Please using **>MH** and **>MF** that are described after basically.+|SLOT        |Set to write slot                       |0        |89       |0 padding,hex,2 bytes      | 
 +|NAME        |Set a motion name.                        |---      |---      |White space padding,20 bytes| 
 +|USE_LOOP    |Use loop function or not.                 |0        |       |True (1) or false (0), 1 byte| 
 +|LOOP_BEGIN  |Set a loop beginning frame              |0        |255      |0 padding,hex,bytes      | 
 +|LOOP_END    |Set a loop ending frame                 |       |255      |0 padding,hex,2 bytes      | 
 +|LOOP_COUNT  |Set a loop count(255 as infinity.)      |0        |255      |0 padding,hex,2 bytes      | 
 +|USE_JUMP    |Use jump function or not.                 |0        |1        |True (1) or false (0), 1 byte| 
 +|JUMP_SLOT   |Jump to the slot after stopped the motion.|0        |255      |0 padding,hex,2 bytes      | 
 +|USE_EXTRA   |Use extra function or not. (WIP)          |0        |1        |True (1) or false (0), 1 byte| 
 +|FRAME_LENGTH|Set a frame length.                       |1        |20       |0 padding,hex,2 bytes      |
  
-|Args              |Roles                        |Min (dec)|Max (dec)|Format                     | +*example*:   
-|:-----------------|:----------------------------|:-------:|:-------:|:--------------------------| +Please get more details at ">MF" section.
-|SLOT              |Set to write slot.           |0        |89       |0 padding,hex,2byte      | +
-|NAME              |Set a motion name.           |---      |---      |white space padding,20byte| +
-|FUNC              |Set a function. (*1)         |0        |255      |0 padding,hex,2byte      | +
-|ARG0              |Set a function's arg 0. (*1) |0        |255      |0 padding,hex,2byte      | +
-|ARG1              |Set a function's arg 1(*1) |0        |255      |0 padding,hex,2byte      | +
-|FRAME_LENGTH      |Set a frame length.          |1        |20       |0 padding,hex,2byte      | +
-|TRANSITION_TIME_MS|Set a transition time (msec).|32       |65535    |0 padding,hex,4byte      | +
-|VALUE[DEVICE_ID]  |Set to apply value. (*2)     |-32768   |32767    |0 padding,hex,4byte      |+
  
-**(*1Type of function and role of args are described below.**+### >MF (Set a Motion Frame)
  
-|"FUNC"'s Values|Roles                                                    +|Args              |Roles                        |Min (dec)|Max (dec)|Format                 
-|:--------------|:--------------------------------------------------------| +|:-----------------|:----------------------------|:-------:|:-------:|:----------------------| 
-|             |---                                                      +|SLOT              |Set to write slot.           |0        |89       |0 padding,hex,2 bytes
-|1              |Play motion with infinite loop between arg 0 and arg 1.| +|FRAME_ID          |Set frame id.              |       |20       |0 padding,hex,2 bytes| 
-|2              |Jump to arg 0 if then stopped the motion               |+|TRANSITION_TIME_MS|Set a transition time (msec).|32       |65535    |0 padding,hex,4 bytes
 +|VALUE[DEVICE_ID]  |Set to apply value(*1)     |-32768   |32767    |0 padding,hex,4 bytes|
  
-**(*2) Sum of devices is 24 and all are servo motor.**+**(*1) Sum of devices is 24 and the all are servo motors in current implementation.**
  
-*example*  +*example*   
-Let install a motion below.+Introduce how to install a motion below.
  
 |Args              |Values| |Args              |Values|
Line 149: Line 152:
 |SLOT              |0     | |SLOT              |0     |
 |NAME              |Test  | |NAME              |Test  |
-|FUNC              |0     | +|USE_LOOP          |True  | 
-|ARG0              |    | +|LOOP_BEGIN        |0     | 
-|ARG1              |    |+|LOOP_END          |    | 
 +|LOOP_COUNT        |    
 +|USE_JUMP          |True  | 
 +|JUMP_SLOT         |50    | 
 +|USE_EXTRA         |False |
 |FRAME_LENGTH      |2     | |FRAME_LENGTH      |2     |
 +
 +|Args              |Values|
 +|:-----------------|:-----|
 |TRANSITION_TIME_MS|100   | |TRANSITION_TIME_MS|100   |
-|OUTPUT[EVEN]      |0     | +|VALUE[EVEN]       |0     | 
-|OUTPUT[ODD]       |-1    |+|VALUE[ODD]        |-1    |
  
-Please send command below. (There are no CR, LF, or CRLF actually.)+Please send command below. (Do not need to insert CR, LF, or CRLF actually.)
  
 ``` ```
->in +>MH00 
-00Test                00000002+Test                 
 +
 +00 
 +01 
 +03 
 +
 +32 
 +
 +02 
 + 
 +>MF 
 +00 
 +00
 0064 0064
 0000ffff0000ffff0000ffff0000ffff 0000ffff0000ffff0000ffff0000ffff
 0000ffff0000ffff0000ffff0000ffff 0000ffff0000ffff0000ffff0000ffff
 0000ffff0000ffff0000ffff0000ffff 0000ffff0000ffff0000ffff0000ffff
 +
 +>MF
 +00
 +01
 0064 0064
 0000ffff0000ffff0000ffff0000ffff 0000ffff0000ffff0000ffff0000ffff
Line 172: Line 198:
 ``` ```
  
-### >MH (Set a Motion Header) +If you are interested deeply, please see also 
- +[the implementation on the Control Server](https://github.com/plenprojectcompany/plen-ControlServer/blob/master/control_server/protocol/protocol.py).
-|Args        |Roles                       |Min (dec)|Max (dec)|Format                     | +
-|:-----------|:---------------------------|:-------:|:-------:|:--------------------------| +
-|SLOT        |Set to write slot         |0        |89       |0 padding,hex,2byte      | +
-|NAME        |Set a motion name.          |---      |---      |white space padding,20byte| +
-|FUNC        |Set a function(*1       |0        |255      |0 padding,hex,2byte      | +
-|ARG0        |Set a function's arg 0. (*1)|0        |255      |0 padding,hex,2byte      | +
-|ARG1        |Set a function's arg 1. (*1)|0        |255      |0 padding,hex,2byte      | +
-|FRAME_LENGTH|Set a frame length          |1        |20       |0 padding,hex,2byte      | +
- +
-Please get more detail at ">IN" section. +
- +
-### >MF (Set a Motion Frame) +
- +
-|Args              |Roles                        |Min (dec)|Max (dec)|Format               | +
-|:-----------------|:----------------------------|:-------:|:-------:|:--------------------| +
-|SLOT              |Set to write slot.           |0        |89       |0 padding,hex,2byte| +
-|FRAME_ID          |Set a frame id.              |1        |20       |0 padding,hex,2byte| +
-|TRANSITION_TIME_MS|Set a transition time (msec).|32       |65535    |0 padding,hex,4byte| +
-|VALUE[DEVICE_ID]  |Set to apply value. (*2)     |-32768   |32767    |0 padding,hex,4byte| +
- +
-Please get more detail at ">IN" section.+
  
 ### >JS (Reset the Joint Settings) ### >JS (Reset the Joint Settings)
Line 207: Line 212:
 ### >HO (Set a Home Value) ### >HO (Set a Home Value)
  
-|Args     |Roles                   |Min (dec)|Max (dec)|Format               +|Args     |Roles                   |Min (dec)|Max (dec)|Format                 
-|:--------|:-----------------------|:-------:|:-------:|:--------------------| +|:--------|:-----------------------|:-------:|:-------:|:----------------------| 
-|DEVICE_ID|Set a device id.        |0        |23       |0 padding,hex,2byte+|DEVICE_ID|Set a device id.        |0        |23       |0 padding,hex,2 bytes
-|VALUE    |Set to apply home value.|-2048    |2047     |0 padding,hex,3byte|+|VALUE    |Set to apply home value.|-2048    |2047     |0 padding,hex,3 bytes|
  
 *example*:   *example*:  
Line 221: Line 226:
 ### >MA (Set a Max Value) ### >MA (Set a Max Value)
  
-|Args     |Roles                  |Min (dec)|Max (dec)|Format               +|Args     |Roles                  |Min (dec)|Max (dec)|Format                 
-|:--------|:----------------------|:-------:|:-------:|:--------------------| +|:--------|:----------------------|:-------:|:-------:|:----------------------| 
-|DEVICE_ID|Set a device id.       |0        |23       |0 padding,hex,2byte+|DEVICE_ID|Set a device id.       |0        |23       |0 padding,hex,2 bytes
-|VALUE    |Set to apply max value.|-2048    |2047     |0 padding,hex,3byte|+|VALUE    |Set to apply max value.|-2048    |2047     |0 padding,hex,3 bytes|
  
 *example*:   *example*:  
Line 235: Line 240:
 ### >MI (Set a Min Value) ### >MI (Set a Min Value)
  
-|Args     |Roles                  |Min (dec)|Max (dec)|Format               +|Args     |Roles                  |Min (dec)|Max (dec)|Format                 
-|:--------|:----------------------|:-------:|:-------:|:--------------------| +|:--------|:----------------------|:-------:|:-------:|:----------------------| 
-|DEVICE_ID|Set a device id.       |0        |23       |0 padding,hex,2byte+|DEVICE_ID|Set a device id.       |0        |23       |0 padding,hex,2 bytes
-|VALUE    |Set to apply min value.|-2048    |2047     |0 padding,hex,3byte|+|VALUE    |Set to apply min value.|-2048    |2047     |0 padding,hex,3 bytes|
  
 *example*:   *example*:  
Line 260: Line 265:
  
 ``` ```
-+
- "settings": +    
- +        "@device": <integer>, 
- "joint": <integer>, +        "max": <integer>, 
- "MAX": <integer>, +        "min": <integer>, 
- "MIN": <integer>, +        "home": <integer> 
- "HOME": <integer> +    }, 
- }, +    ... 
- ... +]
- ] +
-}+
 ``` ```
  
 ### <MO (Dump a Motion) ### <MO (Dump a Motion)
  
-|Args|Roles            |Min (dec)|Max (dec)|Format               +|Args|Roles            |Min (dec)|Max (dec)|Format                 
-|:---|:----------------|:-------:|:-------:|:--------------------| +|:---|:----------------|:-------:|:-------:|:----------------------| 
-|SLOT|Set to read slot.|0        |89       |0 padding,hex,2byte|+|SLOT|Set to read slot.|0        |89       |0 padding,hex,2 bytes|
  
 *example*:   *example*:  
Line 286: Line 289:
 ``` ```
  
-At that time, outputting result like "motion.json". ([See also...](https://github.com/plenproject/PLEN2/tree/master/motion)) +At that time, outputting result like "motion.json". ([See also...](https://github.com/plenprojectcompany/PLEN2/tree/master/motions)) 
-However, property "device"'s type is not **string** but **integer** defined as device id in "[device_map.json](https://github.com/plenproject/plen__control_server/blob/master/control_server/device_map.json)".+However, property "device"'s type is not **string** but **integer** defined as device id in "[device_map.json](https://github.com/plenprojectcompany/plen-ControlServer/blob/master/control_server/device_map.json)".
  
 ### <VI (Dump the Version Information) ### <VI (Dump the Version Information)
Line 302: Line 305:
 ``` ```
 { {
- "device": <string>, +    "device": <string>, 
- "codename": <string>, +    "codename": <string>, 
- "version": <string>+    "version": <string>
 } }
 ``` ```
 </markdown> </markdown>
specifications/protocol.1444625704.txt.gz · Last modified: 2021/04/01 13:50 (external edit)