Planet Handler - Messages
Basics
This handler is used for planet communicative messages on each node the explorer (robot) reaches. For each login, there is a specific set of topics the account has access permissions to.
Correct topics:
planet/<PLANET>/<ID>
planet-dev/<PLANET>/<ID>
Message Types
pathSelect
Type Request:
{
"from": "client",
"type": "pathSelect",
"payload": {
"startX": 0,
"startY": 0,
"startDirection": 0
}
}
Response:
Only sent if controller forces explorer (robot) into specific direction, else omitted
{
"from": "server",
"type": "pathSelect",
"payload": {
"startDirection": 0
}
}
Error Response:
Please note, that error messages will be sent to
explorer/<ID>
and not the planet topic
{
"from": "debug",
"type": "error",
"payload": {
"message": "Expected integer values for either 'startX' or 'startY' but found null"
}
}
path
Type Request:
{
"from": "client",
"type": "path",
"payload": {
"startX": 0,
"startY": 0,
"startDirection": 0,
"endX": 0,
"endY": 0,
"endDirection": 0,
"pathStatus": "free|blocked"
}
}
Response:
{
"from": "server",
"type": "path",
"payload": {
"startX": 0,
"startY": 0,
"startDirection": 0,
"endX": 0,
"endY": 0,
"endDirection": 0,
"pathStatus": "free|blocked",
"pathWeight": 1
}
}
Adjust Response:
{
"from": "debug",
"type": "adjust",
"payload": {
"startX": 0,
"startY": 0,
"startDirection": 0,
"endX": 0,
"endY": 0,
"endDirection": 0
}
}
Error Response:
Please note, that error messages will be sent to
explorer/<ID>
and not the planet topicField
message
is always a string and one of the following items from the (examples) list in the code snippet
{
"from": "debug",
"type": "error",
"payload": {
"message": [
"Invalid message format: <ERROR>",
"Path not found",
"Start coordinate does not match last visited node",
"Start and End coordinates not identical for blocked path",
"Path is not blocked"
],
"debug": ""
}
}
pathUnveiled
Type These messages are sent by the controller after
path
message was processed successfully
Response:
{
"from": "server",
"type": "pathUnveiled",
"payload": {
"startX": 0,
"startY": 0,
"startDirection": 0,
"endX": 0,
"endY": 0,
"endDirection": 0,
"pathStatus": "free|blocked",
"pathWeight": 1
}
}
target
Type These messages are sent by the controller after
path
message was processed successfully
Response:
{
"from": "server",
"type": "target",
"payload": {
"targetX": 0,
"targetY": 0
}
}