38 #ifndef NAV2_COSTMAP_2D__COSTMAP_FILTERS__KEEPOUT_FILTER_HPP_
39 #define NAV2_COSTMAP_2D__COSTMAP_FILTERS__KEEPOUT_FILTER_HPP_
44 #include "nav2_costmap_2d/costmap_filters/costmap_filter.hpp"
46 #include "rclcpp/rclcpp.hpp"
47 #include "nav2_msgs/msg/costmap_filter_info.hpp"
69 const std::string & filter_info_topic);
76 int min_i,
int min_j,
int max_i,
int max_j,
77 const geometry_msgs::msg::Pose & pose);
93 void filterInfoCallback(
const nav2_msgs::msg::CostmapFilterInfo::SharedPtr msg);
97 void maskCallback(
const nav_msgs::msg::OccupancyGrid::SharedPtr msg);
99 nav2::Subscription<nav2_msgs::msg::CostmapFilterInfo>::SharedPtr filter_info_sub_;
100 nav2::Subscription<nav_msgs::msg::OccupancyGrid>::SharedPtr mask_sub_;
102 nav_msgs::msg::OccupancyGrid::SharedPtr filter_mask_;
104 std::string global_frame_;
106 bool override_lethal_cost_{
false};
107 unsigned char lethal_override_cost_{252};
108 bool last_pose_lethal_{
false};
109 unsigned int lethal_state_update_min_x_{999999u}, lethal_state_update_min_y_{999999u};
110 unsigned int lethal_state_update_max_x_{0u}, lethal_state_update_max_y_{0u};
A 2D costmap provides a mapping between points in the world and their associated "costs".
: CostmapFilter basic class. It is inherited from Layer in order to avoid hidden problems when the sh...
Reads in a keepout mask and marks keepout regions in the map to prevent planning or control in restri...
void process(nav2_costmap_2d::Costmap2D &master_grid, int min_i, int min_j, int max_i, int max_j, const geometry_msgs::msg::Pose &pose)
Process the keepout layer at the current pose / bounds / grid.
KeepoutFilter()
A constructor.
void resetFilter()
Reset the costmap filter / topic / info.
void initializeFilter(const std::string &filter_info_topic)
Initialize the filter and subscribe to the info topic.
bool isActive()
If this filter is active.