From 371d0d1e75a2f7956c36c2d4802cf511f606f6bd Mon Sep 17 00:00:00 2001 From: Pim Nelissen Date: Fri, 30 Jan 2026 19:56:58 +0100 Subject: [PATCH] Improve documentation --- src/road_gen/generators/segmented_road_generator.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/road_gen/generators/segmented_road_generator.py b/src/road_gen/generators/segmented_road_generator.py index 4a7fbe5..bdacbf1 100644 --- a/src/road_gen/generators/segmented_road_generator.py +++ b/src/road_gen/generators/segmented_road_generator.py @@ -40,13 +40,12 @@ class SegmentedRoadGenerator(BaseRoadGenerator): Args: segments (list[str]): List of segments. alpha (float, optional): Dirichlet concentration parameter. A higher value leads to more uniform apportionment of the length amongst the segments, while a lower value allows more random apportionment. Defaults to 1.0. - + Raises: - ValueError: _description_ - ValueError: _description_ - + ValueError: "No valid radius for this turn segment" means a turn is too tight given its segment length and the velocity. To fix this, you can try to reduce the amount of segments or increase length. Increasing alpha (Dirichlet concentration parameter) can also help because this reduces the odds of very small lengths being assigned to turn segments. + Returns: - np.ndarray: _description_ + 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()}")