15 #ifndef GEOMETRY__BOUNDING_BOX_HPP_
16 #define GEOMETRY__BOUNDING_BOX_HPP_
18 #include <boost/assert.hpp>
19 #include <boost/assign/list_of.hpp>
20 #include <boost/geometry.hpp>
21 #include <boost/geometry/algorithms/disjoint.hpp>
22 #include <boost/geometry/geometries/linestring.hpp>
23 #include <boost/geometry/geometries/point_xy.hpp>
24 #include <boost/numeric/conversion/bounds.hpp>
26 #include <geometry_msgs/msg/pose.hpp>
28 #include <traffic_simulator_msgs/msg/bounding_box.hpp>
36 using boost_point = boost::geometry::model::d2::point_xy<double>;
50 const geometry_msgs::msg::Pose & pose0,
const traffic_simulator_msgs::msg::BoundingBox & bbox0,
51 const geometry_msgs::msg::Pose & pose1,
const traffic_simulator_msgs::msg::BoundingBox & bbox1);
52 std::optional<std::pair<geometry_msgs::msg::Pose, geometry_msgs::msg::Pose>>
getClosestPoses(
53 const geometry_msgs::msg::Pose & pose0,
const traffic_simulator_msgs::msg::BoundingBox & bbox0,
54 const geometry_msgs::msg::Pose & pose1,
const traffic_simulator_msgs::msg::BoundingBox & bbox1);
61 const geometry_msgs::msg::Pose & pose1,
const geometry_msgs::msg::Pose & pose2);
62 auto toPolygon2D(
const traffic_simulator_msgs::msg::BoundingBox & bounding_box)
63 -> std::vector<geometry_msgs::msg::Point>;
65 const geometry_msgs::msg::Pose & pose,
66 const traffic_simulator_msgs::msg::BoundingBox & bounding_box) ->
boost_polygon;
68 const traffic_simulator_msgs::msg::BoundingBox & bounding_box,
69 const double width_extension_right = 0.0,
const double width_extension_left = 0.0,
70 const double length_extension_front = 0.0,
const double length_extension_rear = 0.0);
72 const traffic_simulator_msgs::msg::BoundingBox & bounding_box);
boost_polygon toBoostPolygon(const std::vector< geometry_msgs::msg::Point > &points)
Definition: bounding_box.cpp:221
auto toPolygon2D(const traffic_simulator_msgs::msg::BoundingBox &bounding_box) -> std::vector< geometry_msgs::msg::Point >
Definition: bounding_box.cpp:160
boost::geometry::model::polygon< boost_point > boost_polygon
Definition: bounding_box.hpp:37
std::optional< std::pair< geometry_msgs::msg::Pose, geometry_msgs::msg::Pose > > getClosestPoses(const geometry_msgs::msg::Pose &pose0, const traffic_simulator_msgs::msg::BoundingBox &bbox0, const geometry_msgs::msg::Pose &pose1, const traffic_simulator_msgs::msg::BoundingBox &bbox1)
Definition: bounding_box.cpp:58
boost_point pointToSegmentProjection(const boost_point &p, const boost_point &p1, const boost_point &p2)
Definition: bounding_box.cpp:102
DistancesFromCenterToEdge getDistancesFromCenterToEdge(const traffic_simulator_msgs::msg::BoundingBox &bounding_box)
Definition: bounding_box.cpp:252
boost_point toBoostPoint(const geometry_msgs::msg::Point &point)
Definition: bounding_box.cpp:216
std::vector< geometry_msgs::msg::Point > getPointsFromBbox(const traffic_simulator_msgs::msg::BoundingBox &bounding_box, const double width_extension_right=0.0, const double width_extension_left=0.0, const double length_extension_front=0.0, const double length_extension_rear=0.0)
Definition: bounding_box.cpp:130
geometry_msgs::msg::Pose toPose(const boost_point &point)
Definition: bounding_box.cpp:232
geometry_msgs::msg::Pose subtractPoses(const geometry_msgs::msg::Pose &pose1, const geometry_msgs::msg::Pose &pose2)
Definition: bounding_box.cpp:241
boost::geometry::model::d2::point_xy< double > boost_point
Definition: bounding_box.hpp:36
std::optional< double > getPolygonDistance(const geometry_msgs::msg::Pose &pose0, const traffic_simulator_msgs::msg::BoundingBox &bbox0, const geometry_msgs::msg::Pose &pose1, const traffic_simulator_msgs::msg::BoundingBox &bbox1)
Get the Polygon Distance object.
Definition: bounding_box.cpp:38
Definition: bounding_box.hpp:32
Definition: bounding_box.hpp:40
double right
Definition: bounding_box.hpp:43
double left
Definition: bounding_box.hpp:44
double up
Definition: bounding_box.hpp:45
double front
Definition: bounding_box.hpp:41
double rear
Definition: bounding_box.hpp:42
double down
Definition: bounding_box.hpp:46