Skip to content

Commit 981660e

Browse files
authored
Merge branch 'main' into feat/subdivide_ekf_localizer_diagnostics_items
2 parents f914182 + c15de78 commit 981660e

2 files changed

Lines changed: 38 additions & 32 deletions

File tree

planning/motion_velocity_planner/autoware_motion_velocity_planner_common/include/autoware/motion_velocity_planner_common/polygon_utils.hpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,14 @@ std::vector<PointWithStamp> get_collision_points(
9696
std::vector<double> calc_front_outer_wheel_off_tracking(
9797
const std::vector<TrajectoryPoint> & traj_points, const VehicleInfo & vehicle_info);
9898

99+
/**
100+
* @brief estimate the future ego pose with assuming that the pose error against the reference path
101+
* will decrease to zero by the time_to_convergence.
102+
**/
103+
std::vector<geometry_msgs::msg::Pose> calculate_error_poses(
104+
const std::vector<TrajectoryPoint> & traj_points,
105+
const geometry_msgs::msg::Pose & current_ego_pose, const double time_to_convergence);
106+
99107
/**
100108
* @brief return MultiPolygon whose each element represents a convex polygon comprising footprint
101109
* at the corresponding index position + footprint at the previous index position

planning/motion_velocity_planner/autoware_motion_velocity_planner_common/src/polygon_utils.cpp

Lines changed: 30 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,36 @@ std::optional<std::pair<size_t, std::vector<PointWithStamp>>> get_collision_inde
101101
return std::nullopt;
102102
}
103103

104-
// estimate the future ego pose with assuming that the pose error against the reference path will
105-
// decrease to zero by the time_to_convergence.
104+
Polygon2d create_pose_footprint(
105+
const geometry_msgs::msg::Pose & pose, const VehicleInfo & vehicle_info, const double left_margin,
106+
const double right_margin)
107+
{
108+
using autoware_utils_geometry::calc_offset_pose;
109+
const double half_width = vehicle_info.vehicle_width_m / 2.0;
110+
const auto point0 =
111+
calc_offset_pose(pose, vehicle_info.max_longitudinal_offset_m, half_width + left_margin, 0.0)
112+
.position;
113+
const auto point1 =
114+
calc_offset_pose(pose, vehicle_info.max_longitudinal_offset_m, -half_width - right_margin, 0.0)
115+
.position;
116+
const auto point2 =
117+
calc_offset_pose(pose, -vehicle_info.rear_overhang_m, -half_width - right_margin, 0.0).position;
118+
const auto point3 =
119+
calc_offset_pose(pose, -vehicle_info.rear_overhang_m, half_width + left_margin, 0.0).position;
120+
121+
Polygon2d polygon;
122+
boost::geometry::append(polygon, msg_to_2d(point0));
123+
boost::geometry::append(polygon, msg_to_2d(point1));
124+
boost::geometry::append(polygon, msg_to_2d(point2));
125+
boost::geometry::append(polygon, msg_to_2d(point3));
126+
boost::geometry::append(polygon, msg_to_2d(point0));
127+
128+
boost::geometry::correct(polygon);
129+
return polygon;
130+
};
131+
132+
} // namespace
133+
106134
// FIXME(soblin): convergence should be applied from nearest_idx ?
107135
std::vector<geometry_msgs::msg::Pose> calculate_error_poses(
108136
const std::vector<TrajectoryPoint> & traj_points,
@@ -145,36 +173,6 @@ std::vector<geometry_msgs::msg::Pose> calculate_error_poses(
145173
return error_poses;
146174
}
147175

148-
Polygon2d create_pose_footprint(
149-
const geometry_msgs::msg::Pose & pose, const VehicleInfo & vehicle_info, const double left_margin,
150-
const double right_margin)
151-
{
152-
using autoware_utils_geometry::calc_offset_pose;
153-
const double half_width = vehicle_info.vehicle_width_m / 2.0;
154-
const auto point0 =
155-
calc_offset_pose(pose, vehicle_info.max_longitudinal_offset_m, half_width + left_margin, 0.0)
156-
.position;
157-
const auto point1 =
158-
calc_offset_pose(pose, vehicle_info.max_longitudinal_offset_m, -half_width - right_margin, 0.0)
159-
.position;
160-
const auto point2 =
161-
calc_offset_pose(pose, -vehicle_info.rear_overhang_m, -half_width - right_margin, 0.0).position;
162-
const auto point3 =
163-
calc_offset_pose(pose, -vehicle_info.rear_overhang_m, half_width + left_margin, 0.0).position;
164-
165-
Polygon2d polygon;
166-
boost::geometry::append(polygon, msg_to_2d(point0));
167-
boost::geometry::append(polygon, msg_to_2d(point1));
168-
boost::geometry::append(polygon, msg_to_2d(point2));
169-
boost::geometry::append(polygon, msg_to_2d(point3));
170-
boost::geometry::append(polygon, msg_to_2d(point0));
171-
172-
boost::geometry::correct(polygon);
173-
return polygon;
174-
};
175-
176-
} // namespace
177-
178176
std::optional<std::pair<geometry_msgs::msg::Point, double>> get_collision_point(
179177
const std::vector<TrajectoryPoint> & traj_points, const std::vector<Polygon2d> & traj_polygons,
180178
const geometry_msgs::msg::Point obj_position, const rclcpp::Time obj_stamp,

0 commit comments

Comments
 (0)