Rosbridge is a protocol and set of tools that provide a JSON API to ROS (Robot Operating System). It enables non-ROS programs—such as web applications, mobile apps, or cloud-based systems—to interface with ROS using standard web technologies like WebSockets and JSON. Instead of relying on native ROS clients written in C++ or Python, developers can use rosbridge to exchange ROS messages, publish to topics, call services, and subscribe to data—all without needing to run ROS locally.
The core of rosbridge is rosbridge_server, which acts as a WebSocket server that translates JSON messages into ROS commands and vice versa. This allows seamless integration of ROS with a wide variety of front-end and remote applications. The rosbridge protocol is part of the larger rosbridge_suite, which includes additional tools like rosapi for system introspection.
In modern robotics systems, interoperability and visualization are key to development and monitoring workflows. rosbridge is often used to bridge the gap between ROS-based robots and user interfaces or applications that don’t run on ROS. Here’s how it’s typically used in robotic applications:
Here’s a breakdown of common rosbridge use cases:
Foxglove is a powerful tool for robotics data visualization and introspection. It supports connecting directly to ROS 1 and ROS 2 systems via rosbridge, making it easy to view live data streams or recorded bag files without running a local ROS environment. This is especially useful for developers who want to inspect messages, debug systems, or create dashboards.
To connect Foxglove to a ROS system via rosbridge:
1. Install rosbridge:
sudo apt install ros-${ROS_DISTRO}-rosbridge-server
2. Launch the rosbridge server:
roslaunch rosbridge_server rosbridge_websocket.launch
3. Start Foxglove:
Open Foxglove in your browser.
4. Add a connection:
With its real-time capabilities and intuitive interface, Foxglove turns raw ROS topics into meaningful visualizations. Paired with rosbridge, it becomes a versatile tool for remote diagnostics, development, and monitoring in robotics applications.
For a deeper walkthrough of setting up rosbridge in a ROS 2 project, check out Using rosbridge with ROS 2.