Skip to content

Commit a957ada

Browse files
Adds flow chart
Signed-off-by: Zulfaqar Azmi <zulfaqar.azmi@tier4.jp>
1 parent 6e6bf7d commit a957ada

File tree

1 file changed

+159
-0
lines changed
  • planning/behavior_path_lane_change_module

1 file changed

+159
-0
lines changed

planning/behavior_path_lane_change_module/README.md

+159
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,165 @@ The detection area for the target lane can be expanded beyond its original bound
319319
</table>
320320
</div>
321321

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+
partition "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+
:Remove current object;
338+
else (false)
339+
endif
340+
end while
341+
}
342+
343+
if (object list is empty?) then (TRUE)
344+
:Return empty result;
345+
stop
346+
else (false)
347+
endif
348+
349+
:Generate path from current lanes;
350+
351+
if (path empty?) then (TRUE)
352+
:Return empty result;
353+
stop
354+
else (false)
355+
endif
356+
357+
partition "Filter Objects Ahead Terminal" {
358+
:Calculate lateral distance from ego to current lanes center;
359+
360+
:Iterate through each object in objects list;
361+
while (has not finished iterating through object list) is (TRUE)
362+
:Get current object's polygon;
363+
:Initialize distance to terminal from object to max;
364+
while (has not finished iterating through object polygon's vertices) is (TRUE)
365+
:Calculate object's lateral distance to end of lane;
366+
:Update minimum distance to terminal from object;
367+
end while
368+
if (Is object's distance to terminal exceeds minimum lane change length?) then (true)
369+
:Remove current object;
370+
else (false)
371+
endif
372+
end while
373+
}
374+
375+
partition "Filter Objects By Lanelets" {
376+
377+
:Iterate through each object in objects list;
378+
while (has not finished iterating through object list) is (TRUE)
379+
:lateral distance diff = difference between object's lateral distance and ego's lateral distance to the current lanes' centerline.;
380+
if (Object in target lane polygon, and lateral distance diff is more than half of ego's width) then (yes)
381+
:Add to target_lane_objects;
382+
else (no)
383+
if (Object overlaps with backward target lanes?) then (yes)
384+
:Add to target_lane_objects;
385+
else (no)
386+
if (Object in current lane polygon?) then (yes)
387+
:Add to current_lane_objects;
388+
else (no)
389+
:Add to other_lane_objects;
390+
endif
391+
endif
392+
endif
393+
end while
394+
395+
:Return target lanes object, current lanes object and other lanes object;
396+
}
397+
398+
partition "Filter Target Lanes' objects" {
399+
400+
:Iterate through each object in target lane objects list;
401+
while (has not finished iterating through object list) is (TRUE)
402+
:check object's yaw with reference to ego's yaw.;
403+
if (yaw difference < 90 degree) then (TRUE)
404+
:Assume this object's direction is same direction with ego vehicle.;
405+
:check object's velocity;
406+
if(velocity is within threshold) then (TRUE)
407+
:Keep current object;
408+
else
409+
:check whether object is ahead of ego;
410+
if(object is ahead of ego) then (TRUE)
411+
:keep current object;
412+
else (FALSE)
413+
:remove current object;
414+
endif
415+
endif
416+
else
417+
:Assume this object's direction is different direction with ego vehicle.;
418+
:Remove current object;
419+
endif
420+
endwhile
421+
}
422+
423+
partition "Filter Current Lanes' objects" {
424+
425+
:Iterate through each object in current lane objects list;
426+
while (has not finished iterating through object list) is (TRUE)
427+
:check object's yaw with reference to ego's yaw.;
428+
if (yaw difference < 90 degree) then (TRUE)
429+
:Assume this object's direction is same direction with ego vehicle.;
430+
:check object's velocity;
431+
if(velocity is within threshold) then (TRUE)
432+
:check whether object is ahead of ego;
433+
if(object is ahead of ego) then (TRUE)
434+
:keep current object;
435+
else
436+
:remove current object;
437+
endif
438+
else
439+
:remove current object;
440+
endif
441+
else
442+
:Assume this object's direction is different direction with ego vehicle.;
443+
:Remove current object;
444+
endif
445+
endwhile
446+
}
447+
448+
449+
partition "Filter Other Lanes' objects" {
450+
451+
:Iterate through each object in other lane objects list;
452+
while (has not finished iterating through object list) is (TRUE)
453+
:check object's yaw with reference to ego's yaw.;
454+
if (yaw difference < 90 degree) then (TRUE)
455+
:Assume this object's direction is same direction with ego vehicle.;
456+
:check object's velocity;
457+
if(velocity is within threshold) then (TRUE)
458+
:check whether object is ahead of ego;
459+
if(object is ahead of ego) then (TRUE)
460+
:keep current object;
461+
else
462+
:remove current object;
463+
endif
464+
else
465+
:remove current object;
466+
endif
467+
else
468+
:Assume this object's direction is different direction with ego vehicle.;
469+
:Remove current object;
470+
endif
471+
endwhile
472+
}
473+
474+
:Trasform the objects into extended predicted object and return them as lane_change_target_objects;
475+
stop
476+
477+
@enduml
478+
479+
```
480+
322481
##### Collision check in prepare phase
323482

324483
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.

0 commit comments

Comments
 (0)