nutonomy / nuscenes-devkit

The devkit of the nuScenes dataset.
https://www.nuScenes.org
Other
2.19k stars 616 forks source link

Deviation between map data and OSM #1010

Closed wowlza closed 7 months ago

wowlza commented 7 months ago

Hi, I'm trying to obtain SD maps from OpenStreetMap(OSM) based on the map data. But I had a problem with deviation between map data and OSM data.

I want to know how to correct such deviations?

I got the OSM data according to the following steps:

  1. get the pose information from each scene, and from this, the corresponding frame_pose is obtained.
  2. get the max_x, max_y, min_x, min_y according to the frame_pose, and get the area of maps.
         try:
            area = np.array([
            [min_x-180, min_y-180],
            [max_x+180, max_y+180]])
         except:
            area = np.array([
            [min_x-130, min_y-130],
            [max_x+130, max_y+130]])
  3. convert the 4 maps from city_coords to utm(EPSG: 3857) projector = Proj(proj="utm", zone=utm_zone, ellps="WGS84", datum="WGS84", units="m")
  4. convert the 4 maps from utm to wgs84 ( EPSG:4326 )
  5. download the OSM data according to the latitude and longitude.

I vitualized the maps and there is a certain bias in the results, especially the boston-seaport. The results are as following:

The gray lines are roads from OSM and the gray blocks are road_segment and lane from nuScenes

图片4

The deviation is noticeable in the upper left corner of the image 图片1

图片2

图片3

whyekit-motional commented 7 months ago

@wowlza pls see if this helps you: https://github.com/nutonomy/nuscenes-devkit/issues/966

wowlza commented 7 months ago

@whyekit-motional Thanks for fast response. But I think #966 did not solve my problem.

#966 visualize the results in EPSG 3857 or EPSG 4326, but I visualized my result under the city coordinates.

The method I got the OSM data can be demonstrated by the following image: 坐标转换思路

As I demonstrated before, I got the city_coords according to the frame_pose, which is measured in meters.

Therefore, in order to get the absolute coordinates, I have to use the UTM coordinate system as an intermediary.

I first converted the original coordinates of the city EPSG:4326, like singapore-onenorth: (1.2882100868743724, 103.78475189208984), to EPSG:3857. In the EPSG:3857 coordinates, the values of the city coordinate are added on the basis of the original coordinates. Then I converted it back to EPSG 4326, and got the OSM data.

The steps to convert back are also consistent.

Did I make any mistakes along the way? Could you give me some advice? Thanks!