AutoAPMS
Streamlining behaviors in ROS 2
Loading...
Searching...
No Matches
LifecycleGetState Class Reference

Retrieves the current lifecycle state of a ROS 2 managed node. More...

Inheritance diagram for LifecycleGetState:

Additional Inherited Members

- Public Member Functions inherited from RosServiceNode< lifecycle_msgs::srv::GetState >
 RosServiceNode (const std::string &instance_name, const Config &config, Context context)
 Constructor.
 
virtual BT::NodeStatus onResponseReceived (const typename Response::SharedPtr &response)
 Callback invoked after the service response was received.
 
virtual BT::NodeStatus onFailure (ServiceNodeErrorCode error)
 Callback invoked when one of the errors in ServiceNodeErrorCode occur.
 
bool createClient (const std::string &service_name)
 Create the client of the ROS 2 service.
 
std::string getServiceName () const
 Get the name of the service this node connects with.
 
- Static Public Member Functions inherited from RosServiceNode< lifecycle_msgs::srv::GetState >
static BT::PortsList providedBasicPorts (BT::PortsList addition)
 ADerived nodes implementing the static method RosServiceNode::providedPorts may call this method to also include the default port for ROS 2 behavior tree nodes.
 
static BT::PortsList providedPorts ()
 If a behavior tree requires input/output data ports, the developer must define this method accordingly.
 

Detailed Description

Retrieves the current lifecycle state of a ROS 2 managed node.

The targeted node's service name is constructed from the 'node' input port as '<node>/get_state'. The numeric state ID and its human-readable label are written to the respective output ports.

State IDs are defined in lifecycle_msgs/msg/State: UNKNOWN=0, UNCONFIGURED=1, INACTIVE=2, ACTIVE=3, FINALIZED=4

Definition at line 39 of file lifecycle_nodes.cpp.


The documentation for this class was generated from the following file: