Building Synthetic Training Data Pipelines for Robotics
Real robot data collection is slow and expensive — every demonstration costs operator time and robot hours. Synthetic data pipelines let you generate large volumes of labeled training data programmatically, using simulation, domain randomization, and procedural task generation. This final tutorial in the series covers how to build one. Why Synthetic Data, and Where It Fits Synthetic data isn't a…
Real robot data collection is slow and costly, requiring operator time and robot hours. Synthetic data pipelines enable the generation of large volumes of labeled training data programmatically, leveraging simulation, domain randomization, and procedural task generation. This final tutorial in the series details the process of constructing such a pipeline.
Synthetic data does not replace real demonstrations; instead, it acts as a force multiplier. A typical modern pipeline combines a smaller number of real demonstrations, gathered through teleoperation and capture pipelines, with a large amount of synthetic/simulated data for coverage and scale. Domain randomization further enhances the usefulness of synthetic data for real-world transfer.
The pipeline begins with procedural scene generation, where scenes are not hand-authored but generated automatically. The system uses object counts, positions, and combinations to create varied scenes. In Python, the `numpy` and `random` libraries are employed to define an object library and generate scene configurations. The `generate_scene_config()` function determines the number of objects and their positions within workspace bounds, while random choices from the object library assign types, colors, and scales to each object. This function returns a dictionary containing the configured objects.
The second step involves building scenes from these configurations and translating them into the simulator's scene format. For MuJoCo, this entails generating MJCF XML dynamically. The `build_mjcf_scene()` function reads a base scene XML file, creates object XML blocks based on the scene configuration, and writes the combined XML to an output file. This allows the simulator to render the generated scenes accurately.
The third step introduces labeled trajectories generated through a scripted policy for tasks like pick-and-place, pushing, and stacking. Instead of relying on a human operator to create expert trajectories, a scripted controller automates this process, significantly increasing scalability. The `scripted_pick_and_place()` function demonstrates this approach, resetting the environment, computing waypoints for object manipulation, and returning a trajectory list. This script can then be used to generate the necessary labeled data for training robotics models.
Rewritten by urgent.news; may contain errors — check the original.
Source: dev.to