Using Foxglove Bridge
The Foxglove bridge is implemented as a C++ node for high performance and low overhead, and allows you to connect to your live ROS 1 and ROS 2 data via the Foxglove WebSocket protocol.
Connect to Foxglove Studio via the Foxglove WebSocket connection to visualize your live robotics data.
foxglove_bridge uses the Foxglove WebSocket protocol, a similar protocol to
rosbridge, but with the ability to support additional schema formats such as ROS 2
.msg and ROS 2
.idl, parameters, graph introspection, and non-ROS systems. The bridge is written in C++ and designed for high performance with low overhead to minimize the impact to your robot stack.
foxglove_bridge package is available for ROS 1 Melodic and Noetic, and ROS 2 Humble and Rolling. Earlier releases of ROS will not be supported due to API design and/or performance limitations. The package can be installed with the following command:
$ sudo apt install ros-$ROS_DISTRO-foxglove-bridge
Use parameters to configure your bridge's behavior. These parameters must be set at initialization through a launch file or the command line – they cannot be modified at runtime.
- port – The TCP port to bind the WebSocket server to. Must be a valid TCP port number, or 0 to use a random port. Defaults to
- address – The host address to bind the WebSocket server to. Defaults to
0.0.0.0, listening on all interfaces by default. Change this to
127.0.0.1to only accept connections from the local machine.
- tls – If
true, use Transport Layer Security (TLS) for encrypted communication. Defaults to
- certfile – Path to the certificate to use for TLS. Required when tls is set to
true. Defaults to
- keyfile – Path to the private key to use for TLS. Required when tls is set to
true. Defaults to
- topic_whitelist – List of regular expressions (ECMAScript grammar) of whitelisted topic names. Defaults to
- send_buffer_limit – Connection send buffer limit in bytes. Messages will be dropped when a connection's send buffer reaches this limit to avoid a queue of outdated messages building up. Defaults to
- (ROS 1) max_update_ms – The maximum number of milliseconds to wait in between polling
roscorefor new topics, services, or parameters. Defaults to
- (ROS 2) num_threads – The number of threads to use for the ROS node executor. This controls the number of subscriptions that can be processed in parallel. 0 means one thread per CPU core. Defaults to
- (ROS 2) max_qos_depth – Maximum depth used for the QoS profile of subscriptions. Defaults to
For directions on how to build from source or to contribute to the project, check out the
ros-foxglove-bridge GitHub repo.