apollo icon indicating copy to clipboard operation
apollo copied to clipboard

[traffic light detection] hdmap_input.cc: the method of hdmap: GetForwardNearestSignalsOnlane

Open hzdsdhr opened this issue 8 years ago • 1 comments

Hi Apollo team: Recently, I've been reading the traffic light detection part code. Traffic light detection use hdmap to provide the location of roi. In function GetSignals of file hdmap_input.cc, hdmap's method : GetForwardNearestSignalsOnLane is used to get signals. Can someone give me a description about this method? From my understanding, this method pick the lane the car located based on the localization, then pick the traffic light which overlap with the lane. This process should be easy and the result should be either one traffic light or no traffic light. But from the code, I can see that it's more complex. There maybe several lanes the car located(how is this possible?) and there maybe several traffic lights in one lane( how is this possible?). Can someone help? Thank you.

hzdsdhr avatar Jul 17 '18 07:07 hzdsdhr

@hzdsdhr GetForwardNearestSignalOnLane() take a point as input, and return the traffic light(s) along the lane(s) where that point is. A point can be on multiple lanes because some lanes may overlap with each other. e.g. at an intersection, a lane going straign forward and a lane turning right/left may overlap.

Hope the information answered your question. Thank you for supporting Apollo!

jmtao avatar Jul 17 '18 20:07 jmtao