Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why is a lane defined as a list of List[ArcLinePath]? #879

Closed
AngelosSE opened this issue Feb 13, 2023 · 2 comments
Closed

Why is a lane defined as a list of List[ArcLinePath]? #879

AngelosSE opened this issue Feb 13, 2023 · 2 comments

Comments

@AngelosSE
Copy link

Or equivalently, why can a lane token correspond to multiple curve segments?

Example where a token corresponds to two curve segments:

    nusc_map = NuScenesMap(
        dataroot=datasets/nuscenes/v1.0-mini', 
        map_name ='singapore-onenorth',
        )
    lane_token = '0a3f11ca-70af-4ab0-af23-bf61152ab0af'
    lanes = nusc_map.get_arcline_path(lane_token)
    _,ax = plt.subplots()
    colors = ['b','r']
    for lane,color in zip(lanes,colors):
        poses = arcline_path_utils.discretize_lane([lane],resolution_meters=0.1)
        poses = np.array(poses)
        ax.plot(*poses[:,:2].T,color)
        pose = arcline_path_utils.pose_at_length(lane,1e-6)
        ax.plot(*pose[:2],'o'+color) 
@whyekit-motional
Copy link
Collaborator

whyekit-motional commented Feb 14, 2023

@AngelosSE curves can be composed using multiple arcs, where each arc is from a circle of a certain radius R and intersecting angle D. Here's a visualization of a single arc (credits to here):

Now, you could use different arcs to compose different curves, like so (credits to here once again):

Applying this concept to the visualization generated by your code snippet:

You can see that the lane is made up of two arcs, where the red one is of radius 13.47 m and the blue one is of radius 10.22 m

@AngelosSE
Copy link
Author

I understand your explanation, but the curves in my plot do not look like arcs from a circle. For example, if one traverses the red curve starting from the red dot, then tangent is first changing and then it becomes approximately constant.

Perhaps there is some settings in my plotting. I have tried using ax.set_aspect('equal') but I get the same result.

Is it possible to determine the center point of a circle? Then one can plot also the circles corresponding to the segments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants