Skip to content

Commit 115cbf7

Browse files
committed
Added comments and Fix Test path
1 parent e2e334e commit 115cbf7

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

omega_prime/locator.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ def _xys2sts(self, xys, polys=None):
350350
intersection_lane_ids = np.append(intersection_lane_ids, nearby_idx)
351351

352352

353-
353+
# Need a convertion from float values to int values. This is because the shapely STRtree query_nearest returns float values
354354
no_asscociation_idxs = no_asscociation_idxs.astype(int)
355355
intersection_lane_ids = intersection_lane_ids.astype(int)
356356
for l_id in set(intersection_lane_ids):
@@ -386,6 +386,7 @@ def query_centerlines(self, point, range_percentage=0.1):
386386
# Query all centerlines within the buffer
387387
nearby_idxs = self.str_tree.query(buffer, predicate="intersects")
388388

389+
# If there was no intersection, return the nearest centerline
389390
if nearby_idxs.size == 0:
390391
return nearest_idx
391392

tests/test_esmini_examples.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ def test_centerline():
7171
def test_locator():
7272
with cProfile.Profile() as pr:
7373
# Load the recording
74-
# rec = omega_prime.Recording.from_file(p / mapping[3][0], p / mapping[3][1], validate=False)
75-
rec = omega_prime.Recording.from_file("example_files/01_tracks.mcap")
74+
rec = omega_prime.Recording.from_file(p / mapping[3][0], p / mapping[3][1], validate=False)
75+
7676
# Create a locator and remove all polygons from the lanes
7777
locator = omega_prime.Locator.from_mapodr(rec.map)
7878

0 commit comments

Comments
 (0)