How foxglove/foxglove-sdk works
Project Type & Purpose
• The project is an open-source SDK designed for logging and visualizing multimodal data.
• Its core is implemented in Rust, with language-specific bindings and packages available for Python and (upcoming) C, C++, and ROS integrations.
• It provides support for live data visualizations via a WebSocket protocol and logging data to MCAP files.
• Multiple schema definitions (in Flatbuffer, Protobuf, JSON Schema, OMG IDL, and ROS message formats) are part of the project, ensuring wide compatibility.
File Structure to Identify Main Components
• Language-Specific Roots:
– “rust/foxglove”: This directory forms the core SDK implementation (modules for channels, schemas, mcap writing, websockets, etc.).
– “python/foxglove-sdk”: The Python binding/wrapper that gives Python users access to the Rust SDK’s capabilities.
– “cpp” and “c”: These directories provide C/C++ examples and tools (including build scripts, examples like quickstart and ws-server) for integration with native applications.
– “ros/foxglove_msgs”: Contains ROS message definitions to integrate with ROS ecosystems.
– “typescript/schemas”: Provides schema definitions for TypeScript projects.
• Schema Definitions:
– “schemas”: The raw schema definitions are provided for various serialization formats—important for visualizing supported data structures.
• Supporting and Utility Directories:
– “.github”, “scripts”, and configuration files support CI/CD, automated tests, and schema generation.
a. Core SDK Layer (Rust):
– Represent the Rust “foxglove” core as the heart of the system.
– Within it, illustrate key modules such as:
• Channel & Data Flow Management
• MCAP Writer (for logging data)
• WebSocket Communication (live data visualization)
• Schema Management (handling multiple schema types)
b. Language Bindings & User Interfaces:
– Python Package:
• Python “foxglove-sdk” wrapper that exposes the core functionalities.
– C/C++ Components:
• “c” and “cpp” directories as example integrations or additional interface layers.
– ROS Integration:
– TypeScript Package:
• “@foxglove/schemas” package that enables TypeScript projects to use the predefined schema definitions.
c. Data Flow & External Interactions:
– Show data logging paths where data can be written to MCAP files.
– Mark external dependencies/libraries (e.g., Flatbuffer, Protobuf, JSON Schema processing libraries) that support serialization and schema conversion.
d. Architectural Patterns and Design Principles:
– Highlight the separation of core functionality (in Rust) from various binding layers.
– Indicate modularity in schema support (different directories for Flatbuffer, JSON, OMG IDL, etc.).
– Emphasize test and example components to illustrate extensibility and validation of the SDK.