Nav2 Navigation Stack - humble  humble
ROS 2 Navigation Stack
clear_costmap_service.cpp
1 // Copyright (c) 2019 Samsung Research America
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 #include <string>
16 #include <memory>
17 
18 #include "nav2_behavior_tree/plugins/action/clear_costmap_service.hpp"
19 
20 namespace nav2_behavior_tree
21 {
22 
24  const std::string & service_node_name,
25  const BT::NodeConfiguration & conf)
26 : BtServiceNode<nav2_msgs::srv::ClearEntireCostmap>(service_node_name, conf)
27 {
28 }
29 
31 {
33 }
34 
36  const std::string & service_node_name,
37  const BT::NodeConfiguration & conf)
38 : BtServiceNode<nav2_msgs::srv::ClearCostmapExceptRegion>(service_node_name, conf)
39 {
40 }
41 
43 {
44  getInput("reset_distance", request_->reset_distance);
46 }
47 
49  const std::string & service_node_name,
50  const BT::NodeConfiguration & conf)
51 : BtServiceNode<nav2_msgs::srv::ClearCostmapAroundRobot>(service_node_name, conf)
52 {
53 }
54 
56 {
57  getInput("reset_distance", request_->reset_distance);
59 }
60 
61 } // namespace nav2_behavior_tree
62 
63 #include "behaviortree_cpp_v3/bt_factory.h"
64 BT_REGISTER_NODES(factory)
65 {
66  factory.registerNodeType<nav2_behavior_tree::ClearEntireCostmapService>("ClearEntireCostmap");
68  "ClearCostmapExceptRegion");
70  "ClearCostmapAroundRobot");
71 }
Abstract class representing a service based BT node.
void increment_recovery_count()
Function to increment recovery count on blackboard if this node wraps a recovery.
A nav2_behavior_tree::BtServiceNode class that wraps nav2_msgs::srv::ClearCostmapAroundRobot.
ClearCostmapAroundRobotService(const std::string &service_node_name, const BT::NodeConfiguration &conf)
A constructor for nav2_behavior_tree::ClearCostmapAroundRobotService.
void on_tick() override
The main override required by a BT service.
A nav2_behavior_tree::BtServiceNode class that wraps nav2_msgs::srv::ClearCostmapExceptRegion.
ClearCostmapExceptRegionService(const std::string &service_node_name, const BT::NodeConfiguration &conf)
A constructor for nav2_behavior_tree::ClearCostmapExceptRegionService.
void on_tick() override
The main override required by a BT service.
A nav2_behavior_tree::BtServiceNode class that wraps nav2_msgs::srv::ClearEntireCostmap.
void on_tick() override
The main override required by a BT service.
ClearEntireCostmapService(const std::string &service_node_name, const BT::NodeConfiguration &conf)
A constructor for nav2_behavior_tree::ClearEntireCostmapService.