mirror of
https://github.com/pim-n/road-gen.git
synced 2026-03-23 21:48:12 +01:00
Compare commits
2 Commits
main
...
36f4abb425
| Author | SHA1 | Date | |
|---|---|---|---|
| 36f4abb425 | |||
| 784f22bd63 |
@ -1,5 +1,3 @@
|
|||||||
Archived due to codebase being integrated in [PG-RAD](https://github.com/pim-n/pg-rad).
|
|
||||||
|
|
||||||
# RoadGen
|
# RoadGen
|
||||||
|
|
||||||
Generate road segments in a 2D Cartesian plane.
|
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`.
|
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).
|
||||||
@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user