20 "global_costmap/obstacles_layer",
21 "local_costmap/obstacles_layer"
22 "global_costmap/inflater_layer",
23 "local_costmap/inflater_layer"};
26 std::string costmapName, std::string enablePropertyName)
28 RCLCPP_INFO(
getLogger(),
"[CostmapSwitch] registering costmap type: %s", costmapName.c_str());
29 auto proxy = std::make_shared<CostmapProxy>(
42 RCLCPP_ERROR(
getLogger(),
"the owner of the CostmapSwitch must be a ClNav2Z");
72 RCLCPP_INFO(
getLogger(),
"[CostmapSwitch] enabling %s", layerName.c_str());
76 RCLCPP_ERROR(
getLogger(),
"[CostmapSwitch] costmap %s does not exist", layerName.c_str());
82 getLogger(),
"[CostmapSwitch] costmap %s found. Calling dynamic reconfigure server.",
95 RCLCPP_INFO(
getLogger(),
"[CostmapSwitch] disabling %s", layerName.c_str());
99 RCLCPP_ERROR(
getLogger(),
"[CostmapSwitch] costmap %s does not exist", layerName.c_str());
105 getLogger(),
"[CostmapSwitch] costmap %s found. Calling dynamic reconfigure server.",
119 std::string , std::string , rclcpp::Node::SharedPtr nh)
131 RCLCPP_ERROR(nh->get_logger(),
"costmap switch not implemented %s",
costmapName_.c_str());
154 RCLCPP_ERROR(
nh_->get_logger(),
"costmap switch not implemented %s",
costmapName_.c_str());
CostmapProxy(std::string costmap_name, std::string enablePropertyName, rclcpp::Node::SharedPtr nh)
void setCostmapEnabled(bool value)
rclcpp::Node::SharedPtr nh_
bool exists(std::string layerName)
void onInitialize() override
cl_nav2z::ClNav2Z * nav2zClient_
static std::array< std::string, 4 > layerNames
static std::string getStandardCostmapName(StandardLayers layertype)
void disable(std::string layerName)
void registerProxyFromDynamicReconfigureServer(std::string costmapName, std::string enablePropertyName="enabled")
void enable(std::string layerName)
std::map< std::string, std::shared_ptr< CostmapProxy > > costmapProxies
rclcpp::Logger getLogger() const
rclcpp::Node::SharedPtr getNode()
virtual std::string getName() const