Skip to content

Commit 32b2e77

Browse files
committed
init adaptions
1 parent 78a673b commit 32b2e77

File tree

5 files changed

+2579
-2340
lines changed

5 files changed

+2579
-2340
lines changed

.vscode/settings.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"python-envs.defaultEnvManager": "ms-python.python:venv",
3+
"python-envs.defaultPackageManager": "ms-python.python:pip",
4+
"debugpy.debugJustMyCode": false
5+
}

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@ $ pytest
9393
Use the following commands to generate test scenarios of different logical scenarios:
9494

9595
- [`alks_scenarios/cutin_scenario_generator.py`](https://github.com/ika-rwth-aachen/alks-scenarios/blob/main/alks_scenarios/cutin_scenario_generator.py): Generate *Cut-in* test scenarios from UNECE R157 E/ECE/TRANS/505/Rev.3/Add.156/Amend.4, Annex 3, pp. 45-52
96-
- [`alks_scenarios/cutin_scenario_generator.py`](https://github.com/ika-rwth-aachen/alks-scenarios/blob/main/alks_scenarios/cutout_scenario_generator.py): Generate *Cut-out* test scenarios from UNECE R157 E/ECE/TRANS/505/Rev.3/Add.156/Amend.4, Annex 3, pp. 53-55
97-
- [`alks_scenarios/cutin_scenario_generator.py`](https://github.com/ika-rwth-aachen/alks-scenarios/blob/main/alks_scenarios/deceleration_scenario_generator.py): Generate *Deceleration* test scenarios from UNECE R157 E/ECE/TRANS/505/Rev.3/Add.156/Amend.4, Annex 3, p. 56
96+
- [`alks_scenarios/cutout_scenario_generator.py`](https://github.com/ika-rwth-aachen/alks-scenarios/blob/main/alks_scenarios/cutout_scenario_generator.py): Generate *Cut-out* test scenarios from UNECE R157 E/ECE/TRANS/505/Rev.3/Add.156/Amend.4, Annex 3, pp. 53-55
97+
- [`alks_scenarios/deceleration_scenario_generator.py`](https://github.com/ika-rwth-aachen/alks-scenarios/blob/main/alks_scenarios/deceleration_scenario_generator.py): Generate *Deceleration* test scenarios from UNECE R157 E/ECE/TRANS/505/Rev.3/Add.156/Amend.4, Annex 3, p. 56
9898

9999
Per default, test scenarios are generated in `results/annex3`.
100100
Per test scenario, the following files are generated:

alks_scenarios/cutin_scenario_generator.py

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@
1212
from tqdm import tqdm
1313

1414
from simple_scenario import Scenario, EgoConfiguration, Vehicle
15-
from simple_scenario.road import Road, StraightSegment
16-
15+
from simple_scenario.road import SyntheticRoad, StraightSegment
1716

1817
class CutInScenarioGenerator:
1918
def __init__(self, result_dir: str | Path) -> None:
@@ -35,9 +34,9 @@ def __init__(self, result_dir: str | Path) -> None:
3534
vy_max = 3
3635
dx0_min = 0
3736
dx0_max = 60
38-
# Vary
39-
vy_step = 0.1
40-
dx0_step = 1
37+
# Varying values
38+
vy_step = 2.0
39+
dx0_step = 10
4140
self._vy_values = np.arange(vy_min + vy_step, vy_max + vy_step, vy_step)
4241
self._dx0_values = np.arange(dx0_min, dx0_max + dx0_step, dx0_step)
4342

@@ -147,9 +146,9 @@ def _create_single_scenario(
147146

148147
# Calculate object_vehicle_t0 from dy0
149148
ego_width = ego_configuration.width
150-
dummy_vehicle = Vehicle(0, 0, 0, 0, 0)
149+
dummy_vehicle = Vehicle(0)
151150
object_vehicle_width = dummy_vehicle.width
152-
object_vehicle_t0_from_ego_llt = ego_configuration.t0 - (
151+
object_vehicle_t0_from_ego_llt = self._ego_t0 - (
153152
self._dy0 + ego_width / 2 + object_vehicle_width / 2
154153
)
155154
object_vehicle_t0 = object_vehicle_t0_from_ego_llt + self._lane_width
@@ -165,10 +164,10 @@ def _create_single_scenario(
165164
object_vehicle_lc_duration = self._dy0 / vy
166165
object_vehicle = Vehicle(
167166
0,
168-
self._object_lanelet_id,
169-
object_vehicle_s0,
170-
object_vehicle_t0,
171-
vo0,
167+
start_lanelet_id= self._object_lanelet_id,
168+
start_s=object_vehicle_s0,
169+
start_t=object_vehicle_t0,
170+
v0=vo0,
172171
lc_direction=1,
173172
lc_type="vy",
174173
lc_vy=vy,
@@ -179,11 +178,13 @@ def _create_single_scenario(
179178
ego_dist = ve0 * scenario_duration
180179
road_length = max(ego_dist, self._min_road_length) + self._ego_s0 + 100
181180
goal_position = self._ego_s0 + 0.75 * ego_dist
182-
road = Road(
181+
ego_configuration = EgoConfiguration(
182+
self._ego_lanelet_id, self._ego_s0, self._ego_t0, ve0, target_s=goal_position , target_t=0 , target_lanelet_id=self._ego_lanelet_id
183+
)
184+
road = SyntheticRoad(
183185
self._n_lanes,
184186
self._lane_width,
185187
segments=[StraightSegment(road_length)],
186-
goal_position=goal_position,
187188
speed_limit=60,
188189
)
189190

@@ -221,7 +222,7 @@ def generate_all_scenarios() -> None:
221222
result_dir = Path(__file__).parent / ".." / "results" / "annex3" / "cutin"
222223
result_dir.mkdir(exist_ok=True, parents=True)
223224

224-
n_plots_in_regulation = 14
225+
n_plots_in_regulation = 1
225226

226227
n_workers = n_plots_in_regulation
227228

pyproject.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ version = "0.1.0"
1818
dependencies = [
1919
"loguru>=0.7.3",
2020
"numpy>=1.24.4",
21-
"simple-scenario[commonroad]>=0.10.1",
21+
"simple-scenario[commonroad]",
2222
"tqdm>=4.67.1",
2323
]
2424
classifiers = [
@@ -43,6 +43,9 @@ build = [
4343
]
4444

4545

46+
[tool.uv.sources]
47+
simple-scenario = { path = "/work/tarlowski/simple/github/simple-scenario", editable = true }
48+
4649
[tool.setuptools]
4750
packages = [
4851
"alks_scenarios"

0 commit comments

Comments
 (0)