launch.action module

Module for Action class.

class launch.action.Action[source]

Bases: LaunchDescriptionEntity

LaunchDescriptionEntity that represents a user intention to do something.

The action describes the intention to do something, but also can be executed given a launch.LaunchContext at runtime.

__init__(*, condition: Condition | None = None) None[source]

Create an Action.

If the conditions argument is not None, the condition object will be evaluated while being visited and the action will only be executed if the condition evaluates to True.

Parameters:

condition – Either a Condition or None

property condition: Condition | None

Getter for condition.

describe() str[source]

Return a description of this Action.

describe_conditional_sub_entities() List[Tuple[str, Iterable[LaunchDescriptionEntity]]][source]

Override describe_conditional_sub_entities from LaunchDescriptionEntity.

describe_sub_entities() List[LaunchDescriptionEntity][source]

Override describe_sub_entities from LaunchDescriptionEntity.

execute(context: LaunchContext) List[LaunchDescriptionEntity] | None[source]

Execute the action.

Should be overridden by derived class, but by default does nothing.

get_sub_entities() List[LaunchDescriptionEntity][source]

Return subentities.

static parse(entity: Entity, parser: Parser)[source]

Return the Action action and kwargs for constructing it.

This is only intended for code reuse. This class is not exposed with expose_action.

visit(context: LaunchContext) List[LaunchDescriptionEntity] | None[source]

Override visit from LaunchDescriptionEntity so that it executes.