15 #ifndef NAV2_BEHAVIOR_TREE__PLUGINS__ACTION__CHECK_STOP_STATUS_ACTION_HPP_
16 #define NAV2_BEHAVIOR_TREE__PLUGINS__ACTION__CHECK_STOP_STATUS_ACTION_HPP_
21 #include "nav2_ros_common/lifecycle_node.hpp"
22 #include "behaviortree_cpp/action_node.h"
23 #include "behaviortree_cpp/json_export.h"
24 #include "nav_msgs/msg/odometry.hpp"
25 #include "nav2_util/odometry_utils.hpp"
26 #include "nav2_behavior_tree/bt_utils.hpp"
27 #include "nav2_behavior_tree/json_utils.hpp"
29 using namespace std::chrono_literals;
31 namespace nav2_behavior_tree
51 const std::string & xml_tag_name,
52 const BT::NodeConfiguration & conf);
61 BT::RegisterJsonDefinition<std::chrono::milliseconds>();
64 BT::InputPort<double>(
65 "velocity_threshold", 0.01,
66 "Velocity threshold below which robot is considered stopped"),
67 BT::InputPort<std::chrono::milliseconds>(
68 "duration_stopped", 1000,
69 "Duration (ms) the velocity must remain below the threshold"),
77 void halt()
override {}
82 BT::NodeStatus tick()
override;
84 double velocity_threshold_;
85 std::chrono::milliseconds duration_stopped_;
86 rclcpp::Time stopped_stamp_;
87 std::shared_ptr<nav2_util::OdomSmoother> odom_smoother_;
88 nav2::LifecycleNode::SharedPtr node_;
A nav2_behavior_tree::ActionNodeBase class that checks if the robot has been stopped for a specified ...
static BT::PortsList providedPorts()
Creates list of BT ports.