Nav2 Navigation Stack - humble  humble
ROS 2 Navigation Stack
Public Member Functions | Static Public Member Functions | List of all members
nav2_behavior_tree::IsStuckCondition Class Reference

A BT::ConditionNode that tracks robot odometry and returns SUCCESS if robot is stuck somewhere and FAILURE otherwise. More...

#include <nav2_behavior_tree/include/nav2_behavior_tree/plugins/condition/is_stuck_condition.hpp>

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

Public Member Functions

 IsStuckCondition (const std::string &condition_name, const BT::NodeConfiguration &conf)
 A constructor for nav2_behavior_tree::IsStuckCondition. More...
 
 ~IsStuckCondition () override
 A destructor for nav2_behavior_tree::IsStuckCondition.
 
void onOdomReceived (const typename nav_msgs::msg::Odometry::SharedPtr msg)
 Callback function for odom topic. More...
 
BT::NodeStatus tick () override
 The main override required by a BT action. More...
 
void logStuck (const std::string &msg) const
 Function to log status when robot is stuck/free.
 
void updateStates ()
 Function to approximate acceleration from the odom history.
 
bool isStuck ()
 Detect if robot bumped into something by checking for abnormal deceleration. More...
 

Static Public Member Functions

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

Detailed Description

A BT::ConditionNode that tracks robot odometry and returns SUCCESS if robot is stuck somewhere and FAILURE otherwise.

Definition at line 33 of file is_stuck_condition.hpp.

Constructor & Destructor Documentation

◆ IsStuckCondition()

nav2_behavior_tree::IsStuckCondition::IsStuckCondition ( const std::string &  condition_name,
const BT::NodeConfiguration &  conf 
)

A constructor for nav2_behavior_tree::IsStuckCondition.

Parameters
condition_nameName for the XML tag for this node
confBT node configuration

Definition at line 25 of file is_stuck_condition.cpp.

References onOdomReceived().

Here is the call graph for this function:

Member Function Documentation

◆ isStuck()

bool nav2_behavior_tree::IsStuckCondition::isStuck ( )

Detect if robot bumped into something by checking for abnormal deceleration.

Returns
bool true if robot is stuck, false otherwise

Definition at line 124 of file is_stuck_condition.cpp.

Referenced by updateStates().

Here is the caller graph for this function:

◆ onOdomReceived()

void nav2_behavior_tree::IsStuckCondition::onOdomReceived ( const typename nav_msgs::msg::Odometry::SharedPtr  msg)

Callback function for odom topic.

Parameters
msgShared pointer to nav_msgs::msg::Odometry::SharedPtr message

Definition at line 61 of file is_stuck_condition.cpp.

References updateStates().

Referenced by IsStuckCondition().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ providedPorts()

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

Creates list of BT ports.

Returns
BT::PortsList Containing node-specific ports

Definition at line 84 of file is_stuck_condition.hpp.

◆ tick()

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

The main override required by a BT action.

Returns
BT::NodeStatus Status of tick execution

Definition at line 75 of file is_stuck_condition.cpp.

References logStuck().

Here is the call graph for this function:

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