betfsm_ros.LifeCycle

Bases: ServiceClient

ROS2 lifecycle (simplified):

stateDiagram-v2 direction LR classDef successClass fill:darkgreen,color:white classDef tickingClass fill:yellow,color:black classDef otherClass fill:darkorange,color:white classDef abortClass fill:darkred,color:white [*] --> unconfigured unconfigured --> inactive : CONFIGURE inactive --> active : ACTIVATE inactive --> unconfigured : CLEANUP inactive --> finalized : INACTIVE_SHUTDOWN active --> inactive : DEACTIVATE active --> finalized : ACTIVE_SHUTDOWN unconfigured --> finalized : UNCONFIGURED_SHUTDOWN

    class Transition(Enum):
        CONFIGURE              = 1
        CLEANUP                = 2
        ACTIVATE               = 3
        DEACTIVATE             = 4
        UNCONFIGURED_SHUTDOWN  = 5
        INACTIVE_SHUTDOWN      = 6
        ACTIVE_SHUTDOWN        = 7    
A ROS 2 node can take a while before reaching the desired state. These transitional states are not depicted here. Documentation of the full state machine can be found here

__init__(name, srv_name='/etasl_node', transition=Transition.ACTIVATE, timeout=Duration(seconds=1.0), node=None, always_succeed=False)

Parameters:
  • name (str) –

    instance name of the lifecycle action

  • srv_name (str, default: '/etasl_node' ) –

    name of the node whose lifecycle to control

  • transition (Transition, default: ACTIVATE ) –

    indicates which transition

  • timeout (Duration, default: Duration(seconds=1.0) ) –

    duration that indicates the timeout, 0 is forever

  • node (Node, default: None ) –

    if None, singleton BeTFSMNode.get_instance() will be used.

  • always_succeed

    if True, will always return SUCCEED or TICKING