Skip to main content

Viewing a Robot's ROS 2 Data in Foxglove and RViz

This guide shows how to look at a robot's live ROS 2 topics (point clouds, camera images, TF, diagnostics) from your own machine, with the robot's ROS 2 stack running as an Admiral workload. The recommended path is Foxglove Studio through EdgeWire port forwarding, which works from anywhere and publishes nothing on the robot's network.

ToolRemote path (any network)Same-LAN path
Foxglove Studiofoxglove_bridge in the workload, declared as an EdgeWire service and forwarded with admrl edgewire forward.Published port, or host network.
RViz2Not directly. DDS discovery does not cross a TCP forward; use Foxglove for remote viewing.Host networking, matching ROS_DOMAIN_ID and DDS implementation.

EdgeWire is in early access; contact Admiral to enable it for your organisation. See EdgeWire.


1. Add foxglove_bridge to the Workload​

The workload-ros2 starting point is a ROS 2 workload with a supervisor that starts your nodes, restarts them if they exit, and forwards shutdown signals. Its DEMO_MODE=custom setting runs whatever command you put in LAUNCH_COMMAND, so adding the bridge takes two changes to its Dockerfile.

Add the bridge package to the apt-get install list in the Dockerfile, next to the other ROS packages. The package name follows the ROS distribution of the base image:

"ros-${ROS_DISTRO}-rmw-cyclonedds-cpp" \
"ros-${ROS_DISTRO}-foxglove-bridge" && \

Then set the launch command. Replace ros2 run demo_nodes_cpp talker with your own launch file; the demo talker is only there so there is a topic to look at:

ENV DEMO_MODE=custom \
LAUNCH_COMMAND="ros2 run demo_nodes_cpp talker & exec ros2 launch foxglove_bridge foxglove_bridge_launch.xml port:=8765"

You can set DEMO_MODE and LAUNCH_COMMAND as environment variables in the configuration instead of in the image. The command must stay in the foreground; the supervisor restarts it if it exits. Publish the image with a new version tag for every change, as described in Configurations.

foxglove_bridge listens on TCP port 8765 unless you pass another port. It accepts any client that can reach that port, so use it on networks you trust.


2. Declare the Bridge as an EdgeWire Service​

Add the bridge's port to the workload configuration as a named service (see EdgeWire):

spec:
edgewire:
services:
- name: foxglove
protocol: tcp
port: 8765

Apply it with admrl edit configuration <name> or admrl apply -f, and roll it out to the device. You do not need to publish the port or switch to host networking; EdgeWire reaches the bridge inside the workload.


3. Forward the Port and Connect Foxglove Studio​

On your machine, forward the service to a local port:

admrl edgewire forward edge-1 foxglove 127.0.0.1:8765

Leave it running. Then in Foxglove Studio:

  1. Choose Open connection, then Foxglove WebSocket.
  2. Enter ws://127.0.0.1:8765.
  3. Add panels (3D, Image, Raw Messages, Plot) and pick topics. /chatter from the demo talker shows up in a Raw Messages panel.

The forward is opened per connection and the CLI reports whether the path is direct or relayed (press Enter for status). If the connection fails, see EdgeWire troubleshooting, and check from the workload that the bridge is running:

admrl exec edge-1 -- ps aux
admrl exec edge-1 -- ros2 topic list

The workload logs (Device > Logs) show the supervisor starting the bridge. If the image has no ps, use ros2 node list instead.

Foxglove only subscribes to the topics you open, so on a cellular or satellite link choose a few small topics and avoid raw point clouds and full-rate images.

On the same network, without EdgeWire​

If you are on the robot's network you can skip EdgeWire. Under Ports & network > Published ports add 8765, protocol tcp (or switch on Use the device's network directly, hostNetwork: true, which ignores the published ports list), then connect Foxglove to ws://<device address>:8765. The device's address is on its Network tab. foxglove_bridge accepts any client that can reach the port, so only do this on networks you trust. See Workload Network Modes.


4. Connect RViz2 (Same Network)​

RViz2 is a ROS 2 node, so it joins the robot's ROS 2 graph over DDS rather than through one port. EdgeWire forwards one named TCP or UDP service to one local port; DDS discovery relies on multicast and on peers opening their own connections, so it does not work across an EdgeWire forward, and Admiral does not provide a DDS bridge. To view the robot from another network, use Foxglove as above. To use RViz2 itself, run it on a machine on the robot's network, with the same ROS 2 distribution installed:

  1. In the configuration, switch on Use the device's network directly (hostNetwork: true). The default bridged network blocks DDS multicast discovery. See ROS 2 DDS Discovery & Multicast.
  2. Use the same ROS_DOMAIN_ID on the workload and on your machine (the workload-ros2 image defaults to 0).
  3. Use the same DDS implementation on both. workload-ros2 sets RMW_IMPLEMENTATION=rmw_cyclonedds_cpp.
  4. Start RViz2 on your machine and add displays for the topics you want. If the topics do not appear, check that your network allows UDP multicast between the two machines, or configure a unicast peer list; both work as on a bare Linux host. On a device with more than one network interface, workload-ros2 documents selecting one with CYCLONEDDS_URI.

RViz2 shows what DDS delivers, so large topics (point clouds, images) use real network bandwidth. For a robot on Wi-Fi or a cellular link, Foxglove with a few chosen topics is usually the lighter option.


Away from the Robot's Network​

Use EdgeWire as in sections 2 and 3. Other options:

  • Record on the robot, view later. Mount a Custom Volume at /data (see Custom Volumes) and record there:

    admrl exec amr-001 -- ros2 bag record -o /data/bags/run-1 /scan /tf

    Standard output passes through admrl exec, so you can stream the recording to your machine and open it in Foxglove:

    admrl exec amr-001 -- tar c -C /data/bags run-1 | tar x
  • Inspect topics from the command line with admrl exec amr-001 -- ros2 topic echo /chatter or ros2 topic hz /scan.

  • Your own network path, such as a site VPN, if you have one. That is outside Admiral.