Introducing Foxglove Schemas to Visualize Non-ROS Data

Write messages in the JSON or Protobuf format for easy visualization in Foxglove Studio

Esther Weon 3 min read
Published

While Foxglove Studio was originally designed for visualizing ROS data, we are on a mission to bring world-class visualization to all robots, including those with custom software frameworks.

Today, we're excited to announce Foxglove schemas: an entirely Foxglove-native way to represent and visualize data. Foxglove schemas are available for Protobuf, JSON, ROS 1, and ROS 2, and we plan to add support for more formats over time.

Becoming more framework-agnostic

We announced the MCAP log file format earlier this year, as an important milestone towards our goal of developing framework-agnostic robotics tools. However, even with MCAP, Foxglove Studio still required the use of existing ROS schemas such as sensor_msgs/Image or visualization_msgs/Marker to visualize certain data.

Our new Foxglove schemas have no dependency on ROS, and can be used from any framework. We also plan to continue fully supporting the existing ROS schemas as we do today.

Foxglove Studio panels

Studio’s Image panel now supports foxglove.CompressedImage in addition to ROS’s sensor_msgs/Image. The 3D panel now supports foxglove.PointCloud in addition to ROS’s sensor_msgs/PointCloud2.

To see a full list of our supported schemas, as well as the Foxglove Studio panels that use them, check out our schemas documentation.

Start writing your messages

To start publishing messages that adhere to the new Foxglove schemas, import the desired schema files for your framework.

Protobuf

Copy the .proto files directly from the foxglove/schemas repo into your project. You can use these imported schemas to publish messages via a live Foxglove WebSocket connection or to log data to an MCAP file.

We provide WebSocket libraries for live data (Python, JavaScript, C++), as well as MCAP writers for pre-recorded data files (Python, JavaScript, C++).

Check out our blog post on Recording Robocar Data with MCAP for an example on using an MCAP C++ writer to record your Protobuf data.

JSON Schema

Copy the .json files directly from the foxglove/schemas repo into your project, or import them from the @foxglove/schemas npm package:

import { CompressedImage } from "@foxglove/schemas/jsonschema";

Use these imported schemas to publish messages via a live Foxglove WebSocket connection or to log data to an MCAP file. We provide WebSocket libraries for live data (Python, JavaScript, C++), as well as MCAP writers for pre-recorded data files (Python, JavaScript, C++).

ROS 1 & 2

We’re in the process of publishing ROS packages for Foxglove schemas. After the next ROS sync, it will be as simple as running sudo apt install ros-humble-foxglove-msgs (replacing humble with your preferred ROS distribution).

In the meantime, you can copy .msg files directly from the ros1/ or ros2/ folder in foxglove/schemas into your ROS project, then importing these schemas wherever you want to start publishing messages:

from foxglove_msgs.msg import Vector2

TypeScript (bonus)

We also provide type definitions for Foxglove schemas for use in Foxglove Studio’s User Scripts panel, or your own TypeScript project.

For User Scripts, you can specify the schema you want to use with Message<"foxglove.[SchemaName]">:

import { Input, Message } from "./types";

type Output = Message<"foxglove.Point2">;

export const inputs = ["/input/topic"];
export const output = "/studio_script/output_topic";

export default function script(event: Input<"/input/topic">): Output {
  return { x: 1, y: 2 };
}

For your own TypeScript project, you can import the type from the @foxglove/schemas npm package:

import { CompressedImage } from "@foxglove/schemas";

Leverage the full potential of Foxglove Studio

We developed Foxglove Studio to advance the state of the art in open source robotics. MCAP was our first step towards visualizing general-purpose robotics data, and Foxglove schemas are a continuation of that vision. We want to make it easy for all robotics teams, regardless of framework, to get data into Studio and take full advantage of our tools.

Explore all Foxglove schemas via our docs or the foxglove/schemas GitHub repo. As always, join our Slack community to ask questions, or reach out to us directly with any feedback.

This post was last edited on for accuracy.


Read more:

Importing Your ROS 2 Data Into Foxglove Data Platform
tutorial
ROS
data platform
MCAP
Importing Your ROS 2 Data Into Foxglove Data Platform

How to convert your ROS 2 files into MCAP files.

Esther Weon

Esther Weon

5 min read
Installing ROS 1 Noetic on Ubuntu
tutorial
ROS
Installing ROS 1 Noetic on Ubuntu

Downloading Debian packages to set up ROS on your Linux machine.

Esther Weon

Esther Weon

5 min read

Get blog posts sent directly to your inbox.

Ready to get started?Download today on Linux, Windows, or macOS.