-
Notifications
You must be signed in to change notification settings - Fork 157
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
[FEA]Point-to-polyline nearest neighbor distance #342
Comments
I am interested in this as well. In the past I have done a similar brute force method like you describe and agree that there are a lot of computations. A few questions/comments that may or may not apply (or may be out of scope for initial consideration):
|
@KirkDybvik Thanks for your attention, Kirk :) For your questions, here is my opinions:
A: This is a brilliant idea. Actually, the reference line (polyline) is around 500 meters long, and the sensor range of car is about 120 meters. However, we only care about items within sensor range, so it's okay to just calculate a "local" distances as long as it's fast enough to satisfy the real-time needs.
A: Frenet's frame coordinate is preferred. It has S/L axies, S is the longitude distance from the polyline start point and L is the shortest lateral distance to polyline.
A: For lateral distance, left is positive and right negative in the convention of Frenet's frame. |
This issue has been labeled |
Hi @KirkDybvik and @EmilioZhao! We have this implemented as As for coordinates and reference frames, the quadtree is agnostic to the coordinate system and supports scaling in construction/querying. I believe this should allow you to transform the results to your desired the coordinate system, but I'm not an expert in this area. |
This issue has been labeled |
This issue has been labeled |
@EmilioZhao have you tried the cuSpatial quadtree_point_to_nearest_polyline API in cuSpatial? Does it satisfy this feature request? |
This issue has been labeled |
@KirkDybvik have you tried the cuSpatial quadtree_point_to_nearest_polyline API in cuSpatial? Does it satisfy this feature request for you? Reading above, perhaps we need to add ability to change the distance metric and/or coordinate systems used. |
This issue has been labeled |
This issue has been labeled |
@EmilioZhao Recently
I'm interested in this way of implementing point-polyline distance. Would you like to elaborate a bit or point us to some readings? Thanks! |
1. Is your feature request related to a problem? Please describe.
Sure. In autonomous driving, we heavily used GPU to accelerate computation. One typical scenario is: self-driving car needs to know the relative position of every obstacle that might affects its path planning. To get obstacle's relative position, we need to transform obstacles' coordinates from X/Y axis to S/L axis (Frenet-frame coordinate) , in other words, to see the obstacles from
car's perspective
not the bird view. To do the transformation, we calculated the distance of every obstacle's bounding box points (4 vertices) to the reference line (a polyline, usually the central line of a lane) on which the car is currently driving. We did this in a brute force way by breaking the polyline into pieces of segments and calculating the distance from the point to every segment to find the closest segment to the point. Obstacle's lateral and longitudinal relative offset to the car can be described by the relative position of all points to their closest segments.However, there're probably a more efficient way to implement the Point to Polyline nearest neighbor distance algorithm, so we resort to cuSpatial.
2. Describe the solution you'd like
”For lateral distance, left is positive and right negative"
is a Frenet-frame coordinate convention, we will highly appreciate your efforts if you follow this convention.Actually, I was very excited to see this feature (
Point-to-polyline nearest neighbor distance
) in your future plan.Manageable latency is critical to autonomous driving and if cuSpatial could boost the performance, a lot of people would benefit from this. So please re-prioritize your feature plan and bring this forward.
Thanks a lot!
The text was updated successfully, but these errors were encountered: