@@ -126,20 +126,9 @@ inline boost::optional<geometry_msgs::msg::Point> checkCollision(
126
126
template <class T >
127
127
boost::optional<PathIndexWithPoint> findCollisionSegment (
128
128
const T & path, const geometry_msgs::msg::Point & stop_line_p1,
129
- const geometry_msgs::msg::Point & stop_line_p2, const size_t target_lane_id )
129
+ const geometry_msgs::msg::Point & stop_line_p2)
130
130
{
131
131
for (size_t i = 0 ; i < path.points .size () - 1 ; ++i) {
132
- const auto & prev_lane_ids = path.points .at (i).lane_ids ;
133
- const auto & next_lane_ids = path.points .at (i + 1 ).lane_ids ;
134
-
135
- const bool is_target_lane_in_prev_lane =
136
- std::find (prev_lane_ids.begin (), prev_lane_ids.end (), target_lane_id) != prev_lane_ids.end ();
137
- const bool is_target_lane_in_next_lane =
138
- std::find (next_lane_ids.begin (), next_lane_ids.end (), target_lane_id) != next_lane_ids.end ();
139
- if (!is_target_lane_in_prev_lane && !is_target_lane_in_next_lane) {
140
- continue ;
141
- }
142
-
143
132
const auto & p1 =
144
133
tier4_autoware_utils::getPoint (path.points .at (i)); // Point before collision point
145
134
const auto & p2 =
@@ -157,12 +146,12 @@ boost::optional<PathIndexWithPoint> findCollisionSegment(
157
146
158
147
template <class T >
159
148
boost::optional<PathIndexWithPoint> findCollisionSegment (
160
- const T & path, const LineString2d & stop_line, const size_t target_lane_id )
149
+ const T & path, const LineString2d & stop_line)
161
150
{
162
151
const auto stop_line_p1 = convertToGeomPoint (stop_line.at (0 ));
163
152
const auto stop_line_p2 = convertToGeomPoint (stop_line.at (1 ));
164
153
165
- return findCollisionSegment (path, stop_line_p1, stop_line_p2, target_lane_id );
154
+ return findCollisionSegment (path, stop_line_p1, stop_line_p2);
166
155
}
167
156
168
157
template <class T >
@@ -265,10 +254,10 @@ geometry_msgs::msg::Pose calcTargetPose(const T & path, const PathIndexWithOffse
265
254
266
255
inline boost::optional<PathIndexWithPose> createTargetPoint (
267
256
const autoware_auto_planning_msgs::msg::PathWithLaneId & path, const LineString2d & stop_line,
268
- const size_t lane_id, const double margin, const double vehicle_offset)
257
+ const double margin, const double vehicle_offset)
269
258
{
270
259
// Find collision segment
271
- const auto collision_segment = findCollisionSegment (path, stop_line, lane_id );
260
+ const auto collision_segment = findCollisionSegment (path, stop_line);
272
261
if (!collision_segment) {
273
262
// No collision
274
263
return {};
0 commit comments