<name>.launch.yaml.
File structure overview
A launch file is a YAML document with an optional Jinja2-rendered section. When the file declares arguments, it uses two YAML documents separated by---: the first document holds the args block, and the second document holds the templated launch content.
Top-level fields
A map of unit instance names to unit definitions. Units declared at the top level are grouped into a single default process named
/.Reserved top-level process grouping. In practice, use
groups to define processes and nest units within them.A map of group names to group definitions. Each group can optionally run as a separate OS process. Groups may contain
units, nested groups, and include directives.Optional recording configuration. See RecordingSettings.
Include and merge one or more other launch files into the current scope. See Includes.
Unit definition
Each key underunits is an arbitrary instance name for the unit within its process. The value is an object with the following fields.
The unit type name. This must match the name of the compiled unit shared object (
.unit.so) found in /opt/basis/unit/. When omitted, the instance name is used as the type name.A map of argument key–value pairs passed to the unit at startup. Values are passed as strings and parsed by the unit’s generated argument parser.
When
unit is omitted and the instance name matches the binary name exactly, no additional configuration is required. An empty map {} is a valid unit definition.Group definition
Groups map directly to unit definitions but add process isolation and nesting support.Units to run within this group. Same structure as top-level
units.Nested sub-groups. Sub-groups inherit the parent process unless
process: true is set.When
true, this group spawns as a separate OS process. When false or omitted, units are merged into the parent process.RecordingSettings
Therecording block configures the built-in .mcap recorder.
When
true (the default), recording is performed asynchronously to avoid blocking the transport layer.Base filename for the recording. The final filename appended with the process name and a timestamp:
<name><process>_<timestamp>.mcap.List of glob patterns selecting which topics to record. Topics not matching any pattern are excluded.
Path to the directory where recording files are written.
Templating
Launch files support Inja (a Jinja2-compatible) template syntax in all YAML values in the second document. Templating is evaluated before YAML parsing.Arguments block
Declare arguments in the first YAML document underargs. The same sub-fields as unit YAML args apply.
Accessing argument values
Use{{args.<name>}} to interpolate argument values anywhere in the second document.
Simulation flag
Thesim variable is automatically set to true when the launcher is started with --sim.
Conditional blocks
Standard Jinja2if / else if / endif directives are supported.
Process flag from template
Theprocess field of a group can be driven by a template expression, allowing callers to choose whether a group gets its own process:
Includes
Useinclude to compose launch files. Included processes are merged into the current launch definition; units from the included file’s root process (/) are merged into the current group.
Map syntax (most common)
Sequence syntax (include the same file more than once)
Scoped include inside a group
Include paths are resolved relative to the directory of the file containing the
include directive. Recursive includes are supported up to a depth of 32.