@@ -45,16 +45,27 @@ using autoware_perception_msgs::msg::Shape;
45
45
using geometry_msgs::msg::Pose;
46
46
using geometry_msgs::msg::Twist;
47
47
48
+ /* *
49
+ * @brief Checks if the object is coming toward the ego vehicle judging by yaw deviation
50
+ * @param vehicle_pose Ego vehicle pose.
51
+ * @param object_pose Object pose.
52
+ * @param angle_threshold Angle threshold.
53
+ * @return True if the object vehicle is coming towards the ego vehicle
54
+ */
48
55
bool isTargetObjectOncoming (
49
56
const geometry_msgs::msg::Pose & vehicle_pose, const geometry_msgs::msg::Pose & object_pose,
50
57
const double angle_threshold = M_PI_2);
51
58
59
+ /* *
60
+ * @brief Checks if the object is in front of the ego vehicle.
61
+ * @param ego_pose Ego vehicle pose.
62
+ * @param obj_polygon Polygon of object.
63
+ * @param base_to_front Base link to vehicle front.
64
+ * @return True if object is in front.
65
+ */
52
66
bool isTargetObjectFront (
53
67
const geometry_msgs::msg::Pose & ego_pose, const Polygon2d & obj_polygon,
54
- const autoware::vehicle_info_utils::VehicleInfo & vehicle_info);
55
- bool isTargetObjectFront (
56
- const PathWithLaneId & path, const geometry_msgs::msg::Pose & ego_pose,
57
- const autoware::vehicle_info_utils::VehicleInfo & vehicle_info, const Polygon2d & obj_polygon);
68
+ const double base_to_front);
58
69
59
70
Polygon2d createExtendedPolygon (
60
71
const Pose & base_link_pose, const autoware::vehicle_info_utils::VehicleInfo & vehicle_info,
@@ -72,7 +83,15 @@ double calcRssDistance(
72
83
const double front_object_velocity, const double rear_object_velocity,
73
84
const RSSparams & rss_params);
74
85
75
- double calcMinimumLongitudinalLength (
86
+ /* *
87
+ * @brief Calculates the minimum longitudinal length using rss parameter. The object is either ego
88
+ * vehicle or target object.
89
+ * @param front_object_velocity Front object velocity.
90
+ * @param rear_object_velocity Front object velocity.
91
+ * @param RSSparams RSS parameters
92
+ * @return Maximum distance.
93
+ */
94
+ double calc_minimum_longitudinal_length (
76
95
const double front_object_velocity, const double rear_object_velocity,
77
96
const RSSparams & rss_params);
78
97
@@ -84,15 +103,19 @@ double calcMinimumLongitudinalLength(
84
103
* it contains the interpolated pose, velocity, and time. If the interpolation fails
85
104
* (e.g., empty path, negative time, or time beyond the path), it returns std::nullopt.
86
105
*/
87
- std::optional<PoseWithVelocityStamped> calcInterpolatedPoseWithVelocity (
106
+ std::optional<PoseWithVelocityStamped> calc_interpolated_pose_with_velocity (
88
107
const std::vector<PoseWithVelocityStamped> & path, const double relative_time);
89
108
90
- std::optional<PoseWithVelocityAndPolygonStamped> getInterpolatedPoseWithVelocityAndPolygonStamped (
109
+ std::optional<PoseWithVelocityAndPolygonStamped>
110
+ get_interpolated_pose_with_velocity_and_polygon_stamped (
91
111
const std::vector<PoseWithVelocityStamped> & pred_path, const double current_time,
92
112
const VehicleInfo & ego_info);
93
- std::optional<PoseWithVelocityAndPolygonStamped> getInterpolatedPoseWithVelocityAndPolygonStamped (
113
+
114
+ std::optional<PoseWithVelocityAndPolygonStamped>
115
+ get_interpolated_pose_with_velocity_and_polygon_stamped (
94
116
const std::vector<PoseWithVelocityStamped> & pred_path, const double current_time,
95
117
const Shape & shape);
118
+
96
119
template <typename T, typename F>
97
120
std::vector<T> filterPredictedPathByTimeHorizon (
98
121
const std::vector<T> & path, const double time_horizon, const F & interpolateFunc);
@@ -151,14 +174,13 @@ bool checkCollision(
151
174
* @param debug The debug information for collision checking.
152
175
* @return a list of polygon when collision is expected.
153
176
*/
154
- std::vector<Polygon2d> getCollidedPolygons (
177
+ std::vector<Polygon2d> get_collided_polygons (
155
178
const PathWithLaneId & planned_path,
156
179
const std::vector<PoseWithVelocityStamped> & predicted_ego_path,
157
180
const ExtendedPredictedObject & target_object,
158
- const PredictedPathWithPolygon & target_object_path,
159
- const BehaviorPathPlannerParameters & common_parameters, const RSSparams & rss_parameters,
160
- const double hysteresis_factor, const double max_velocity_limit, const double yaw_difference_th,
161
- CollisionCheckDebug & debug);
181
+ const PredictedPathWithPolygon & target_object_path, const VehicleInfo & vehicle_info,
182
+ const RSSparams & rss_parameters, const double hysteresis_factor, const double max_velocity_limit,
183
+ const double yaw_difference_th, CollisionCheckDebug & debug);
162
184
163
185
bool checkPolygonsIntersects (
164
186
const std::vector<Polygon2d> & polys_1, const std::vector<Polygon2d> & polys_2);
@@ -167,8 +189,30 @@ bool checkSafetyWithIntegralPredictedPolygon(
167
189
const ExtendedPredictedObjects & objects, const bool check_all_predicted_path,
168
190
const IntegralPredictedPolygonParams & params, CollisionCheckDebugMap & debug_map);
169
191
170
- double calcObstacleMinLength (const Shape & shape);
171
- double calcObstacleMaxLength (const Shape & shape);
192
+ /* *
193
+ * @brief Calculates the minimum length from obstacle centroid to outer point.
194
+ * @param shape Object shape.
195
+ * @return Minimum distance.
196
+ */
197
+ double calc_obstacle_min_length (const Shape & shape);
198
+
199
+ /* *
200
+ * @brief Calculates the maximum length from obstacle centroid to outer point.
201
+ * @param shape Object shape.
202
+ * @return Maximum distance.
203
+ */
204
+ double calc_obstacle_max_length (const Shape & shape);
205
+
206
+ /* *
207
+ * @brief Calculate collision roughly by comparing minimum/maximum distance with margin.
208
+ * @param path The path of the ego vehicle.
209
+ * @param objects The predicted objects.
210
+ * @param margin Distance margin to judge collision.
211
+ * @param parameters The common parameters used in behavior path planner.
212
+ * @param use_offset_ego_point If true, the closest point to the object is calculated by
213
+ * interpolating the path points.
214
+ * @return Collision (rough) between minimum distance and maximum distance
215
+ */
172
216
std::pair<bool , bool > checkObjectsCollisionRough (
173
217
const PathWithLaneId & path, const PredictedObjects & objects, const double margin,
174
218
const BehaviorPathPlannerParameters & parameters, const bool use_offset_ego_point);
0 commit comments