15 #ifndef NAV2_COSTMAP_2D__CLEAR_COSTMAP_SERVICE_HPP_
16 #define NAV2_COSTMAP_2D__CLEAR_COSTMAP_SERVICE_HPP_
22 #include "rclcpp/rclcpp.hpp"
23 #include "nav2_msgs/srv/clear_costmap_except_region.hpp"
24 #include "nav2_msgs/srv/clear_costmap_around_robot.hpp"
25 #include "nav2_msgs/srv/clear_entire_costmap.hpp"
26 #include "nav2_costmap_2d/costmap_layer.hpp"
27 #include "nav2_util/lifecycle_node.hpp"
59 void clearRegion(
double reset_distance,
bool invert);
68 rclcpp::Logger logger_{rclcpp::get_logger(
"nav2_costmap_2d")};
74 unsigned char reset_value_;
77 rclcpp::Service<nav2_msgs::srv::ClearCostmapExceptRegion>::SharedPtr clear_except_service_;
81 void clearExceptRegionCallback(
82 const std::shared_ptr<rmw_request_id_t> request_header,
83 const std::shared_ptr<nav2_msgs::srv::ClearCostmapExceptRegion::Request> request,
84 const std::shared_ptr<nav2_msgs::srv::ClearCostmapExceptRegion::Response> response);
86 rclcpp::Service<nav2_msgs::srv::ClearCostmapAroundRobot>::SharedPtr clear_around_service_;
90 void clearAroundRobotCallback(
91 const std::shared_ptr<rmw_request_id_t> request_header,
92 const std::shared_ptr<nav2_msgs::srv::ClearCostmapAroundRobot::Request> request,
93 const std::shared_ptr<nav2_msgs::srv::ClearCostmapAroundRobot::Response> response);
95 rclcpp::Service<nav2_msgs::srv::ClearEntireCostmap>::SharedPtr clear_entire_service_;
99 void clearEntireCallback(
100 const std::shared_ptr<rmw_request_id_t> request_header,
101 const std::shared_ptr<nav2_msgs::srv::ClearEntireCostmap::Request> request,
102 const std::shared_ptr<nav2_msgs::srv::ClearEntireCostmap::Response> response);
107 void clearLayerRegion(
108 std::shared_ptr<CostmapLayer> & costmap,
double pose_x,
double pose_y,
double reset_distance,
114 bool getPosition(
double & x,
double & y)
const;
Exposes services to clear costmap objects in inclusive/exclusive regions or completely.
~ClearCostmapService()
A destructor.
ClearCostmapService()=delete
A constructor.
void clearRegion(double reset_distance, bool invert)
Clears the region outside of a user-specified area reverting to the static map.
void clearEntirely()
Clears all layers.
A ROS wrapper for a 2D Costmap. Handles subscribing to topics that provide observations about obstacl...