High performance ROS 1 and ROS 2 WebSocket bridge using the Foxglove WebSocket protocol, written in C++.
Live debugging of ROS systems has traditionally relied on running ROS tooling such as rviz. This requires either a GUI and connected peripherals on the robot, or replicating the same ROS environment on a network-connected development machine including the same version of ROS, all custom message definitions, etc. To overcome this limitation and allow remote debugging from web tooling or non-ROS systems, rosbridge was developed. However, rosbridge suffers from performance problems with high frequency topics and/or large messages, and the protocol does not support full visibility into ROS systems such as interacting with parameters or seeing the full graph of publishers and subscribers.
The 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.
Note: This project is under active development and binary releases of foxglove_bridge
might be quite outdated. For the latest features and bug fixes, consider building foxglove_bridge from source.
The 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
To run the bridge node, it is recommended to use the provided launch file:
ROS 1
roslaunch --screen foxglove_bridge foxglove_bridge.launch port:=8765
<launch>
<!-- Including in another launch file -->
<include file="$(find foxglove_bridge)/launch/foxglove_bridge.launch">
<arg name="port" value="8765" />
<!-- ... other arguments ... -->
</include>
</launch>
ROS 2
ros2 launch foxglove_bridge foxglove_bridge_launch.xml port:=8765
<launch>
<!-- Including in another launch file -->
<include file="$(find-pkg-share foxglove_bridge)/launch/foxglove_bridge_launch.xml">
<arg name="port" value="8765"/>
<!-- ... other arguments ... -->
</include>
</launch>
Parameters are provided to configure the behavior of the bridge. These parameters must be set at initialization through a launch file or the command line, they cannot be modified at runtime.
8765
.0.0.0.0
, listening on all interfaces by default. Change this to 127.0.0.1
(or ::1
for IPv6) to only accept connections from the local machine.true
, use Transport Layer Security (TLS) for encrypted communication. Defaults to false
.true
. Defaults to ""
.true
. Defaults to ""
.[".*"]
.[".*"]
.[".*"]
.
[".*"]
.10000000
(10 MB).false
.[clientPublish,parameters,parametersSubscribe,services,connectionGraph,assets]
.package://
, file://
or http(s)://
URIs. Note that this list should be carefully configured such that no confidential files are accidentally exposed over the websocket connection. As an extra security measure, URIs containing two consecutive dots (..
) are disallowed as they could be used to construct URIs that would allow retrieval of confidential files if the allowlist is not configured strict enough (e.g. package://<pkg_name>/../../../secret.txt
). Defaults to ["^package://(?:\w+/)*\w+\.(?:dae|fbx|glb|gltf|jpeg|jpg|mtl|obj|png|stl|tif|tiff|urdf|webp|xacro)$"]
.roscore
for new topics, services, or parameters. Defaults to 5000
.250
.0
.1
. This is to set a lower limit for a subscriber's QoS depth which is computed by summing up depths of all publishers. See also #208.25
.false
.true
.cd <path/to/your/ros_ws>
git clone https://github.com/foxglove/ros-foxglove-bridge.git src/ros-foxglove-bridge
rosdep update
rosdep install --ignore-src --default-yes --from-path src
catkin_make
source install/local_setup.bash
roslaunch --screen foxglove_bridge foxglove_bridge.launch
colcon build --event-handlers console_direct+ --symlink-install
source install/local_setup.bash
ros2 launch foxglove_bridge foxglove_bridge_launch.xml
Foxglove connects to foxglove_bridge for live robotics visualization.
A VSCode container is provided with a dual ROS 1 and ROS 2 installation and enough tools to build and run the bridge. Some bash aliases are defined to simplify the common workflow. Here's an example of building and running the ROS 2 node:
source /opt/ros/humble/setup.bash
ros2_build_debug # or ros2_build_release
ros2_foxglove_bridge
To test the bridge with example data, open another terminal and download the test .mcap
files:
./download_test_data.sh
Then start playback:
source /opt/ros/humble/setup.bash
ros2 bag play -l --clock 100 -s mcap data/nuScenes-v1.0-mini-scene-0061-ros2.mcap
foxglove_bridge
is released with a MIT license. For full terms and conditions, see the LICENSE file.