Message Schemas

Lichtblick relies on structured message formats to ensure accurate data visualization and processing. By adhering to Lichtblick's schema standards, users can leverage the platform's robust visualization tools effectively.

Note on References to Foxglove

In some parts of the documentation and codebase, you may still encounter references to Foxglove or Foxglove packages. These references are remnants of Lichtblick's origins as a fork of the Foxglove project. While Lichtblick is actively working to remove dependencies on Foxglove code and replace these references, this effort is still ongoing.

We appreciate your patience as we continue to refine and align the platform with Lichtblick's independent development goals. If you have any questions or encounter issues related to these references, please reach out to our support team for assistance.

Supported Schema Formats

Lichtblick supports a variety of message formats, enabling seamless integration with diverse data sources. The supported formats include:

  • Protobuf
  • JSON Schema
  • ROS 1
  • ROS 2
  • TypeScript
  • FlatBuffers

If your existing message formats differ from these, Lichtblick provides tools to convert them into compatible schemas using a message conversion extension.

Working with Protobuf and JSON Schema

To use Protobuf or JSON Schema with Lichtblick, follow these steps:

  1. Protobuf: Include the necessary .proto files in your project. These files can be used to publish data via a WebSocket connection or log data into an MCAP file.
  2. JSON Schema: Similarly, copy the required .json schema files into your project.

Note on Protobuf Time Formats: When using google.protobuf.Timestamp or google.protobuf.Duration, Lichtblick represents time values with sec and nsec fields (instead of seconds and nanos). This ensures consistency across time and duration formats in user scripts, message converters, and other platform components.

For JSON Schema integration, you can import schemas directly using the @foxglove/schemas npm package:

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

Lichtblick also offers WebSocket libraries for real-time data handling in Python, JavaScript, and C++, as well as MCAP writers for logging pre-recorded datasets. For a practical example, refer to our blog post on Recording Robotic Data with MCAP, which demonstrates how to use the MCAP C++ writer to log Protobuf data.

Schemaless JSON Support

Lichtblick supports schemaless JSON messages through MCAP. To send JSON data without a schema:

  1. Set the channel's message encoding to json.
  2. Assign the schema ID as 0 to indicate no associated schema.

For more details, consult the MCAP Specification on Channels.

ROS Integration

Lichtblick provides dedicated ROS message packages for both ROS 1 and ROS 2. To integrate:

  1. Install the foxglove_msgs package:

  2. Install the appropriate package for your ROS version:

sudo apt install ros-noetic-foxglove-msgs # For ROS 1
sudo apt install ros-galactic-foxglove-msgs # For ROS 2
  1. Import the necessary schemas into your ROS project to begin publishing data:
from foxglove_msgs.msg import Vector2

...
msg = Vector2()
msg.x = 0.5
msg.y = 0.7

TypeScript Integration

Lichtblick schemas can be imported as TypeScript types, enabling type-checking and message validation. Here’s how to use them:

  1. In TypeScript Projects: Import types directly from the @foxglove/schemas npm package:
import { Point2 } from "@foxglove/schemas";

const myImage: Point2 = { x: 1, y: 2 };

These types are compatible with JavaScript WebSocket or MCAP projects and can be used when writing custom data transformation scripts within Lichtblick's User Scripts panel.