Skip to content

Commit

Permalink
feat(autoware_geography_utils): add support for local cartesian proje…
Browse files Browse the repository at this point in the history
…ction

Signed-off-by: Sebastian Zęderowski <szederowski@autonomous-systems.pl>
  • Loading branch information
Sebastian Zęderowski authored and xmfcx committed Feb 25, 2025
1 parent f73f26e commit 08d902d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions common/autoware_geography_utils/src/lanelet2_projector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,17 +53,17 @@ std::unique_ptr<lanelet::Projector> get_lanelet2_projector(const MapProjectorInf
}

if (projector_info.projector_type == MapProjectorInfo::LOCAL_CARTESIAN) {
lanelet::GPSPoint position{
const lanelet::GPSPoint position{
projector_info.map_origin.latitude, projector_info.map_origin.longitude,
projector_info.map_origin.altitude};

Check warning on line 58 in common/autoware_geography_utils/src/lanelet2_projector.cpp

View check run for this annotation

Codecov / codecov/patch

common/autoware_geography_utils/src/lanelet2_projector.cpp#L57-L58

Added lines #L57 - L58 were not covered by tests
lanelet::Origin origin{position};
lanelet::projection::LocalCartesianProjector projector{origin};
const lanelet::Origin origin{position};
const lanelet::projection::LocalCartesianProjector projector{origin};
return std::make_unique<lanelet::projection::LocalCartesianProjector>(projector);

Check warning on line 61 in common/autoware_geography_utils/src/lanelet2_projector.cpp

View check run for this annotation

Codecov / codecov/patch

common/autoware_geography_utils/src/lanelet2_projector.cpp#L60-L61

Added lines #L60 - L61 were not covered by tests
}

throw std::invalid_argument(
"Invalid map projector type: " + projector_info.projector_type +
". Currently supported types: MGRS, LocalCartesianUTM, and TransverseMercator");
". Currently supported types: MGRS, LocalCartesianUTM, LocalCartesian and TransverseMercator");
}

} // namespace autoware::geography_utils

0 comments on commit 08d902d

Please sign in to comment.