nutonomy / nuscenes-devkit

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

Navigation. How can I get waypoints from (x1,y1) to (x2 y2) in nuscenes map #1083

Closed 16Huzeyu closed 5 months ago

16Huzeyu commented 6 months ago

I know I can get the road id which the point(x1,x2) is in . How can I get waypoints from (x1,y1) to (x2 y2) in nuscenes map?

whyekit-motional commented 6 months ago

@16Huzeyu do explore arcline_path_utils from nuscenes.map_expansion - it can be used like so:

poses = arcline_path_utils.discretize_lane(lane_record, resolution_meters=1)
16Huzeyu commented 6 months ago

@whyekit-motional Thank you for your reply!! This api can give me waypoints in one road but what I also need is how to get the road ids between (x1,y1) and (x2,y2).Then I can use arcline_path_utils.discretize_lane to get all waypoints in these road.So firstly,how can I get road ids between (x1,y1) and (x2,y2).

whyekit-motional commented 6 months ago

Getting all the road IDs between (x1, y1) and (x2, y2) sounds like quite a vague problem statement, but you could see if this helps in some manner:

my_patch = (x1, y1, x2, y2)
records_intersect_patch = nusc_map.get_records_in_patch(
    my_patch, nusc_map.non_geometric_layers, mode='intersect'
)
16Huzeyu commented 6 months ago

@whyekit-motional It is like a Shortest path problem .How can i pass from (x1, y1) to (x2, y2) ,I want to find a shortest path,and the road ids are the nodes in path.

whyekit-motional commented 6 months ago

@16Huzeyu for this, you would need to write up your own algorithm to determine the shortest path