17#include <carma_perception_msgs/msg/roadway_obstacle_list.hpp>
18#include <carma_perception_msgs/msg/roadway_obstacle.hpp>
19#include <carma_v2x_msgs/msg/vehicle_size.hpp>
20#include <carma_planning_msgs/msg/trajectory_plan.hpp>
21#include <geometry_msgs/msg/vector3.hpp>
23#include <boost/geometry.hpp>
24#include <boost/geometry/geometries/point_xy.hpp>
25#include <boost/foreach.hpp>
27#include <boost/assign/std/vector.hpp>
33#include <tf2/LinearMath/Transform.h>
34#include <tf2_geometry_msgs/tf2_geometry_msgs.h>
36#include <rclcpp/rclcpp.hpp>
40 namespace collision_detection {
42 typedef boost::geometry::model::point<double, 2, boost::geometry::cs::cartesian>
point_t;
43 typedef boost::geometry::model::polygon<point_t>
polygon_t;
49 std::vector<std::tuple <__uint64_t, polygon_t>>
fp;
66 std::vector<carma_perception_msgs::msg::RoadwayObstacle>
WorldCollisionDetection(
const carma_perception_msgs::msg::RoadwayObstacleList& rwol,
67 const carma_planning_msgs::msg::TrajectoryPlan& tp,
const geometry_msgs::msg::Vector3& size,
68 const geometry_msgs::msg::Twist& velocity);
106 P
ObjectToBoostPolygon(
const geometry_msgs::msg::Pose& pose,
const geometry_msgs::msg::Vector3& size);
bool DetectCollision(collision_detection::MovingObject const &ob_1, collision_detection::MovingObject const &ob_2, __uint64_t target_time)
.function is used in WorldCollisionDetection to detection collision between two Moving Object
boost::geometry::model::polygon< point_t > polygon_t
collision_detection::MovingObject ConvertVehicleToMovingObject(const carma_planning_msgs::msg::TrajectoryPlan &tp, const geometry_msgs::msg::Vector3 &size, const geometry_msgs::msg::Twist &veloctiy)
Creates collision_detection::MovingObject for the host vehicle using the veloctiy,...
boost::geometry::model::point< double, 2, boost::geometry::cs::cartesian > point_t
collision_detection::MovingObject ConvertRoadwayObstacleToMovingObject(const carma_perception_msgs::msg::RoadwayObstacle &rwo)
Convert RodwayObstable object to the collision_detection::MovingObject.
bool CheckPolygonIntersection(collision_detection::MovingObject const &ob_1, collision_detection::MovingObject const &ob_2)
.check Intersection between polygons
collision_detection::MovingObject PredictObjectPosition(collision_detection::MovingObject const &op, __uint64_t target_time)
.function is to create a monving object with a polygon that represents area that object is going to a...
std::vector< carma_perception_msgs::msg::RoadwayObstacle > WorldCollisionDetection(const carma_perception_msgs::msg::RoadwayObstacleList &rwol, const carma_planning_msgs::msg::TrajectoryPlan &tp, const geometry_msgs::msg::Vector3 &size, const geometry_msgs::msg::Twist &velocity)
Main collision detection function to be called when needed to check for collision detection of the ve...
P ObjectToBoostPolygon(const geometry_msgs::msg::Pose &pose, const geometry_msgs::msg::Vector3 &size)
function to create a polygon representing and object
std::vector< std::tuple< __uint64_t, polygon_t > > fp
geometry_msgs::msg::Vector3 linear_velocity