6std::array<std::string, 4>
9 "global_costmap/obstacles_layer",
10 "local_costmap/obstacles_layer"
11 "global_costmap/inflater_layer",
12 "local_costmap/inflater_layer"};
16 ROS_INFO(
"[CostmapSwitch] registering costmap type: %s", costmapName.c_str());
17 auto proxy = std::make_shared<CostmapProxy>(this->
moveBaseClient_->
name_ +
"/" + costmapName, enablePropertyName);
31 ROS_ERROR(
"the owner of the CostmapSwitch must be a ClMoveBaseZ");
57 ROS_INFO(
"[CostmapSwitch] enabling %s", layerName.c_str());
61 ROS_ERROR(
"[CostmapSwitch] costmap %s does not exist", layerName.c_str());
66 ROS_INFO(
"[CostmapSwitch] costmap %s found. Calling dynamic reconfigure server.", layerName.c_str());
78 ROS_INFO(
"[CostmapSwitch] disabling %s", layerName.c_str());
82 ROS_ERROR(
"[CostmapSwitch] costmap %s does not exist", layerName.c_str());
87 ROS_INFO(
"[CostmapSwitch] costmap %s found. Calling dynamic reconfigure server.", layerName.c_str());
102 dynamic_reconfigure::BoolParameter enableField;
103 enableField.name =
"enabled";
104 enableField.value =
true;
108 enableField.value =
false;
114 dynamic_reconfigure::ReconfigureRequest srv_req;
115 dynamic_reconfigure::ReconfigureResponse srv_resp;
124 ROS_INFO(
"sending dynamic reconfigure request: %s",
costmapName_.c_str());
129 ROS_WARN(
"could not call dynamic reconfigure server. It does not exist: %s",
costmapName_.c_str());
void setCostmapEnabled(bool value)
dynamic_reconfigure::Config disableReq
void dynreconfCallback(const dynamic_reconfigure::Config::ConstPtr &configuration_update)
CostmapProxy(std::string costmap_name, std::string enablePropertyName)
dynamic_reconfigure::Config enableReq
void registerProxyFromDynamicReconfigureServer(std::string costmapName, std::string enablePropertyName="enabled")
std::map< std::string, std::shared_ptr< CostmapProxy > > costmapProxies
static std::string getStandardCostmapName(StandardLayers layertype)
cl_move_base_z::ClMoveBaseZ * moveBaseClient_
void enable(std::string layerName)
virtual void onInitialize() override
bool exists(std::string layerName)
static std::array< std::string, 4 > layerNames
void disable(std::string layerName)
std::string name_
rosnamespace path