launch.actions.declare_boolean_launch_argument module

Module for the DeclareBooleanLaunchArgument action.

class launch.actions.declare_boolean_launch_argument.DeclareBooleanLaunchArgument[source]

Bases: DeclareLaunchArgument

Action that declares a new boolean launch argument.

This is a bit of syntactic sugar for launch.actions.DeclareLaunchArgument that sets the choices to be either true or false (caps-insensitive)

>>> ld = LaunchDescription([
...     DeclareBooleanLaunchArgument('simple_argument'),  # default value is False
...     DeclareBooleanLaunchArgument('with_default_value', default_value=True),
...     # other actions here, ...
... ])
<launch>
    <bool_arg name="simple_argument"/>
    <bool_arg name="with_default_value" default_value="true"/>
</launch>
__init__(name: str, *, default_value: str | Path | Substitution | Iterable[str | Path | Substitution] | bool | None = None, **kwargs: Any) None[source]

Create a DeclareBooleanLaunchArgument action.

classmethod parse(entity: Entity, parser: Parser) Tuple[Type[DeclareBooleanLaunchArgument], Dict[str, Any]][source]

Parse bool_arg tag.