Skip to content

Commit

Permalink
chore(autoware_map_projection_loader): show map error details (autowa…
Browse files Browse the repository at this point in the history
…refoundation#10151)

* show map error details

Signed-off-by: Y.Hisaki <[email protected]>

* use string stream

Signed-off-by: Y.Hisaki <[email protected]>

---------

Signed-off-by: Y.Hisaki <[email protected]>
  • Loading branch information
yhisaki authored Feb 18, 2025
1 parent b4d9155 commit aa19eb9
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include <lanelet2_io/Io.h>
#include <lanelet2_projection/UTM.h>

#include <sstream>
#include <string>

namespace autoware::map_projection_loader
Expand All @@ -31,7 +32,12 @@ autoware_map_msgs::msg::MapProjectorInfo load_info_from_lanelet2_map(const std::
lanelet::projection::MGRSProjector projector{};
const lanelet::LaneletMapPtr map = lanelet::load(filename, projector, &errors);
if (!errors.empty()) {
throw std::runtime_error("Error occurred while loading lanelet2 map");
std::stringstream ss;
ss << "Error occurred while loading lanelet2 map:\n";
for (const auto & err : errors) {
ss << "- " << err << "\n";
}
throw std::runtime_error(ss.str());
}

// If the lat & lon values in all the points of lanelet2 map are all zeros,
Expand Down

0 comments on commit aa19eb9

Please sign in to comment.