|
# Communication protocol
|
|
# Communication protocol
|
|
We have chosen for a JSON protocol because it is very easy to read and is still very compact.
|
|
We have chosen for a JSON protocol because it is very easy to read and is still very compact.
|
|
|
|
|
|
## Connect/disconnect
|
|
## Connect/disconnect
|
|
To connect or disconnect the following message is sent, these message can only be sent by OpenTCS:
|
|
To connect or disconnect the following message is sent. The reason for this message is to force an extra handshake with the information of the robot:
|
|
```json
|
|
```json
|
|
{
|
|
{
|
|
"connection": "connect/disconnect"
|
|
"connection": "connect/disconnect"
|
|
}
|
|
}
|
|
```
|
|
```
|
|
The robot has to respond with the following message, in case of connection, so OpenTCS can set the necessary variables:
|
|
In case that you start the connection, the robot responds with the following message. This way OpenTCS will receive extra information from the robot. Take note that the operations have to correspond with both the actions that are available in OpenTCS, and the actions the robot is able to operate:
|
|
```json
|
|
```json
|
|
{
|
|
{
|
|
"point": {
|
|
"point": {
|
... | @@ -21,7 +21,7 @@ The robot has to respond with the following message, in case of connection, so O |
... | @@ -21,7 +21,7 @@ The robot has to respond with the following message, in case of connection, so O |
|
"operations": ["NOP", "Load cargo", "Unload cargo", "Charge:100", "Charge:50", "Drill", "Cut"]
|
|
"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:
|
|
In case that we want to disconnect the robot has to confirm that he wants to disconnect as well:
|
|
```json
|
|
```json
|
|
{
|
|
{
|
|
"connection": "disconnected"
|
|
"connection": "disconnected"
|
... | @@ -29,7 +29,7 @@ The robot has to respond with the following message, in case of disconnecting: |
... | @@ -29,7 +29,7 @@ The robot has to respond with the following message, in case of disconnecting: |
|
```
|
|
```
|
|
|
|
|
|
## Transport order
|
|
## Transport order
|
|
Every point the robot has to travel to is an individual message as shown below:
|
|
Every point the robot has to travel to, is an individual message as shown below:
|
|
```json
|
|
```json
|
|
{
|
|
{
|
|
"point": {
|
|
"point": {
|
... | | ... | |