File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -987,7 +987,7 @@ def _currentFormatVersion(cls):
987987
988988 :meta private:
989989 """
990- return 35
990+ return 36
991991
992992 class DigestMismatchError (Exception ):
993993 """Exception raised when loading a cached map not matching the original file."""
Original file line number Diff line number Diff line change @@ -1143,7 +1143,7 @@ def getEdges(forward):
11431143 leftEdge = leftEdge ,
11441144 rightEdge = rightEdge ,
11451145 road = None ,
1146- lanes = tuple (backwardLanes ),
1146+ lanes = tuple (reversed ( backwardLanes ) ),
11471147 curb = (backwardShoulder .rightEdge if backwardShoulder else rightEdge ),
11481148 sidewalk = backwardSidewalk ,
11491149 bikeLane = None ,
Original file line number Diff line number Diff line change 11from pathlib import Path
2+ import random
23
34import pytest
5+ import shapely
46
57from scenic .core .distributions import RejectionException
8+ from scenic .core .regions import toPolygon
69from scenic .domains .driving .roads import Intersection , Network
710from tests .domains .driving .conftest import mapFolder
811
@@ -257,6 +260,16 @@ def test_sidewalk(network):
257260 assert network .elementAt (pt ) is sw
258261
259262
263+ def test_laneGroup_lane_order (network ):
264+ for _ in range (30 ):
265+ lg = random .choice (network .laneGroups )
266+ lane_0_dist = shapely .distance (toPolygon (lg .lanes [0 ]), toPolygon (lg .curb ))
267+ lane_distances = [
268+ shapely .distance (toPolygon (lane ), toPolygon (lg .curb )) for lane in lg .lanes
269+ ]
270+ assert all (lane_dist >= lane_0_dist - 0.1 for lane_dist in lane_distances )
271+
272+
260273# --- Tests for cached network pickles ---
261274
262275
You can’t perform that action at this time.
0 commit comments