Roban2 Docs
Roban2 (ROS1) Legacy VersionsDevelopment InterfacesHumanoid SDK Interfaces

WebSocket SDK Example Documentation

After following the instructions below, as long as you are within the local network, you can control the robot through the example code without going through ROS.

Starting WebSocket

Starting the WebSocket Server

To use the WebSocket SDK, you must first start the WebSocket server on the host computer:

roslaunch rosbridge_server rosbridge_websocket.launch

SDK Initialization

Before using the SDK, you need to initialize the WebSocket connection. The following parameters must be specified during initialization:

KuavoSDK.Init(
    websocket_mode=True,              # 启用 WebSocket 模式
    websocket_host='127.0.0.1'        # WebSocket 服务器IP地址,需要对应修改,也就是上位机IP
)

Parameter description:

  • websocket_mode: Whether to enable WebSocket mode; must be set to True
  • websocket_host: WebSocket server address, defaults to '127.0.0.1'