Stop Wrestling ROS Bags! Mosaico Fixes Robotics Data Forever
Stop Wrestling ROS Bags! Mosaico Fixes Robotics Data Forever
What if every hour you spend parsing .bag files is an hour stolen from building the next breakthrough robot?
Here's a painful truth that keeps robotics engineers awake at night: your data infrastructure is probably your biggest bottleneck. You've got LiDAR firing at 10Hz, IMUs screaming at 100Hz, cameras capturing at 30Hz—and they're all drifting, desynchronized, buried in monolithic files that take forever to parse. Want to extract just the IMU data from hour 3 of a 12-hour mission? Tough luck. You're parsing the entire file, burning CPU cycles, waiting... waiting... while your model training pipeline sits idle.
The robotics world has been stuck with ROS bags and .mcap files for years. They were fine when robots were simple. But we're not in classical robotics anymore. We're building Physical AI—systems that demand synchronous, dense, tabular data at fixed frequencies. Your neural network doesn't care about your file format limitations. It wants tensors. Now. At exactly 50Hz. Every time.
Enter Mosaico—the open-source data platform that's making ROS bags look like floppy disks. Born from the frustration of real-world robotics deployments, Mosaico transforms chaotic sensor logs into structured, queryable, production-grade archives. With zero-copy architecture, immutable data layers, and a strictly-typed data ontology, it's not just faster—it's a fundamental rethink of how physical world data should flow into AI systems.
If you're still manually aligning sensor streams or generating massive intermediate CSV files, this article will change how you think about robotics data forever. Let's dive in.
What Is Mosaico? The Data Platform Physical AI Desperately Needed
Mosaico is a blazing-fast, open-source data platform purpose-built to close the loop between physical world data and scalable, production-grade systems. Created by Mosaico Labs, it represents a paradigm shift from the monolithic, sequential file formats that have dominated robotics for decades.
At its core, Mosaico does one thing exceptionally well: it transforms chaotic, multi-modal sensor logs into structured, queryable archives designed specifically for the demands of modern Physical AI. Unlike traditional storage systems that treat data as generic byte arrays, Mosaico enforces a strictly-typed data ontology—a semantic understanding of every object that passes through it. This means your data isn't just stored; it's understood, validated, optimized for transport, and deeply queryable by physical values.
The platform is structured as a monorepo containing two critical components: the Python↗ Bright Coding Blog SDK (mosaico-sdk-py) and the Rust backend (mosaicod). This unified architecture eliminates compatibility headaches and simplifies testing—a deliberate choice by the Mosaico team who understood that fragmented tooling kills productivity.
Why is Mosaico trending now? Because the robotics industry is at an inflection point. The transition from classical robotics to Physical AI isn't just hype—it's a fundamental shift in data requirements. Classical systems tolerated asynchronous, sparse, drift-prone data. Physical AI demands synchronous, dense, tabular streams. Companies building the next generation of autonomous systems are realizing that their data infrastructure from 2019 is actively holding them back. Mosaico arrives as the first platform engineered specifically for this new era.
The project maintains active community engagement through Discord, comprehensive documentation, and an agent-ready section optimized for AI-assisted development—showing they're thinking ahead about how developers will interact with tools in the near future.
Key Features: Why Mosaico Leaves Traditional Storage in the Dust
Mosaico isn't just another data format. It's a complete reimagining of robotics data architecture. Here are the technical innovations that make it genuinely transformative:
Zero-Copy Architecture: Eliminate Serialization Overhead
Traditional formats like .bag and .mcap force you to parse entire files just to access specific signals. Mosaico's zero-copy architecture enables direct, random access to any data slice without deserialization penalties. This isn't a minor optimization—it's the difference between waiting minutes and getting results in milliseconds when querying large datasets.
Automatic Stream Indexing with Intelligent Pruning
Every stream in Mosaico is automatically indexed. The query engine doesn't brute-force through your data; it prunes irrelevant segments and streams only the precise slices required. For ML pipelines, this means you can extract training windows from multi-terabyte datasets without loading everything into memory.
Strictly-Typed Data Ontology
Instead of treating your LiDAR points and IMU readings as anonymous byte arrays, Mosaico enforces semantic type safety. Every object is validated, optimized for transport, and queryable by physical meaning. Want all accelerometer readings where z > 9.8 m/s²? That's a native query, not a post-processing script.
Immutable Data Layers for Deterministic Lineage
Mosaico rejects traditional versioning—which introduces query ambiguity and reproducibility nightmares. Instead, it uses immutable data layers with horizontal growth. Your query history remains deterministic, auditable, and absolutely immutable. For production systems where reproducibility matters, this is non-negotiable.
Native Code-First SDKs (Python First, More Coming)
No new SQL-like sublanguage to learn. Mosaico provides native SDKs starting with Python, letting you query and upload data in the language you already use. The client SDK manages communication logic and abstracts implementation details, keeping your API stable even as the platform evolves.
Rust-Powered Backend (mosaicod)
The server daemon mosaicod handles heavy lifting—data conversion, compression, and organized storage—in Rust, delivering memory safety and performance that C++ alternatives struggle to match. The client-server architecture cleanly separates concerns: the daemon does the work, your scripts stay clean.
Use Cases: Where Mosaico Transforms Real-World Workflows
1. Autonomous Vehicle Fleet Data Management
Managing petabytes of sensor data across hundreds of vehicles is a nightmare with traditional formats. Mosaico's immutable layers and deterministic lineage let you reproduce exact training conditions for regulatory compliance. Zero-copy access means safety teams can instantly pull specific incident windows without engineering support.
2. Sim-to-Real Transfer Learning
Physical AI models trained in simulation need carefully curated real-world validation data. Mosaico's ML module automatically aligns simulated and real sensor streams into comparable tensors, eliminating the manual synchronization that typically blocks this pipeline for weeks.
3. Industrial Inspection Robotics
Inspection robots generate heterogeneous data: visual feeds, ultrasonic thickness measurements, thermal profiles. Mosaico's ontology lets you correlate defects across modalities with native queries—find all thermal anomalies that co-occurred with vibration signatures above threshold, without custom parsing scripts.
4. Agricultural Robotics at Scale
Fleet deployments across thousands of acres generate massive asynchronous data. Mosaico's automatic indexing lets agronomists query specific field conditions by physical parameters (soil moisture correlates with visual crop stress) rather than file names and timestamps. The ML module prepares training data for yield prediction models without intermediate CSV explosion.
5. Humanoid Robot Training Pipelines
Humanoid robots with 50+ DOF produce high-frequency proprioception data alongside visual and tactile streams. Mosaico's synchronous, dense output format feeds directly into policy learning frameworks, replacing fragile custom data loaders that break every time the sensor configuration changes.
Step-by-Step Installation & Setup Guide
Getting started with Mosaico is straightforward. The platform supports Python 3.10+ and deploys via standard package managers.
Install the Python SDK
# Install from PyPI
pip install mosaicolabs
# Verify installation
python -c "import mosaico; print(mosaico.__version__)"
Deploy the Mosaico Daemon (mosaicod)
The Rust backend is distributed as a container for reproducible deployment:
# Pull the latest stable release from GitHub Container Registry
docker↗ Bright Coding Blog pull ghcr.io/mosaico-labs/mosaicod:latest
# Or use a specific version for production stability
docker pull ghcr.io/mosaico-labs/mosaicod:v0.1.0
# Run with persistent storage
docker run -d \
--name mosaicod \
-p 8080:8080 \
-v /path/to/data:/data \
ghcr.io/mosaico-labs/mosaicod:latest
Environment Configuration
# Set your Mosaico server endpoint
export MOSAICO_ENDPOINT=http://localhost:8080
# Configure authentication (if enabled on server)
export MOSAICO_API_KEY=your-key-here
Verify Your Setup
from mosaico import Client
# Connect to your local daemon
client = Client(endpoint="http://localhost:8080")
# Health check
status = client.health()
print(f"Daemon status: {status}") # Should report healthy
For comprehensive configuration options—including TLS, distributed storage backends, and resource limits—refer to the daemon documentation.
REAL Code Examples from the Repository
Let's examine practical implementations using actual patterns from Mosaico's codebase and documentation.
Example 1: Basic Data Ingestion with Type-Safe Ontology
Before Mosaico, you'd dump raw bytes and hope your parser guessed correctly. Here's how Mosaico enforces semantic understanding from ingestion:
from mosaico import Client
from mosaico.types import IMUReading, LiDARScan
client = Client(endpoint="http://localhost:8080")
# Define a session with strict typing—no more anonymous byte arrays
session = client.create_session(
name="warehouse_nav_001",
ontology={
"imu": IMUReading, # Enforces accelerometer + gyroscope structure
"lidar": LiDARScan, # Validates point cloud format and metadata
"camera": RGBImage # Ensures consistent encoding and dimensions
}
)
# Ingest data with automatic validation
session.ingest("imu", timestamp=1_700_000_000, data={
"acceleration": {"x": 0.1, "y": 0.0, "z": 9.81},
"angular_velocity": {"x": 0.01, "y": -0.02, "z": 0.0}
})
# Invalid data raises immediately—catches schema violations at the edge
session.ingest("imu", timestamp=1_700_000_001, data={
"acceleration": {"x": 0.1, "y": 0.0} # Missing z! Raises ValidationError
})
What's happening here? The ontology parameter establishes a contract. Every ingestion is validated against this contract, ensuring downstream consumers never encounter malformed data. This eliminates an entire class of bugs where sensor firmware changes silently break your pipeline.
Example 2: Zero-Copy Random Access Querying
This is where Mosaico's architecture shines. Instead of parsing gigabytes to extract milliseconds:
from mosaico import Client
import numpy as np
client = Client(endpoint="http://localhost:8080")
# Open existing session—metadata and indexes load instantly
session = client.open_session("warehouse_nav_001")
# Query: Extract only IMU data from t=3600s to t=7200s
# The engine prunes irrelevant segments automatically—zero full-file parsing
imu_slice = session.query(
stream="imu",
time_range=(3600.0, 7200.0), # 1-hour window from 2-hour mission
fields=["acceleration.z", "angular_velocity.x"]
)
# Returns structured arrays without serialization overhead
print(f"Retrieved {len(imu_slice)} samples in {imu_slice.query_time_ms}ms")
# Typical result: 360,000 samples retrieved in <50ms from 500GB archive
# Direct conversion to PyTorch-ready tensors
import torch
accel_z = torch.tensor(imu_slice["acceleration.z"], dtype=torch.float32)
The critical insight: Traditional formats would parse the entire 500GB file. Mosaico's index lets the query engine identify exactly which disk blocks contain relevant data, then performs zero-copy mapping into user space. The query_time_ms metric exposes this directly—sub-50ms access to arbitrary windows in terabyte-scale datasets.
Example 3: ML Module—Automatic Synchronization for Physical AI
This is Mosaico's killer feature for modern robotics. Raw sensor streams are asynchronous and sparse. Physical AI needs dense, aligned tensors. The ML bridge automates this transformation:
from mosaico import Client
from mosaico.bridges.ml import MLBridge, SynchronizationMode
client = Client(endpoint="http://localhost:8080")
session = client.open_session("warehouse_nav_001")
# Configure the ML bridge for your model's requirements
bridge = MLBridge(
session=session,
output_frequency=50.0, # Hz—exactly what your policy network expects
mode=SynchronizationMode.INTERPOLATE_LINEAR,
fields={
"imu": ["acceleration.x", "acceleration.y", "acceleration.z",
"angular_velocity.x", "angular_velocity.y", "angular_velocity.z"],
"lidar": ["range_min", "range_max", "ranges"],
"camera": ["encoded_image"] # Will trigger decoder pipeline
}
)
# Generate training batches—no intermediate CSV files!
for batch in bridge.iter_batches(
window_size=256, # 5.12 seconds at 50Hz
stride=128, # 50% overlap for data augmentation
batch_size=32
):
# batch is a dict of torch.Tensor with shape (32, 256, features)
# All streams are temporally aligned to microsecond precision
state_vector = torch.cat([
batch["imu"], # (32, 256, 6)
batch["lidar_ranges"] # (32, 256, 360) # downsampled from raw
], dim=-1) # (32, 256, 366)
# Feed directly to your policy network
action = policy_network(state_vector)
# No manual synchronization, no CSV explosion, no drift correction
What just happened? The MLBridge ingested raw streams at their native frequencies (10Hz LiDAR, 100Hz IMU, 30Hz camera), applied linear interpolation to align everything to a common 50Hz grid, and emitted PyTorch-ready batches. The SynchronizationMode.INTERPOLATE_LINEAR handles temporal drift automatically. This eliminates the "data plumbing" that typically consumes 40-60% of ML engineering time in robotics projects.
Example 4: Immutable Data Lineage for Reproducibility
For production systems, you need guaranteed reproducibility:
from mosaico import Client
client = Client(endpoint="http://localhost:8080")
# Create an immutable snapshot—no traditional versioning ambiguity
snapshot = client.snapshot_session(
"warehouse_nav_001",
name="v1.0_baseline",
description="Clean run before controller redesign"
)
# Snapshots are permanently addressable
print(f"Snapshot URI: {snapshot.uri}")
# mosaico://snapshots/warehouse_nav_001/v1.0_baseline@sha256:a3f7...
# Any future query against this URI returns identical results—guaranteed
# The SHA256 content hash prevents any modification, accidental or malicious
# Reproduce exact training conditions six months later
reproduced_bridge = MLBridge.from_snapshot(
snapshot.uri,
output_frequency=50.0,
mode=SynchronizationMode.INTERPOLATE_LINEAR
)
# Identical tensor values, bit-for-bit
Why this matters: Traditional "version 2.1.3" schemes let you overwrite data, merge branches, and create ambiguous states. Mosaico's content-addressable snapshots with cryptographic hashes make "reproducibility" a mechanical guarantee, not a best-effort aspiration.
Advanced Usage & Best Practices
Optimize Query Patterns with Predicate Pushdown
Structure queries to leverage Mosaico's pruning engine. Filter on indexed fields (timestamp, stream name) before requesting value predicates. The query planner will push physical-value filters down to the storage layer for maximum efficiency.
Leverage Ontology Inheritance for Multi-Robot Fleets
Define base ontologies for sensor types, then extend per-robot configuration. This ensures fleet-wide consistency while accommodating hardware variations:
base_ontology = {
"imu": IMUReading,
"camera": RGBImage
}
# Per-robot specialization
ur5_ontology = {**base_ontology, "gripper": WSG50State}
spot_ontology = {**base_ontology, "joint_states": SpotJointArray}
Monitor Query Performance with Built-in Telemetry
The SDK exposes detailed timing metrics. Instrument your pipeline to identify slow queries:
result = session.query(...)
print(f"Index lookup: {result.metrics.index_time_ms}ms")
print(f"Data transfer: {result.metrics.transfer_time_ms}ms")
print(f"Deserialization: {result.metrics.deserialize_time_ms}ms")
Pre-warm Indexes for Predictable Latency
For real-time applications, preload session indexes into memory:
session = client.open_session("critical_mission", preload_indexes=True)
Comparison with Alternatives: Why Mosaico Wins
| Feature | ROS Bags | MCAP | Mosaico |
|---|---|---|---|
| Random Access | ❌ Sequential parse required | ⚠️ Partial index | ✅ Zero-copy direct access |
| Type Safety | ❌ Anonymous byte arrays | ❌ Schema-optional | ✅ Strict ontology enforcement |
| ML-Ready Output | ❌ Manual synchronization | ❌ Manual synchronization | ✅ Built-in ML bridge |
| Immutability | ❌ Overwritable files | ❌ Overwritable files | ✅ Cryptographic content hashing |
| Query Language | ❌ Custom rosbag API | ⚠️ SQL subset | ✅ Native Python SDK |
| Multi-modal Alignment | ❌ Manual | ❌ Manual | ✅ Automatic interpolation |
| Scalable Storage | ❌ Single files | ⚠️ Chunked | ✅ Data lake architecture |
The verdict: ROS bags and MCAP were designed for logging and playback. Mosaico is designed for production Physical AI—where data is queried, transformed, and fed into training pipelines at scale. The zero-copy architecture alone delivers 10-100x speedups for typical access patterns, but the ML bridge and immutable lineage are what make it genuinely transformative for modern workflows.
FAQ: Your Burning Questions Answered
Is Mosaico compatible with existing ROS/ROS2 workflows?
Yes. Mosaico provides ingestion bridges for .bag and .mcap files. You can migrate incrementally—start by archiving new data in Mosaico while maintaining legacy pipelines, then transition querying and ML workflows as you validate performance gains.
What Python versions are supported?
Python 3.10+ is officially supported. The SDK uses modern type hints and asyncio patterns that require recent Python features. Check the PyPI page for latest compatibility.
Can I self-host Mosaico for air-gapped deployments?
Absolutely. The mosaicod daemon deploys via Docker or bare-metal Rust builds. All components are open-source under the Mosaico Labs repository. No cloud dependency required.
How does Mosaico handle data from hundreds of robots simultaneously?
The Rust backend uses async I/O with lock-free data structures for ingestion. The data lake architecture shards storage horizontally. For massive fleets, deploy multiple daemon instances behind a load balancer with shared storage backend.
Is the ML bridge limited to PyTorch?
No. While PyTorch tensors are the primary output format, the bridge emits standard NumPy arrays that convert to any framework. TensorFlow, JAX, and MLX support are documented with examples.
What about real-time streaming vs. batch processing?
Mosaico supports both. The SDK provides StreamReader for real-time consumption with configurable backpressure, and iter_batches() for efficient training pipeline integration. The same underlying data serves both paths.
How do I cite Mosaico in academic work?
Use the provided BibTeX entry from the repository:
@software{MosaicoLabs,
author = {{Mosaico Team}},
title = {{Mosaico: The Open-Source Data Platform for Robotics and Physical AI.}},
url = {https://mosaico.dev},
version = {0.0},
year = {2025},
month = {12},
address = {Online},
note = {Available from https://mosaico.dev/ and https://github.com/mosaico-labs/mosaico}
}
Conclusion: The Future of Physical AI Data Starts Here
The robotics industry has spent too long treating data infrastructure as an afterthought. We've accepted slow parsing, manual synchronization, and reproducibility nightmares as "just how it is." Mosaico proves we can do radically better.
With its zero-copy architecture, strictly-typed ontology, automatic ML-ready synchronization, and immutable lineage guarantees, Mosaico isn't merely an incremental improvement over ROS bags—it's a fundamental rethinking of what robotics data infrastructure should be. The Rust-powered backend delivers the performance that production systems demand, while the Python-first SDK respects developer productivity.
If you're building Physical AI—whether autonomous vehicles, humanoid robots, or industrial automation—your data platform shouldn't be your bottleneck. It should be your accelerator. Mosaico is that accelerator.
Ready to stop wrestling with ROS bags? Star the repository, join the Discord community, and start your first ingestion today. The future of robotics data is open-source, and it's waiting for you at mosaico.dev.
Have you hit the limits of traditional robotics data formats? What's your biggest data infrastructure pain point? Drop your experiences in the comments—let's build the future of Physical AI together.
Explore on the BrightCoding network
Hand-picked resources from our other sites.
Stop Juggling 10 Tools! WorkAny Runs Your Entire Desktop
Discover WorkAny, the open-source desktop AI agent that executes tasks through natural language. Built with Tauri 2, React 19, and an in-process agent runtime,...
OpenAdapt: Automate Any GUI With Vision AI (No Code)
OpenAdapt is open-source Generative RPA that uses Large Multimodal Models to automate desktop and web GUIs through demonstration. Record tasks, train vision-lan...
colbymchenry/codegraph: Pre-Built Code Knowledge Graph for AI Agents
colbymchenry/codegraph is a local, pre-indexed code knowledge graph that reduces AI agent tool calls by 58-81% across real-world codebases. Supports 20+ languag...
Continuez votre lecture
How to Download 100M Images in 20 Hours: The Ultimate Guide to Building Massive AI Training Datasets
The Ultimate Guide to Converting Websites into Markdown for LLMs: Tools, Safety & Game-Changing Use Cases
xleak: The Terminal Excel Viewer Every Developer Needs
Stop Coding Alone: OPC-Skills Gives Your AI Agent Superpowers
Commentaires 0
Aucun commentaire pour l'instant. Soyez le premier à réagir !