@@ -113,42 +113,69 @@ std::vector<std::pair<lanelet::ConstPoints3d, std::pair<double, double>>> get_wa
113
113
const double group_separation_threshold, const double interval_margin_ratio);
114
114
115
115
/* *
116
- * @brief get position of first self-intersection (point where return
117
- * path intersects outward path) of lanelet sequence in arc length
118
- * @param lanelet_sequence target lanelet sequence (both left and right bound are
119
- * considered)
120
- * @param s_start longitudinal distance of point to start searching for self-intersections
116
+ * @brief get position of first intersection (including self-intersection) in lanelet sequence in
117
+ * arc length
118
+ * @param lanelet_sequence target lanelet sequence
119
+ * @param s_start longitudinal distance of point to start searching for intersections
121
120
* @param s_end longitudinal distance of point to end search
122
- * @return longitudinal distance of self-intersecting point (std::nullopt if no
123
- * self- intersection)
121
+ * @param vehicle_length vehicle length
122
+ * @return longitudinal distance of intersecting point (std::nullopt if no intersection)
124
123
*/
125
- std::optional<double > get_first_self_intersection_arc_length (
126
- const lanelet::LaneletSequence & lanelet_sequence, const double s_start, const double s_end);
124
+ std::optional<double > get_first_intersection_arc_length (
125
+ const lanelet::LaneletSequence & lanelet_sequence, const double s_start, const double s_end,
126
+ const double vehicle_length);
127
127
128
128
/* *
129
- * @brief get position of first self-intersection of line string in arc length
129
+ * @brief get position of first self-intersection (point where return
130
+ * path intersects outward path) of line string in arc length
130
131
* @param line_string target line string
131
- * @param s_start longitudinal distance of point to start searching for self-intersections
132
- * @param s_end longitudinal distance of point to end search
133
132
* @return longitudinal distance of self-intersecting point (std::nullopt if no
134
133
* self-intersection)
135
134
*/
136
135
std::optional<double > get_first_self_intersection_arc_length (
137
- const lanelet::BasicLineString2d & line_string, const double s_start, const double s_end);
136
+ const lanelet::BasicLineString2d & line_string);
137
+
138
+ /* *
139
+ * @brief get path bounds for PathWithLaneId cropped within specified range
140
+ * @param lanelet_sequence lanelet sequence
141
+ * @param s_start longitudinal distance of start of bound on centerline
142
+ * @param s_end longitudinal distance of end of bound on centerline
143
+ * @return cropped bounds (left / right)
144
+ */
145
+ std::array<std::vector<geometry_msgs::msg::Point >, 2 > get_path_bounds (
146
+ const lanelet::LaneletSequence & lanelet_sequence, const double s_start, const double s_end);
138
147
139
148
/* *
140
- * @brief get path bound for PathWithLaneId cropped within specified range
141
- * @param lanelet_bound original bound of lanelet
142
- * @param lanelet_centerline centerline of lanelet
143
- * @param s_start longitudinal distance of start of bound
144
- * @param s_end longitudinal distance of end of bound
145
- * @return cropped bound
149
+ * @brief crop line string
150
+ * @param line_string line string
151
+ * @param s_start longitudinal distance to crop from
152
+ * @param s_end longitudinal distance to crop to
153
+ * @return cropped line string
146
154
*/
147
- std::vector<geometry_msgs::msg::Point > get_path_bound (
148
- const lanelet::CompoundLineString3d & lanelet_bound,
149
- const lanelet::CompoundLineString2d & lanelet_centerline, const double s_start,
155
+ std::vector<geometry_msgs::msg::Point > crop_line_string (
156
+ const std::vector<geometry_msgs::msg::Point > & line_string, const double s_start,
150
157
const double s_end);
151
158
159
+ /* *
160
+ * @brief get positions of given point on centerline projected to left / right bound in arc length
161
+ * @param lanelet_sequence lanelet sequence
162
+ * @param s_centerline longitudinal distance of point on centerline
163
+ * @return longitudinal distance of projected point (left / right)
164
+ */
165
+ std::array<double , 2 > get_arc_length_on_bounds (
166
+ const lanelet::LaneletSequence & lanelet_sequence, const double s_centerline);
167
+
168
+ /* *
169
+ * @brief get positions of given point on left / right bound projected to centerline in arc length
170
+ * @param lanelet_sequence lanelet sequence
171
+ * @param s_left_bound longitudinal distance of point on left bound
172
+ * @param s_right_bound longitudinal distance of point on left bound
173
+ * @return longitudinal distance of projected point (left / right)
174
+ */
175
+ std::array<std::optional<double >, 2 > get_arc_length_on_centerline (
176
+ const lanelet::LaneletSequence & lanelet_sequence, const std::optional<double > & s_left_bound,
177
+ const std::optional<double > & s_right_bound);
178
+
152
179
/* *
153
180
* @brief Recreate the goal pose to prevent the goal point being too far from the lanelet, which
154
181
* causes the path to twist near the goal.
0 commit comments