Skip to content

Commit

Permalink
fixes an issue with overlapping vehicles.
Browse files Browse the repository at this point in the history
  • Loading branch information
ptaillandier committed Aug 3, 2021
1 parent 9cb7dda commit 40a90a6
Showing 1 changed file with 8 additions and 2 deletions.
Expand Up @@ -121,8 +121,14 @@ public static double rescaleProba(final double probaInOneSecond,

if (Math.abs(gapBetweenCentroids) < 0.5 * vL + 0.5 * otherVL) {
// Overlap with another vehicle
return null;
} else if (gapBetweenCentroids > 0 && gap < minLeadingDist) {
//return null;
if (gapBetweenCentroids >= 0)
gap = + 0.5 * vL + 0.5 * otherVL;
else {
gap = - 0.5 * vL - 0.5 * otherVL;
}
}
if (gapBetweenCentroids > 0 && gap < minLeadingDist) {
leadingVehicle = otherVehicle;
minLeadingDist = Math.abs(gap);
leadingSameDirection = sameDirection;
Expand Down

0 comments on commit 40a90a6

Please sign in to comment.