You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: planning/behavior_path_lane_change_module/README.md
+165
Original file line number
Diff line number
Diff line change
@@ -319,6 +319,171 @@ The detection area for the target lane can be expanded beyond its original bound
319
319
</table>
320
320
</div>
321
321
322
+
##### Object filtering
323
+
324
+
```plantuml
325
+
@startuml
326
+
skinparam defaultTextAlignment center
327
+
skinparam backgroundColor #WHITE
328
+
329
+
title NormalLaneChange::filterObjects Method Execution Flow
330
+
331
+
start
332
+
333
+
group "Filter Objects by Class" {
334
+
:Iterate through each object in objects list;
335
+
while (has not finished iterating through object list) is (TRUE)
336
+
if (current object type != param.object_types_to_check?) then (TRUE)
337
+
#LightPink:Remove current object;
338
+
else (FALSE)
339
+
:Keep current object;
340
+
endif
341
+
end while
342
+
end group
343
+
344
+
if (object list is empty?) then (TRUE)
345
+
:Return empty result;
346
+
stop
347
+
else (FALSE)
348
+
endif
349
+
350
+
group "Filter Oncoming Objects" #PowderBlue {
351
+
:Iterate through each object in target lane objects list;
352
+
while (has not finished iterating through object list?) is (TRUE)
353
+
:check object's yaw with reference to ego's yaw.;
354
+
if (yaw difference < 90 degree?) then (TRUE)
355
+
:Keep current object;
356
+
else (FALSE)
357
+
if (object is stopping?) then (TRUE)
358
+
:Keep current object;
359
+
else (FALSE)
360
+
#LightPink:Remove current object;
361
+
endif
362
+
endif
363
+
endwhile
364
+
end group
365
+
366
+
if (object list is empty?) then (TRUE)
367
+
:Return empty result;
368
+
stop
369
+
else (FALSE)
370
+
endif
371
+
372
+
group "Filter Objects Ahead Terminal" #Beige {
373
+
:Calculate lateral distance from ego to current lanes center;
374
+
375
+
:Iterate through each object in objects list;
376
+
while (has not finished iterating through object list) is (TRUE)
377
+
:Get current object's polygon;
378
+
:Initialize distance to terminal from object to max;
379
+
while (has not finished iterating through object polygon's vertices) is (TRUE)
380
+
:Calculate object's lateral distance to end of lane;
381
+
:Update minimum distance to terminal from object;
382
+
end while
383
+
if (Is object's distance to terminal exceeds minimum lane change length?) then (TRUE)
384
+
#LightPink:Remove current object;
385
+
else (FALSE)
386
+
endif
387
+
end while
388
+
end group
389
+
390
+
if (object list is empty?) then (TRUE)
391
+
:Return empty result;
392
+
stop
393
+
else (FALSE)
394
+
endif
395
+
396
+
group "Filter Objects By Lanelets" #LightGreen {
397
+
398
+
:Iterate through each object in objects list;
399
+
while (has not finished iterating through object list) is (TRUE)
400
+
:lateral distance diff = difference between object's lateral distance and ego's lateral distance to the current lanes' centerline.;
401
+
if (Object in target lane polygon, and lateral distance diff is more than half of ego's width?) then (TRUE)
402
+
:Add to target_lane_objects;
403
+
else (FALSE)
404
+
if (Object overlaps with backward target lanes?) then (TRUE)
405
+
:Add to target_lane_objects;
406
+
else (FALSE)
407
+
if (Object in current lane polygon?) then (TRUE)
408
+
:Add to current_lane_objects;
409
+
else (FALSE)
410
+
:Add to other_lane_objects;
411
+
endif
412
+
endif
413
+
endif
414
+
end while
415
+
416
+
:Return target lanes object, current lanes object and other lanes object;
417
+
end group
418
+
419
+
:Generate path from current lanes;
420
+
421
+
if (path empty?) then (TRUE)
422
+
:Return empty result;
423
+
stop
424
+
else (FALSE)
425
+
endif
426
+
427
+
group "Filter Target Lanes' objects" #LightCyan {
428
+
429
+
:Iterate through each object in target lane objects list;
430
+
while (has not finished iterating through object list) is (TRUE)
431
+
:check object's velocity;
432
+
if(velocity is within threshold?) then (TRUE)
433
+
:Keep current object;
434
+
else (FALSE)
435
+
:check whether object is ahead of ego;
436
+
if(object is ahead of ego?) then (TRUE)
437
+
:keep current object;
438
+
else (FALSE)
439
+
#LightPink:remove current object;
440
+
endif
441
+
endif
442
+
endwhile
443
+
end group
444
+
445
+
group "Filter Current Lanes' objects" #LightYellow {
446
+
447
+
:Iterate through each object in current lane objects list;
448
+
while (has not finished iterating through object list) is (TRUE)
449
+
:check object's velocity;
450
+
if(velocity is within threshold?) then (TRUE)
451
+
:check whether object is ahead of ego;
452
+
if(object is ahead of ego?) then (TRUE)
453
+
:keep current object;
454
+
else (FALSE)
455
+
#LightPink:remove current object;
456
+
endif
457
+
else (FALSE)
458
+
#LightPink:remove current object;
459
+
endif
460
+
endwhile
461
+
end group
462
+
463
+
group "Filter Other Lanes' objects" #Lavender {
464
+
465
+
:Iterate through each object in other lane objects list;
466
+
while (has not finished iterating through object list) is (TRUE)
467
+
:check object's velocity;
468
+
if(velocity is within threshold?) then (TRUE)
469
+
:check whether object is ahead of ego;
470
+
if(object is ahead of ego?) then (TRUE)
471
+
:keep current object;
472
+
else (FALSE)
473
+
#LightPink:remove current object;
474
+
endif
475
+
else (FALSE)
476
+
#LightPink:remove current object;
477
+
endif
478
+
endwhile
479
+
end group
480
+
481
+
:Trasform the objects into extended predicted object and return them as lane_change_target_objects;
482
+
stop
483
+
484
+
@enduml
485
+
```
486
+
322
487
##### Collision check in prepare phase
323
488
324
489
The ego vehicle may need to secure ample inter-vehicle distance ahead of the target vehicle before attempting a lane change. The flag `enable_collision_check_at_prepare_phase` can be enabled to gain this behavior. The following image illustrates the differences between the `false` and `true` cases.
Copy file name to clipboardexpand all lines: planning/behavior_path_lane_change_module/include/behavior_path_lane_change_module/utils/debug_structs.hpp
0 commit comments