JSON-RPC Service

WARNING

Only available in version 3.1.8 and above

JSON-RPC over WebSocket

  • Port: 3030. Controls virtual environment robot.
  • Port: 3031. Controls real robot environment.

JSON-RPC over HTTP

Send POST request data to robot IP:port.

  • Port: 3020. Controls virtual environment robot.
  • Port: 3021. Controls real robot environment.

API Documentation

Example

In Scene Task Related Servicesopen in new window, there is a StartTask interface with input parameter StartTaskRequest and output parameter TaskIndex.

JSON-RPC request data:

{
  "jsonrpc": "2.0",
  "method": "start_task",
  "params": [
    {
      "name": "main",
      "is_parallel": false,
      "loop_to": 1,
      "dir": "",
      "kind": "LUA",
      "params": ["hello"]
    }
  ],
  "id": 1
}

JSON-RPC response data:

{
  "jsonrpc": "2.0",
  "result": {
    "id": 1012
  },
  "id": 1
}

Cases and Resources

To help some users quickly use jsonrpc to call robot scenes, we provide a mobile App with download and usage instructions. Convenient for users to use and reference for development.

References