better_launch.declarative module

better_launch.declarative.launch_toml(path: str, launch_args: dict[str, str] = None, *, ui: bool = None, colormode: Colormode = None, print_limit: int = 0, screen_log_level: str | int = None, screen_log_format: str = None, file_log_level: str | int = None, file_log_format: str = None, eval_mode: Literal['full', 'literal', 'none'] = 'literal', join: bool = None, manage_foreign_nodes: bool = None, keep_alive: bool = None, allow_kwargs: bool = None) None

Execute a TOML better_launch launchfile.

In better_launch TOML launchfiles, most tables will be call tables. A call table is a dict that has a func key referring to one of the public [BetterLaunch][] member functions. All other attributes will be treated as keyword arguments to that function. Call tables are executed in the order they appear in the launch file, and the result of calling their associated function will be stored under the call table’s name.

For example:

Substitutions are also possible and use a similar syntax as in ROS1 (as shown for the name launch argument above). if and unless conditions can be added as well.

All parameters below can be set through the launch file by declaring them on the global scope with a bl_ prefix (i.e. ui becomes bl_ui).

Please see the documentation for full details.

Parameters

pathstr

Path to the TOML launchfile to execute.

launch_argsdict[str, str], optional

values for launch arguments declared by the launchfile.

eval_modeLiteral["full", "literal", "none"], optional

How to treat eval substitutions.

uibool, optional

Whether to start the better_launch TUI. Superseded by the BL_UI environment variable and the –bl_ui_override argument.

allow_kwargsbool, optional

Whether additional launch arguments are allowed.

colormodeColormode, optional

Decides what colors will be used for: * default: one color per log severity level and a single color for all message sources * severity: one color per log severity, don’t colorize message sources * source: one color per message source, don’t colorize log severity * none: don’t colorize anything * rainbow: colorize log severity and give each message source its own color Superseded by the BL_COLORMODE environment variable and the –bl_colormode_override argument.

print_limitint, optional

Limit the length of messages printed to the screen.

screen_log_levelstr | int, optional

The minimum level for log messages to be printed to the terminal/screen. Can be either “info”, “warning”, “error”, “critical”, or an arbitrary integer (e.g. logging.WARNING).

screen_log_formatstr, optional

Customize how log output will be formatted when printing it to the screen. Will be overridden by the BL_SCREEN_LOG_FORMAT environment variable. See [PrettyLogFormatter][utils.better_logging.PrettyLogFormatter] for details.

file_log_levelstr | int, optional

The minimum level for log messages to be written to the lot file. Can be either “info”, “warning”, “error”, “critical”, or an arbitrary integer (e.g. logging.WARNING).

file_log_formatstr, optional

Customize how log output will be formatted when writing it to a file. Will be overridden by the BL_FILE_LOG_FORMAT environment variable. See [PrettyLogFormatter][utils.better_logging.PrettyLogFormatter] for details.

manage_foreign_nodesbool, optional

If True, the TUI will also include node processes not started by this process. Has no effect if the TUI is not started.

joinbool, optional

If True, join the better_launch process. Has no effect when ui == True.

keep_alivebool, optional

If True, keep the process alive even when all nodes have stopped.