Merge pull request #11 from pim-n/fix-prefab-bug

fixes #6
This commit is contained in:
Pim Nelissen
2026-02-02 15:43:11 +01:00
committed by GitHub

View File

@ -47,8 +47,9 @@ class SegmentedRoadGenerator(BaseRoadGenerator):
Returns: Returns:
Tuple[np.ndarray, np.ndarray]: x and y coordinates of the waypoints describing the random road. Tuple[np.ndarray, np.ndarray]: x and y coordinates of the waypoints describing the random road.
""" """
if not all(segment in prefabs.PREFABS.keys() for segment in segments): existing_prefabs = prefabs.PREFABS.keys()
raise ValueError(f"Invalid segment type provided. Available choices: {prefabs.SEGMENTS.keys()}") if not all(segment in existing_prefabs for segment in segments):
raise ValueError(f"Invalid segment type provided. Available choices: {existing_prefabs}")
self.segments = segments self.segments = segments
self.alpha = alpha self.alpha = alpha