Description
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
- You might use Matrix Multiplication to implement Point to Polyline distance and use advanced GPU acceleration techniques as long as your solution is better than the naive point-to-segment way:)
- In practice, we will iterate multiple points to do Point-to-Polyline distance, so a multiple points version of point to polyline is very welcomed and it's obviously more efficient, widely used and user-friendly.
- One more thing, for car driver, it's critical to know if the obstacle is on the left side or the right side of the car.
”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!
Metadata
Assignees
Type
Projects
Status
Todo
Activity