CommonRoad / commonroad-scenario-designer

Toolbox for Map Conversion and Scenario Creation for Autonomous Vehicles.
https://commonroad.in.tum.de/tools/scenario-designer
GNU General Public License v3.0
27 stars 9 forks source link

Using ellipsoidal transform formula instead of spherical transform while converting lat lon to X Y #5

Closed ataparlar closed 11 months ago

ataparlar commented 11 months ago

Hi,

We are using OSM -> CommonRoad and CommonRoad -> Lanelet2 conversion in order to use in Autoware - AWSIM with a simulation environment created with OpenStreetMap data in the same area. We noticed that, even thought we can generate the lanelet2 map in the correct position, the map is corrupted in the matter of size and shape. You can see the situation in below images. Screenshot from 2023-12-04 15-30-16 Screenshot from 2023-12-15 15-33-18

The reason of this was using the spherical transform formula while transforming latitude and longitude to X and Y coordinates. After changed that to WGS84 ellipsoidal transform formula, the error dissappeared. The source of the transformation formula: https://en.wikipedia.org/wiki/Geographic_coordinate_system

We tested this in the AWSIM simulation environment with a 20 kilometers road in Istanbul. Here is the result. Last 2 images show the start and the end of the road. image image image

smaierhofer commented 11 months ago

@ataparlar This should work. However, we also tried to find a general solution to the problem so that one can provide an arbitrary projection (similar as it is already done in our lanelet2 and OpenDRIVE conversion). Can you check whether this branch works for you? In this branch, one can define a custom projection via the configs/settings here.

ataparlar commented 11 months ago

@smaierhofer Thank you for your attention. I searched for a suitable branch for using in my case but I missed that one I think. This works. Both of the approches are correct. I saw that this branch is merged into develop. Now, there is no problem. Before that, there were no global coordinates. I am closing the PR.