Skip to content

Commit

Permalink
perf(dynamic_obstacle_stop): create rtree with packing algorithm (aut…
Browse files Browse the repository at this point in the history
…owarefoundation#7730)

Signed-off-by: Maxime CLEMENT <maxime.clement@tier4.jp>
  • Loading branch information
maxime-clem authored and mitukou1109 committed Jul 2, 2024
1 parent 78dc362 commit 306c915
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,14 @@ void make_ego_footprint_rtree(EgoData & ego_data, const PlannerParam & params)
for (const auto & p : ego_data.trajectory)
ego_data.trajectory_footprints.push_back(autoware::universe_utils::toFootprint(
p.pose, params.ego_longitudinal_offset, 0.0, params.ego_lateral_offset * 2.0));
std::vector<BoxIndexPair> rtree_nodes;
rtree_nodes.reserve(ego_data.trajectory_footprints.size());
for (auto i = 0UL; i < ego_data.trajectory_footprints.size(); ++i) {
const auto box = boost::geometry::return_envelope<autoware::universe_utils::Box2d>(
ego_data.trajectory_footprints[i]);
ego_data.rtree.insert(std::make_pair(box, i));
rtree_nodes.push_back(std::make_pair(box, i));
}
ego_data.rtree = Rtree(rtree_nodes);
}

} // namespace autoware::motion_velocity_planner::dynamic_obstacle_stop

0 comments on commit 306c915

Please sign in to comment.