Skip to content

Commit 078d99a

Browse files
add warning when fixing centerline in map_odr
1 parent 993cc82 commit 078d99a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

omega_prime/map_odr.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,16 +399,19 @@ class LaneXodr(Lane):
399399

400400
@classmethod
401401
def create(cls, lane: PyxodrLane, road: PyxodrRoad, lane_section_id: int, lane_idx: int = None):
402+
idx = XodrLaneId(road.id, lane.id, lane_section_id)
402403
centre_line = getattr(lane, "centre_line", None)
403404
if centre_line is None or not len(centre_line):
404405
raise ValueError(f"Lane {lane.id} has no centre_line")
405406

406407
centerline = LineString(centre_line[:, :2])
407408
if not centerline.is_valid:
408409
centerline = make_valid(centerline)
410+
warnings.warn(
411+
f"Needed to make centerline of lane {idx} valid. Most likely, because the OpenDRIVE geometry is translated to a zero length polyline. Try to decrease `step_size`."
412+
)
409413

410414
lane_type, lane_subtype = cls._determine_lane_type_and_subtype(lane, road)
411-
idx = XodrLaneId(road.id, lane.id, lane_section_id)
412415
return cls(
413416
_xodr=lane,
414417
idx=idx,

0 commit comments

Comments
 (0)