2 Commits

Author SHA1 Message Date
36f4abb425 Merge pull request #11 from pim-n/fix-prefab-bug
fixes #6
2026-02-02 15:43:11 +01:00
784f22bd63 fixes #6 2026-02-02 15:40:52 +01:00
2 changed files with 4 additions and 5 deletions

View File

@ -1,5 +1,3 @@
Archived due to codebase being integrated in [PG-RAD](https://github.com/pim-n/pg-rad).
# RoadGen
Generate road segments in a 2D Cartesian plane.
@ -74,4 +72,4 @@ You can reproduce results by adding a seed with the `--seed` flag.
For more info, see `road-gen --help` or `road-gen random --help`.
There are some Jupyter notebooks explaining [roads as planar curves](docs/planar_curve.ipynb), as well as the actual implementation of [random segmented roads](docs/prefab_roads.ipynb) and [random roads from noise](docs/random_roads.ipynb).
There are some Jupyter notebooks explaining [roads as planar curves](docs/planar_curve.ipynb), as well as the actual implementation of [random segmented roads](docs/prefab_roads.ipynb) and [random roads from noise](docs/random_roads.ipynb).

View File

@ -47,8 +47,9 @@ class SegmentedRoadGenerator(BaseRoadGenerator):
Returns:
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):
raise ValueError(f"Invalid segment type provided. Available choices: {prefabs.SEGMENTS.keys()}")
existing_prefabs = prefabs.PREFABS.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.alpha = alpha