Template Class BtActionNode
Defined in File bt_action_node.hpp
Inheritance Relationships
Base Type
public BT::ActionNodeBase
Class Documentation
Abstract class representing an action based BT node.
- Template Parameters:
ActionT – Type of action
Public Functions
A nav2_behavior_tree::BtActionNode constructor.
- Parameters:
xml_tag_name – Name for the XML tag for this node
action_name – Action name this node creates a client for
conf – BT node configuration
Create instance of an action client.
- Parameters:
action_name – Action name to create client for
Function to perform some user-defined operation on tick Could do dynamic checks, such as getting updates to values on the blackboard.
Function to perform some user-defined operation after a timeout waiting for a result that hasn’t been received yet. Also provides access to the latest feedback message from the action server. Feedback will be nullptr in subsequent calls to this function if no new feedback is received while waiting for a result.
- Parameters:
feedback – shared_ptr to latest feedback message, nullptr if no new feedback was received
Function to perform some user-defined operation upon successful completion of the action. Could put a value on the blackboard.
- Returns:
BT::NodeStatus Returns SUCCESS by default, user may override return another value
Function to perform some user-defined operation when the action is aborted.
- Returns:
BT::NodeStatus Returns FAILURE by default, user may override return another value
Function to perform some user-defined operation when the action is cancelled.
- Returns:
BT::NodeStatus Returns SUCCESS by default, user may override return another value
The main override required by a BT action.
- Returns:
BT::NodeStatus Status of tick execution
The other (optional) override required by a BT action. In this case, we make sure to cancel the ROS2 action if it is still running.
Public Static Functions
Any subclass of BtActionNode that accepts parameters must provide a providedPorts method and call providedBasicPorts in it.
- Parameters:
addition – Additional ports to add to BT port list
- Returns:
BT::PortsList Containing basic ports along with node-specific ports
Creates list of BT ports.
- Returns:
BT::PortsList Containing basic ports along with node-specific ports
Protected Functions
Function to check if current goal should be cancelled.
- Returns:
bool True if current goal should be cancelled, false otherwise
Function to send new goal to action server.
Function to check if the action server acknowledged a new goal.
- Parameters:
elapsed – Duration since the last goal was sent and future goal handle has not completed. After waiting for the future to complete, this value is incremented with the timeout value.
- Returns:
boolean True if future_goal_handle_ returns SUCCESS, False otherwise
Function to increment recovery count on blackboard if this node wraps a recovery.
Protected Attributes