Skip to content

16.9.0

Choose a tag to compare

@github-actions github-actions released this 28 Jul 11:01

Description

Abstract

This pull request adds support for the Transverse Mercator coordinate system in scenario_simulator_v2. The implementation introduces a configuration-based approach to select between MGRS and Transverse Mercator projectors while maintaining backward compatibility with existing maps.

Background

TIER IV has started using the Transverse Mercator coordinate system. Previously, scenario_simulator_v2 only supported MGRS (Military Grid Reference System) using lanelet::projection::MGRSProjector from autoware_lanelet2_extension. This limitation prevented the use of maps created with the Transverse Mercator projection system.

Details

Key Changes

  1. Configuration-based Projector Selection: Implemented a map_projector_info.yaml configuration file parser that allows selection between different coordinate systems based on the projector_type field.

  2. LaneletLoader Enhancement: Enhanced the LaneletLoader::load() function in simulation/traffic_simulator/src/lanelet_wrapper/lanelet_loader.cpp to:

    • Parse map_projector_info.yaml configuration files
    • Support both "MGRS" and "TransverseMercator" projector types
    • Implement produceTransverseMercatorProjector() function to create TransverseMercatorProjector instances with proper origin and scale factor configuration
    • Maintain backward compatibility by defaulting to MGRS when no configuration file is present
  3. Dependency Addition: Added yaml-cpp dependency to both CMakeLists.txt and package.xml for YAML configuration file parsing.

  4. Code Refactoring: Refactored HdMapUtils to use the new LaneletLoader::load() method instead of directly instantiating projectors.

  5. Tests chagnes: LaneletLoader::load() throws exception if empty lanelet is provided. Refactored HdMapUtils, which uses LaneletLoader::load(), caused the need to change the tests, which expect HdMapUtils to handle empty maps.

  • Two tests that tested empty map interaction were removed
  • The test was added to test whether the exception is correctly thrown when passing an empty map.

Configuration Format

The map_projector_info.yaml file should be located in the same directory as the map file and follow this format:

projector_type: "TransverseMercator"  # or "MGRS"
vertical_datum: WGS84 # ignored by scenario_simulator_v2
map_origin:
  latitude: 35.61836750154
  longitude: 139.78066608243
scale_factor: 0.9996  # Optional, defaults to 0.9996

Error Handling

  • Throws SIMULATION_ERROR for unsupported projector types
  • Provides detailed error messages for missing mandatory configuration fields
  • Handles YAML parsing errors

Backward Compatibility

  • If no map_projector_info.yaml file exists, the system defaults to MGRS projector
  • Existing maps without configuration files continue to work without modification

References

Known Limitations

  • Currently only supports MGRS and TransverseMercator projector types. Other projection systems will result in an exception.
  • The map_projector_info.yaml file must be located in the same directory as the map file.
  • Scale factor for TransverseMercator defaults to 0.9996 if not specified in the configuration.

Related Issues