rosbridge provides a JSON interface to ROS, allowing any client to send JSON to publish or subscribe to ROS topics, call ROS services, and more. rosbridge supports a variety of transport layers, including WebSockets and TCP
Rosbridge Protocol:- specification for the JSON messages used to communicate with the ROS environment.
At minimum it includes an “op” field specifying the operation (e.g. publish, subscribe, call service).
rosbridge_library the actual translation between the JSON strings and the internal ROS calls (topics, services, actions, etc.).
It handles the serialization and deserialization of messages without worrying about the transport layer.
rosbridge_server- a ROS node that opens a WebSocket server (usually ws://localhost:9090) and passes the incoming JSON messages to the rosbridge_library for processing, and sends ROS responses back over the WebSocket.
Client Libraries (e.g., roslibjs, roslibpy)- handle the client’s end of the WebSocket communication and provide a convenient API for developers to interact with the rosbridge server.
Launch rosbridge_websocket server (Note: humble uses Python v10)
ros2 launch rosbridge_server rosbridge_websocket_launch.xml# [rosbridge_websocket-1] [INFO] [1726600761.629841995] [rosbridge_websocket]: Rosbridge WebSocket server started on port 9090
By default, this will expose a WebSocket on port 9090 (reserved for ROS communication)
To customize the WebSocket port, add a port argument