Commit f703927 1 parent ffab4c8 commit f703927 Copy full SHA for f703927
File tree 1 file changed +5
-4
lines changed
planning/behavior_path_planner/src/utils/avoidance
1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -134,22 +134,23 @@ bool isWithinCrosswalk(
134
134
const std::shared_ptr<const lanelet::routing::RoutingGraphContainer> & overall_graphs)
135
135
{
136
136
using Point = boost::geometry::model::d2::point_xy<double >;
137
- using boost::geometry::correct;
138
- using boost::geometry::within;
139
137
140
138
const auto & p = object.object .kinematics .initial_pose_with_covariance .pose .position ;
141
139
const Point p_object{p.x , p.y };
142
140
141
+ // get conflicting crosswalk crosswalk
143
142
constexpr int PEDESTRIAN_GRAPH_ID = 1 ;
144
143
const auto conflicts =
145
144
overall_graphs->conflictingInGraph (object.overhang_lanelet , PEDESTRIAN_GRAPH_ID);
146
145
146
+ constexpr double THRESHOLD = 1.0 ;
147
147
for (const auto & crosswalk : conflicts) {
148
148
auto polygon = crosswalk.polygon2d ().basicPolygon ();
149
149
150
- correct (polygon);
150
+ boost::geometry:: correct (polygon);
151
151
152
- if (within (p_object, polygon)) {
152
+ // ignore objects arround the crosswalk
153
+ if (boost::geometry::distance (p_object, polygon) < THRESHOLD) {
153
154
return true ;
154
155
}
155
156
}
You can’t perform that action at this time.
0 commit comments