Mosaico 0.8.0: LeRobot Datasets, Aggregated Queries, and Hooks
Mosaico 0.8 imports LeRobot datasets from the CLI, adds aggregators to the query engine, and introduces hooks. 0.9.0, out this week before the hackathon, adds LeRobot export.
Mosaico 0.8 is out. It imports LeRobot datasets from the CLI, adds aggregators to the query engine, and introduces hooks. It also has breaking changes, covered in Upgrading. The full changelog is in the release notes.
LeRobot Datasets
mosaico inject lerobot imports a LeRobot v3.0 dataset and creates one sequence per episode.
As an example, take PushT, a simulated task from the Diffusion Policy paper: an agent pushes a T-shaped block until it covers a target. Its LeRobot dataset, lerobot/pusht_image, has 206 human demonstrations recorded at 10 fps, with a 96×96 top-down image, the agent position and the action at every frame. Imported with --name pusht, it becomes the sequences pusht_episode_000000 to pusht_episode_000205. On a local mosaicod, the import takes about ten seconds.
Video features are skipped for now, which is why the example uses the version of the dataset that stores frames as images.
The ROS and MCAP bridges moved into the same CLI. Every command takes the server address from the active profile.
mosaico inject ros --name drive_0423 ./bags/drive_0423.mcap
mosaico inject mcap --name arm_run_17 ./recordings/arm_run_17.mcap
mosaico inject lerobot --name pusht ./datasets/pushtmosaico extract ros drive_0423
mosaico extract mcap arm_run_17The options are in the CLI reference.
Aggregators
Before 0.8, a query matched a topic when at least one sample satisfied the condition. Aggregators compute one value per topic, such as the maximum, the mean or the sampling rate, and test the condition on that value. The computation runs on the server.
QueryOntologyCatalog(
IMU.Q.acceleration.x.rate().between(190, 210), # Sampled at about 200 Hz
IMU.Q.acceleration.x.max().lt(15.0), # Never above 15 m/s²
IMU.Q.acceleration.x.count_valid().gt(59_400), # At most 1% invalid samples
)The aggregators guide lists them all.
Hooks
A hook is a URL that mosaicod calls when an upload finishes. Register one with mosaicod hook create <url> and receive the events in Python with HookServer:
@hook
def on_event(e: Event):
if isinstance(e, SessionUploaded):
print(f"{len(e.topics)} topics uploaded to {e.sequence_name}")Any HTTP server can receive the events. The hooks guide has two full examples.
Other Changes
TopicWriter.push_batch()writes an Arrow record batch in one call.- S3 credentials are optional, so
mosaicodcan use IAM instance roles. mosaicodchecks numeric and object store settings at startup.
Upgrading to Mosaico 0.8
The wire protocol now uses Protobuf, so mosaicod and the Python SDK must be upgraded together. list_flights is now paginated.
Aggregators need statistics that 0.7 didn’t store, so run the store optimizer once after the upgrade. A topic doesn’t show up in ontology queries until the optimizer has rewritten it.
mosaicod store-optimizerThe migration guide has the details.
A New Release Cycle
0.8 comes six weeks after 0.7 because we changed the release cycle and rebuilt the release pipeline. From now on, mosaicod, the SDK and the docs ship together every week, under one version, from one signed tag on main. Any weekly release can include breaking changes. The details are in the release cycle documentation.
What’s Next
Our hackathon, Physical Education Vol. 1, runs in Milan from November 27 to 29. Before it starts, we’ll release 0.9.0 with mosaico extract lerobot, which writes Mosaico sequences back to a LeRobot dataset. With it, you can import episodes, select them with a query, and export the result to train on, without leaving the CLI.
Questions and bug reports go to GitHub Discussions, or bring them to the hackathon.
Ready to tame
your data chaos?
Join disruptive companies and robotics leaders.
Start building with Mosaico in minutes.
Open source · Deploy in< 5 min