18 #include "nav2_behavior_tree/plugins/action/back_up_action.hpp"
20 namespace nav2_behavior_tree
24 const std::string & xml_tag_name,
25 const std::string & action_name,
26 const BT::NodeConfiguration & conf)
27 :
BtActionNode<nav2_msgs::action::BackUp>(xml_tag_name, action_name, conf)
30 getInput(
"backup_dist", dist);
32 getInput(
"backup_speed", speed);
33 double time_allowance;
34 getInput(
"time_allowance", time_allowance);
37 goal_.target.x = dist;
41 goal_.time_allowance = rclcpp::Duration::from_seconds(time_allowance);
51 #include "behaviortree_cpp_v3/bt_factory.h"
52 BT_REGISTER_NODES(factory)
54 BT::NodeBuilder builder =
55 [](
const std::string & name,
const BT::NodeConfiguration & config)
57 return std::make_unique<nav2_behavior_tree::BackUpAction>(
58 name,
"backup", config);
A nav2_behavior_tree::BtActionNode class that wraps nav2_msgs::action::BackUp.
void on_tick() override
Function to perform some user-defined operation on tick.
BackUpAction(const std::string &xml_tag_name, const std::string &action_name, const BT::NodeConfiguration &conf)
A constructor for nav2_behavior_tree::BackUpAction.
Abstract class representing an action based BT node.
void increment_recovery_count()
Function to increment recovery count on blackboard if this node wraps a recovery.