Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(map_loader): add support for local cartesian projection #9238

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build_depends_humble.repos
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ repositories:
core/autoware_msgs:
type: git
url: https://github.com/autowarefoundation/autoware_msgs.git
version: 1.3.0
version: 1.4.0
core/autoware_adapi_msgs:
type: git
url: https://github.com/autowarefoundation/autoware_adapi_msgs.git
Expand Down
16 changes: 16 additions & 0 deletions map/autoware_map_projection_loader/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,22 @@ map_origin:
altitude: 0.0 # [m]
```

### Using LocalCartesian

If you want to use local cartesian WGS84, please specify the map origin as well.

Currently LocalCartesian can only be used in lanelet2_map_loader, packages like gnss_poser doesn't support it right now.

```yaml
# map_projector_info.yaml
projector_type: LocalCartesian
vertical_datum: WGS84
map_origin:
latitude: 35.6762 # [deg]
longitude: 139.6503 # [deg]
altitude: 0.0 # [m]
```

### Using TransverseMercator

If you want to use Transverse Mercator projection, please specify the map origin as well.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@

} else if (
msg.projector_type == autoware_map_msgs::msg::MapProjectorInfo::LOCAL_CARTESIAN_UTM ||
msg.projector_type == autoware_map_msgs::msg::MapProjectorInfo::LOCAL_CARTESIAN ||

Check warning on line 42 in map/autoware_map_projection_loader/src/map_projection_loader.cpp

View check run for this annotation

CodeScene Delta Analysis / CodeScene Cloud Delta Analysis (main)

❌ New issue: Complex Conditional

load_info_from_yaml has 1 complex conditionals with 2 branches, threshold = 2. A complex conditional is an expression inside a branch (e.g. if, for, while) which consists of multiple, logical operators such as AND/OR. The more logical operators in an expression, the more severe the code smell.
msg.projector_type == autoware_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>();
Expand All @@ -59,8 +60,9 @@
msg.projector_type = autoware_map_msgs::msg::MapProjectorInfo::LOCAL;
} else {
throw std::runtime_error(
"Invalid map projector type. Currently supported types: MGRS, LocalCartesianUTM, "
"TransverseMercator, and Local");
"Invalid map projector type. Currently supported types: MGRS, LocalCartesian, "
"LocalCartesianUTM, "
"TransverseMercator, and local");

Check warning on line 65 in map/autoware_map_projection_loader/src/map_projection_loader.cpp

View check run for this annotation

Codecov / codecov/patch

map/autoware_map_projection_loader/src/map_projection_loader.cpp#L65

Added line #L65 was not covered by tests
}
return msg;
}
Expand Down
Loading