Status: To Do
DefaultSimplePerception occasionally misses a vehicle that is behind the projected rear of the GTU but parallel the translated rear.
Reproducible with the circular road demo. At T=20:42:00 GTU 3 is just within the Southern half on the outer lane and GTU 141 is just before the end of the Northern half on the inner lane.
GTU 3 does not perceive GTU 141 and changes lane to the left leaving virtually no space between the vehicles.
Cause is that to determine trailing GTUs the projectedPosition method projects the reference position of the GTU (GTU 3) onto the inner lane and then longitudinally moves backward over the distance from the reference position to the rear. This yields -0.048130817965511774; i.e. 4.8cm before the start of the lane. As the front of GTU 141 is less than this distance from the end of the lane; the headway is negative and GTU 141 is not "seen" as being behind the projected GTU 3.
GTU 141 is not seen as parallel either, because the code in updateParallelHeadwaysLeft (and - presumably -Right) uses the accessibleAdjacentLanes of the current lane and therefore effectively only checks on lanes that are adjacent to any and all lanes that GTU currently is on.
TODO: check that the GTU registers itself onto all lanes that it (partly) covers after performing the instant lane change.
The problem boils down to
projection(rear) != rear(projection)
There are two obvious approaches to this problem:
- Fix updateParallelHeadwaysLeft (and -Right) to use translation instead of projection
- Fix projectedPosition to project the indicated point on the GTU onto the adjacent lane; not the reference point