waymo-open-dataset icon indicating copy to clipboard operation
waymo-open-dataset copied to clipboard

Waymo open motion dataset can't convert roadgraph_samples/type=18 to a crosswalk polygon, just some short lines

Open lwx422 opened this issue 2 years ago • 1 comments

I use the fellowing method to convert data: roadgraph_xyz = decoded_example['roadgraph_samples/xyz'].numpy() roadgraph_dir = decoded_example['roadgraph_samples/dir'].numpy() roadgraph_valid = decoded_example['roadgraph_samples/valid'].numpy() roadgraph_valid_xyz = roadgraph_xyz[np.squeeze(roadgraph_valid>0, axis=-1)] roadgraph_valid_dir = roadgraph_dir[np.squeeze(roadgraph_valid>0, axis=-1)] roadgraph_valid_start_xyz = roadgraph_valid_xyz roadgraph_valid_end_xyz = roadgraph_valid_xyz + 0.5 * roadgraph_valid_dir infoflow 2022-08-10 14-30-10

than I plot. roadgraph_valid_start_xyz to roadgraph_valid_end_xyz, this method works for polyline objects such as lanecenter or laneboundary, but for crosswalk, there are just some short lines, not a polygon. not as described.

lwx422 avatar Aug 10 '22 06:08 lwx422

The polygons are not sampled at 0.5 meters as the lane centers and boundaries are. To plot them you need to connect the individual points within the polygon rather than offsetting by 0.5 toward the direction vector. We realize this is a bit inconsistent. We plan to open source the conversion code from Scenario protos to tf.Examples in our next release such that users can customize the sample spacing of road elements to their application.

scott-ettinger avatar Aug 10 '22 17:08 scott-ettinger

solve it, thanks very much

lwx422 avatar Aug 24 '22 02:08 lwx422

solve it, thanks very much

Hi,

Can I ask how do you solve it? In my case, the polygons are not closed... After checking the directions for the last point of the polygon, they are zeros...

bDGuo avatar Oct 13 '22 12:10 bDGuo

solve it, thanks very much

Hi,

Can I ask how do you solve it? In my case, the polygons are not closed... After checking the directions for the last point of the polygon, they are zeros...

just use id to gather points from same polygon and connect the last point with the first one, is will be closed.

lwx422 avatar Jan 29 '23 07:01 lwx422

Thanks so much!

bDGuo avatar Jan 29 '23 12:01 bDGuo