Easy API
fix_scenario_and_save_adjusted_scenarios(path_to_xml, save_path, save_scenario=True)
Fix scenario and save adjusted scenario
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path_to_xml
|
Union[Path, str]
|
idm_path to load xml from |
required |
save_path
|
Union[Path, str]
|
idm_path to save adjusted xml to |
required |
save_scenario
|
bool
|
if true,s ave scenario to xml |
True
|
Returns:
| Type | Description |
|---|---|
Tuple[ScenarioFixerReport, ScenarioProblems]
|
Tuple of Scenario Fixer Report and Scenario Problem |
Source code in commonroad_idm_planner/idm_easy_api.py
335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 | |
solve_planning_problem(scenario, planning_problem, planning_cycle_max=10, wheelbase_rear=2.0, ignore_static_obstacles=True)
Solves planning problem and returns idm planner object
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
scenario
|
Scenario
|
cr scenario |
required |
planning_problem
|
PlanningProblem
|
cr planning problem |
required |
planning_cycle_max
|
int
|
max number of planning cycles |
10
|
wheelbase_rear
|
float
|
rear wheelbase to approximate steering angle calculation |
2.0
|
ignore_static_obstacles
|
bool
|
if True, drives through static obstacles |
True
|
Returns:
| Type | Description |
|---|---|
IDMPlanner
|
IDM Planner |
Source code in commonroad_idm_planner/idm_easy_api.py
105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 | |
solve_planning_problem_and_get_state_and_input_trajectory(scenario, planning_problem, wheelbase_rear=2.0, planning_cycle_max=6, ignore_static_obstacles=True)
Solves planning and returns idm state and input trajectories
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
scenario
|
Scenario
|
cr scenario |
required |
planning_problem
|
PlanningProblem
|
cr planning problem |
required |
wheelbase_rear
|
float
|
rear wheelbase to approximate steering angle calculation |
2.0
|
planning_cycle_max
|
int
|
max number of planning cycles |
6
|
ignore_static_obstacles
|
bool
|
if True, drives through static obstacles |
True
|
Returns:
| Type | Description |
|---|---|
Tuple[IDMTrajectory, List[IDMInput]]
|
IDM Trajectory over scenario and input trajectory over scenario |
Source code in commonroad_idm_planner/idm_easy_api.py
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 | |
solve_planning_problem_and_get_trajectory(scenario, planning_problem, wheelbase_rear=2.0, planning_cycle_max=6, ignore_static_obstacles=True)
Solves planning problem and returns idm trajectory
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
scenario
|
Scenario
|
cr scenario |
required |
planning_problem
|
PlanningProblem
|
cr planning problem |
required |
wheelbase_rear
|
float
|
rear wheelbase to approximate steering angle calculation |
2.0
|
planning_cycle_max
|
int
|
max number of planning cycles |
6
|
ignore_static_obstacles
|
bool
|
if True, drives through static obstacles |
True
|
Returns:
| Type | Description |
|---|---|
IDMTrajectory
|
IDM Trajectory over scenario |
Source code in commonroad_idm_planner/idm_easy_api.py
78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 | |
solve_planning_problem_and_plot_results(scenario, planning_problem, planning_cycle_max=10, wheelbase_rear=2.0, ignore_static_obstacles=True, save_path=None, no_plots=False, create_gif=True)
Solves planning problem and plots results
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
scenario
|
Scenario
|
cr scenario |
required |
planning_problem
|
PlanningProblem
|
cr planning problem |
required |
planning_cycle_max
|
int
|
max number of planning cycles |
10
|
wheelbase_rear
|
float
|
rear wheelbase to approximate steering angle calculation |
2.0
|
ignore_static_obstacles
|
bool
|
if true, planner drives through static obstacles |
True
|
save_path
|
Optional[Union[str, Path]]
|
idm_path to save stuff to |
None
|
no_plots
|
bool
|
if True, not plots are created |
False
|
create_gif
|
bool
|
if True, makes gif. Needs .png to exist in dir. Does not work in ci |
True
|
Returns:
| Type | Description |
|---|---|
IDMPlanner
|
IDM Planner |
Source code in commonroad_idm_planner/idm_easy_api.py
132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 | |
verify_scenario_and_planning_problem(scenario, planning_problem)
Verifies scenario and planning problem and returns scenario problem dataclass
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
scenario
|
Scenario
|
cr scenario |
required |
planning_problem
|
PlanningProblem
|
cr planning problem |
required |
Returns:
| Type | Description |
|---|---|
ScenarioProblems
|
scenario problems |
Source code in commonroad_idm_planner/idm_easy_api.py
281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 | |
verify_scenario_xml(path_to_xml)
Verifies scenario xml
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path_to_xml
|
Union[Path, str]
|
idm_path to cr xml |
required |
Returns:
| Type | Description |
|---|---|
ScenarioProblems
|
scenario problems |
Source code in commonroad_idm_planner/idm_easy_api.py
304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 | |