something.launch.yaml) that tells Basis which units to start, which processes to group them into, and optionally how to record their topics. Launch files support Jinja2 templating so you can parameterize them at runtime without modifying their content.
Core data structures
The launch system parses a.launch.yaml file into three nested C++ structs defined in cpp/launch/include/basis/launch/launch_definition.h.
unit_type (the shared library to load), and an optional list of --key value argument pairs forwarded to the unit at startup.
Basic structure
A minimal launch file groups units under named groups. Each group becomes a process by default.my_robot.launch.yaml
perception and control — each containing the named units.
Unit entries
Underunits, each key is the unit’s instance name within the process. The value is an optional map:
| Key | Description |
|---|---|
unit | Override the unit type (shared library name to load). Defaults to the instance name. |
args | Map of argument name → string value, forwarded as --name value to the unit. |
unit is omitted, the instance name is used as the unit type: a unit named stereo_match loads stereo_match.unit.so.
Process splitting
By default, all units inside agroups entry share one process. To force a group into its own separate process, set process: true:
process: true each become an independent process. Groups without the flag share the parent’s process.
Recording settings
Add arecording block at the top level to record topics to an MCAP file while the launch is running.
| Field | Type | Default | Description |
|---|---|---|---|
directory | string | — | Directory where the MCAP file is written. |
name | string | "basis" | Base name of the output file. |
async | boolean | true | When true, serialization happens off the hot path on a background thread. |
topics | string[] | — | Glob patterns for topics to record. Each pattern is converted to a regex. |
RecordingSettings struct in C++:
Jinja2 templating
Launch files are rendered through the Inja template engine (a C++ Jinja2-compatible implementation) before being parsed as YAML. This lets you use conditionals, loops, and variable interpolation.Arguments block
To declare typed arguments for a launch file, add anargs document before the main content, separated by a YAML document marker (---):
my_pipeline.launch.yaml
args block) is parsed without Jinja2. The second document (the main content) is rendered as a Jinja2 template with args available as a JSON object.
LaunchContext variables
Inside the template the following variables are available:
| Variable | Type | Description |
|---|---|---|
args.<name> | matches declared type | The parsed value of each declared argument. |
LaunchContext:
sim is intended for simulation mode overrides. process_filter can be used to restrict which processes are started (e.g. when re-using a launch file across environments).
Topic name templating
Topic names inside unit YAML files (not launch files) also support{{ }} expressions evaluated against the unit’s declared args. A launch file supplies the values:
stereo.unit.yaml:
/front/left.
Include directives
A launch file can include other launch files. Included content is merged into the current launch definition.include can also appear inside a groups entry, merging the included file’s units into that group’s process:
Recursion limit
The parser tracks include depth and hard-codes a maximum of 32 levels of recursion. Exceeding this limit is a fatal error:Complete example
robot.launch.yaml
Next steps
Unit YAML reference
Declare inputs, outputs, and sync for each unit
Code generation
Build and install unit shared libraries
Recording and replay
Details on MCAP recording and the recording settings API
Units
How units are loaded and initialized at runtime