What is ROSBridge?

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.

How is rosbridge used in robotics?

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:

  • Remote monitoring and teleoperation: By exposing ROS topics over a WebSocket connection, rosbridge allows browser-based tools or custom UIs to monitor telemetry, visualize sensor data, or control actuators without being on the same ROS network.
  • Cross-platform applications: rosbridge makes it possible to write control and visualization interfaces in JavaScript, enabling robots to be managed from tablets, mobile phones, or web dashboards.
  • Cloud connectivity: Robots deployed in the field can stream data back to cloud applications that process or visualize data remotely using the rosbridge API.
  • Data visualization: With access to sensor streams like camera feeds, IMU data, or lidar scans, developers can build dashboards that provide real-time insight into what a robot sees and experiences.

Here’s a breakdown of common rosbridge use cases:

Use case Description
Web-based visualization Use WebSockets and JSON to view ROS topic data from browsers or web apps.
Remote control Send velocity or actuator commands to a robot from remote UIs.
Cloud integration Stream telemetry to cloud applications for monitoring or analytics.
Cross-platform development Build interfaces using JavaScript or mobile frameworks to interact with ROS.

Use rosbridge with Foxglove.

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.

How to connect rosbridge to Foxglove.

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:

  • Click Add connection.
  • Select rosbridge WebSocket.
  • Enter the WebSocket URL (e.g., ws://localhost:9090) and click Connect.
  • Explore your data: Use the built-in panels (like image, lidar, plots, or 3D) to inspect topic data in real time.

Benefits of using rosbridge with Foxglove.

  • Zero local ROS dependencies: View and debug ROS data from anywhere using only a browser.
  • Rich visualization: Utilize lidar, image, and 3D panels to understand what your robot sees.
  • Flexible integrations: Whether you’re connecting to a robot over LAN, VPN, or the internet, rosbridge allows Foxglove to hook in seamlessly.
  • Cross-robot compatibility: Foxglove supports both ROS 1 and ROS 2 through rosbridge, making it ideal for hybrid or transitioning systems.

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.

Start building with Foxglove.

Get started