11 #include "../../include/cost_map_ros/utilities.hpp" 28 std::string delimiter =
"/";
29 int index = resource_name.find(delimiter);
30 if ( index == std::string::npos ) {
31 throw std::invalid_argument(std::string(
"'") + resource_name + std::string(
"' is not a valid resource name."));
33 std::string
package = resource_name.substr(0, index);
34 std::string name = resource_name.substr(index + delimiter.length());
39 std::string plugin_package =
"cost_map_ros";
40 std::string attribute =
"image_resource";
50 std::vector<std::string> costmaps;
52 for (
const auto&
filename : costmaps) {
58 throw std::runtime_error(std::string(
"resource name '") + resource_name + std::string(
"' is not available (try 'rospack plugins --attrib=image_resource cost_map_ros')."));
ROSLIB_DECL void getPlugins(const std::string &package, const std::string &attribute, V_string &plugins, bool force_recrawl=false)
std::string resolveResourceName(const std::string &resource_name)
Use rospack to resolve a costmap given a ros package resource name.