Skip to content

Commit ddd01d4

Browse files
committed
refactor(crosswalk): clean up the structure and create a brief flowchart
Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com>
1 parent 84ddac6 commit ddd01d4

File tree

5 files changed

+213
-165
lines changed

5 files changed

+213
-165
lines changed

planning/behavior_velocity_planner/autoware_behavior_velocity_crosswalk_module/README.md

+29
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,35 @@ This module judges whether the ego should stop in front of the crosswalk in orde
88
![crosswalk_module](docs/crosswalk_module.svg){width=1100}
99
</figure>
1010

11+
## Flowchart
12+
13+
```plantuml
14+
@startuml
15+
skinparam monochrome true
16+
17+
title modifyPathVelocity
18+
start
19+
:getPathEndPointsOnCrosswalk;
20+
:applySlowDownByLanleet2Map;
21+
:applySlowDownByOcclusion;
22+
:getStaticStopPose;
23+
:resamplePath;
24+
:checkStopForCrosswalkUsers;
25+
:checkStopForStuckVehicles;
26+
:getNearestStopFactor;
27+
:setSafe;
28+
:setDistanceToStop;
29+
30+
if (isActivated() is True?) then (yes)
31+
:planGo;
32+
else (yes)
33+
:planStop;
34+
endif
35+
36+
stop
37+
@enduml
38+
```
39+
1140
## Features
1241

1342
### Yield the Way to the Pedestrians

planning/behavior_velocity_planner/autoware_behavior_velocity_crosswalk_module/include/autoware/behavior_velocity_crosswalk_module/util.hpp

+4-3
Original file line numberDiff line numberDiff line change
@@ -97,13 +97,14 @@ std::set<int64_t> getCrosswalkIdSetOnPath(
9797

9898
bool checkRegulatoryElementExistence(const lanelet::LaneletMapPtr & lanelet_map_ptr);
9999

100-
std::vector<geometry_msgs::msg::Point> getPolygonIntersects(
100+
std::optional<std::pair<geometry_msgs::msg::Point, geometry_msgs::msg::Point>>
101+
getPathEndPointsOnCrosswalk(
101102
const PathWithLaneId & ego_path, const lanelet::BasicPolygon2d & polygon,
102-
const geometry_msgs::msg::Point & ego_pos, const size_t max_num);
103+
const geometry_msgs::msg::Point & ego_pos);
103104

104105
std::vector<geometry_msgs::msg::Point> getLinestringIntersects(
105106
const PathWithLaneId & ego_path, const lanelet::BasicLineString2d & linestring,
106-
const geometry_msgs::msg::Point & ego_pos, const size_t max_num);
107+
const geometry_msgs::msg::Point & ego_pos);
107108

108109
std::optional<lanelet::ConstLineString3d> getStopLineFromMap(
109110
const lanelet::Id lane_id, const lanelet::LaneletMapPtr & lanelet_map_ptr,

0 commit comments

Comments
 (0)