|
|
|
# Communicaiton protocol
|
|
|
|
We have chosen for a JSON protocol because it is very easy to read and is still very compact.
|
|
|
|
|
|
|
|
## Connect/disconnect
|
|
|
|
To connect or disconnect the following message is sent, these message can only be sent by OpenTCS:
|
|
|
|
```json
|
|
|
|
{
|
|
|
|
"connection": "connect/disconnect"
|
|
|
|
}
|
|
|
|
```
|
|
|
|
The robot has to respond with the following message, in case of connection, so OpenTCS can set the necessary variables:
|
|
|
|
```json
|
|
|
|
{
|
|
|
|
"point": {
|
|
|
|
"x": "<Integer>",
|
|
|
|
"y": "<Integer>",
|
|
|
|
"orientation": "<Integer>"
|
|
|
|
},
|
|
|
|
"battery": "<Integer between 1 and 100>",
|
|
|
|
"state": "CHARGING|ERROR|EXECUTING|IDLE|UNAVAILABLE|UNKNOWN",
|
|
|
|
"operations": ["NOP", "Load cargo", "Unload cargo", "Charge:100", "Charge:50", "Drill", "Cut"]
|
|
|
|
}
|
|
|
|
```
|
|
|
|
The robot has to respond with the following message, in case of disconnecting:
|
|
|
|
```json
|
|
|
|
{
|
|
|
|
"connection": "disconnected"
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
## Transport order
|
|
|
|
Every point the robot has to travel to is an individual message as shown below:
|
|
|
|
```json
|
|
|
|
{
|
|
|
|
"point": {
|
|
|
|
"x": "<Integer>",
|
|
|
|
"y": "<Integer>",
|
|
|
|
"orientation": "<Integer>"
|
|
|
|
},
|
|
|
|
"operation": "NOP|Load cargo|Unload cargo|Charge:100|Charge:50|Drill|Cut",
|
|
|
|
"final": "true|false"
|
|
|
|
}
|
|
|
|
```
|
|
|
|
If the robot arrived at a certain point it sends the following message to OpenTCS:
|
|
|
|
```json
|
|
|
|
{
|
|
|
|
"point": {
|
|
|
|
"x": "<Integer>",
|
|
|
|
"y": "<Integer>",
|
|
|
|
"orientation": "<Integer>"
|
|
|
|
},
|
|
|
|
"battery": "<Integer between 1 and 100>",
|
|
|
|
"state": "CHARGING|ERROR|EXECUTING|IDLE|UNAVAILABLE|UNKNOWN"
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
[home](https://git.fhict.nl/I312980/move-it/wikis/home) |
|
|
|
\ No newline at end of file |