Skip to content
Snippets Groups Projects
Commit 3ecdf390 authored by bpwilcox's avatar bpwilcox
Browse files

fix rebase

parent 3dc15d3b
No related branches found
No related tags found
No related merge requests found
......@@ -84,9 +84,10 @@ OccGridLoader::on_configure(const rclcpp_lifecycle::State & /*state*/)
map_filename = std::string(dirname(fname_copy)) + '/' + map_filename;
free(fname_copy);
}
} catch (YAML::Exception &) {
throw std::runtime_error("The map does not contain an image tag or it is invalid");
}
} catch (YAML::Exception & e) {
std::string err("'" + yaml_filename_ +
"' does not contain an image tag or it is invalid: " + e.what());
throw std::runtime_error(err); }
try {
loadParameters.resolution = doc["resolution"].as<double>();
......@@ -99,7 +100,7 @@ OccGridLoader::on_configure(const rclcpp_lifecycle::State & /*state*/)
loadParameters.origin[0] = doc["origin"][0].as<double>();
loadParameters.origin[1] = doc["origin"][1].as<double>();
loadParameters.origin[2] = doc["origin"][2].as<double>();
} catch (YAML::Exception &) {
} catch (YAML::Exception & e) {
std::string err("The map does not contain an origin tag or it is invalid: %s", e.what());
throw std::runtime_error(err);
}
......@@ -145,8 +146,7 @@ OccGridLoader::on_configure(const rclcpp_lifecycle::State & /*state*/)
try {
loadParameters.negate = doc["negate"].as<int>();
} catch (YAML::Exception & e) {
std::string err("The map does not contain a negate tag or "
"it is invalid: %s", e.what());
std::string err("The map does not contain a negate tag or it is invalid: %s", e.what());
throw std::runtime_error(err);
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment