Skip to content

Commit

Permalink
refactor(map_projection_loader): apply static analysis (autowarefound…
Browse files Browse the repository at this point in the history
…ation#7497)

* refactor based on linter

Signed-off-by: a-maumau <[email protected]>

* style(pre-commit): autofix

---------

Signed-off-by: a-maumau <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: SakodaShintaro <[email protected]>
Signed-off-by: Simon Eisenmann <[email protected]>
  • Loading branch information
3 people authored and simon-eisenmann-driveblocks committed Jun 26, 2024
1 parent 6cf8b1d commit 484f0ef
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
10 changes: 3 additions & 7 deletions map/map_projection_loader/src/map_projection_loader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,9 @@ tier4_map_msgs::msg::MapProjectorInfo load_info_from_yaml(const std::string & fi
msg.vertical_datum = data["vertical_datum"].as<std::string>();
msg.mgrs_grid = data["mgrs_grid"].as<std::string>();

} else if (msg.projector_type == tier4_map_msgs::msg::MapProjectorInfo::LOCAL_CARTESIAN_UTM) {
msg.vertical_datum = data["vertical_datum"].as<std::string>();
msg.map_origin.latitude = data["map_origin"]["latitude"].as<double>();
msg.map_origin.longitude = data["map_origin"]["longitude"].as<double>();
msg.map_origin.altitude = data["map_origin"]["altitude"].as<double>();

} else if (msg.projector_type == tier4_map_msgs::msg::MapProjectorInfo::TRANSVERSE_MERCATOR) {
} else if (
msg.projector_type == tier4_map_msgs::msg::MapProjectorInfo::LOCAL_CARTESIAN_UTM ||
msg.projector_type == tier4_map_msgs::msg::MapProjectorInfo::TRANSVERSE_MERCATOR) {
msg.vertical_datum = data["vertical_datum"].as<std::string>();
msg.map_origin.latitude = data["map_origin"]["latitude"].as<double>();
msg.map_origin.longitude = data["map_origin"]["longitude"].as<double>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ void save_dummy_mgrs_lanelet2_map(const std::string & mgrs_coord, const std::str

file << "<?xml version=\"1.0\"?>\n";
file << "<osm version=\"0.6\" generator=\"lanelet2\">\n";
file << " <node id=\"1\" lat=\"" << lat << "\" lon=\"" << lon << "\"/>\n";
file << R"( <node id="1" lat=")" << lat << "\" lon=\"" << lon << "\"/>\n";
file << "</osm>";

file.close();
Expand Down

0 comments on commit 484f0ef

Please sign in to comment.