Nav2 Navigation Stack - rolling  main
ROS 2 Navigation Stack
Public Member Functions | Static Public Member Functions | List of all members
nav2_behavior_tree::LogAction Class Reference

A BT::SyncActionNode that logs a message through the BT navigator's ROS logger. More...

#include <nav2_behavior_tree/include/nav2_behavior_tree/plugins/action/log_action.hpp>

Inheritance diagram for nav2_behavior_tree::LogAction:
Inheritance graph
[legend]
Collaboration diagram for nav2_behavior_tree::LogAction:
Collaboration graph
[legend]

Public Member Functions

 LogAction (const std::string &name, const BT::NodeConfiguration &config)
 A constructor for nav2_behavior_tree::LogAction. More...
 
BT::NodeStatus tick () override
 Logs the input message at the specified level using the blackboard's node. More...
 

Static Public Member Functions

static BT::PortsList providedPorts ()
 Creates list of BT ports. More...
 

Detailed Description

A BT::SyncActionNode that logs a message through the BT navigator's ROS logger.

Usage in XML:

<Log level="INFO" message="Starting recovery"/>

Definition at line 33 of file log_action.hpp.

Constructor & Destructor Documentation

◆ LogAction()

nav2_behavior_tree::LogAction::LogAction ( const std::string &  name,
const BT::NodeConfiguration &  config 
)
inline

A constructor for nav2_behavior_tree::LogAction.

Parameters
nameName for the XML tag for this node
configBT node configuration

Definition at line 41 of file log_action.hpp.

Member Function Documentation

◆ providedPorts()

static BT::PortsList nav2_behavior_tree::LogAction::providedPorts ( )
inlinestatic

Creates list of BT ports.

Returns
BT::PortsList Containing the required level and message input ports

The level must be DEBUG, INFO, WARN, ERROR, or FATAL. The message is the text to log.

Definition at line 50 of file log_action.hpp.

◆ tick()

BT::NodeStatus nav2_behavior_tree::LogAction::tick ( )
override

Logs the input message at the specified level using the blackboard's node.

Returns
BT::NodeStatus::SUCCESS if the message is logged, or BT::NodeStatus::FAILURE if a required input is missing or the log level is invalid

Definition at line 23 of file log_action.cpp.


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