1 #ifndef LIDAR_INTERPRETER_HPP 2 #define LIDAR_INTERPRETER_HPP 6 #include "ISensorInterpreter.hpp" 7 #include "Vision/ICupDetector.hpp" 9 #include "Vision/mock/MockCupDetector.hpp" 11 #include "Vision/CupDetector.hpp" 13 #include <pcl/point_cloud.h> 14 #include <pcl/point_types.h> 40 const pcl::PointCloud<pcl::PointXYZ>& point_cloud)
override;
52 using PointCloudWithId =
53 std::pair<pcl::PointCloud<pcl::PointXYZ>, std::uint32_t>;
55 struct CupMeasurements
60 CupMeasurements() =
default;
62 CupMeasurements(
double upper_radius,
double lower_radius,
double height)
63 : upper_radius(upper_radius)
64 , lower_radius(lower_radius)
69 static Object convert_cup_to_polyhedron(
70 const Cup& cup_in_robot_arm_space,
71 const pcl::PointCloud<pcl::PointXYZ>& point_cloud);
72 static Cup translate_lidar_to_robot_arm(
const Cup& cup_in_lidar_space);
73 static Cup get_centerpoint_from_contour(
74 const PointCloudWithId& point_cloud_with_id);
75 PointCloudWithId find_contour(
77 const pcl::PointCloud<pcl::PointXYZ>& newest_cloud);
78 static double translate_kinect_to_lidar(
79 const std::shared_ptr<cv::Mat>& distance_frame,
80 const cv::Point& location_cup);
81 bool is_angle_in_angle_range(
double input,
84 std::vector<PointCloudWithId> pointcloud_database;
85 unsigned long highest_pointcloud_id = 0;
86 std::unique_ptr<HLR::Vision::ICupDetector> cup_detector
88 = std::make_unique<HLR::Vision::MockCupDetector>();
90 = std::make_unique<HLR::Vision::CupDetector>();
93 static constexpr
double distance_kinect_lidar = 0.082;
94 static constexpr
unsigned number_of_cylinder_faces = 24;
98 static const CupMeasurements
100 static constexpr
double lidar_height = 0.032;
101 static const CGAL::Simple_cartesian<double>::Vector_3
102 lidar_to_robot_arm_translation;
A class for mapping the ROS::Object defined in msg/Object.msg.
Definition: Object.hpp:24
CGAL::Simple_cartesian< double >::Point_3 Point
Data type specifying a point in 3D space.
Definition: Object.hpp:29
Collection of detected cups Collection of detected cups where the location of the cups is described i...
Definition: ICupDetector.hpp:17
An abstract class responsible for reading and interpreting the data from a device interpreting the wo...
Definition: ISensorInterpreter.hpp:18
std::vector< Object > get_objects(const HLR::Vision::CupDetection &detected_cups, const pcl::PointCloud< pcl::PointXYZ > &point_cloud) override
Construct the objects in the given CupDetection.
A class responsible for reading and interpreting the LiDAR data.
Definition: LidarInterpreter.hpp:24