15 #ifndef NAV2_BEHAVIOR_TREE__PLUGINS__ACTION__CHECK_POSE_OCCUPANCY_ACTION_HPP_
16 #define NAV2_BEHAVIOR_TREE__PLUGINS__ACTION__CHECK_POSE_OCCUPANCY_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 "geometry_msgs/msg/pose_stamped.hpp"
25 #include "nav2_msgs/srv/get_costs.hpp"
26 #include "nav2_ros_common/service_client.hpp"
27 #include "nav2_behavior_tree/bt_utils.hpp"
28 #include "nav2_behavior_tree/json_utils.hpp"
29 #include "nav2_behavior_tree/bt_service_node.hpp"
31 namespace nav2_behavior_tree
51 const std::string & service_node_name,
52 const BT::NodeConfiguration & conf);
65 BT::NodeStatus
on_completion(std::shared_ptr<nav2_msgs::srv::GetCosts::Response> response)
75 BT::RegisterJsonDefinition<geometry_msgs::msg::PoseStamped>();
79 BT::InputPort<geometry_msgs::msg::PoseStamped>(
"pose",
"Pose to check if occupied"),
80 BT::InputPort<double>(
81 "cost_threshold", 254.0,
82 "Cost threshold for considering a pose occupied"),
83 BT::InputPort<bool>(
"use_footprint",
true,
"Whether to use footprint cost"),
85 "consider_unknown_as_obstacle",
false,
86 "Whether to consider unknown cost as obstacle")
92 bool consider_unknown_as_obstacle_;
93 double cost_threshold_;
Abstract class representing a service based BT node.
static BT::PortsList providedBasicPorts(BT::PortsList addition)
Any subclass of BtServiceNode that accepts parameters must provide a providedPorts method and call pr...
A nav2_behavior_tree::BtServiceNode class that checks if a pose is occupied by calling the GetCosts s...
BT::NodeStatus on_completion(std::shared_ptr< nav2_msgs::srv::GetCosts::Response > response) override
Function to perform some user-defined operation after receiving a result from the service.
void on_tick() override
The main override required by a BT service.
static BT::PortsList providedPorts()
Creates list of BT ports.
CheckPoseOccupancy(const std::string &service_node_name, const BT::NodeConfiguration &conf)
A constructor for nav2_behavior_tree::CheckPoseOccupancy.