HLR  0.0.1
LidarInterpreter.hpp
1 #ifndef LIDAR_INTERPRETER_HPP
2 #define LIDAR_INTERPRETER_HPP
3 
4 #include <cstdint>
5 #include "ISensorInterpreter.hpp"
6 #include <pcl/point_cloud.h>
7 #include <pcl/point_types.h>
8 
9 namespace HLR
10 {
11 namespace PointCloud
12 {
18 {
19 public:
26  LidarInterpreter() = default;
37  std::vector<Object> get_objects(
38  const HLR::Vision::CupDetection& detected_cups) override;
39 
40 private:
41  struct Cup
42  {
43  Object::Point centerpoint;
44  double upper_radius;
45  double lower_radius;
46  double height;
47  std::uint32_t id;
48  };
49  using PointCloudWithId =
50  std::pair<pcl::PointCloud<pcl::PointXYZ>, std::uint32_t>;
51 
52  static Object convert_cup_to_polyhedron(const Cup& cup_in_robot_arm_space);
53  static Cup translate_lidar_to_robot_arm(const Cup& cup_in_lidar_space);
54  static Cup get_centerpoint_from_contour(
55  const PointCloudWithId& point_cloud_with_id);
56  PointCloudWithId find_contour(double angle);
57  static double translate_kinect_to_lidar(
58  const std::shared_ptr<cv::Mat>& frame,
59  const cv::Point& point);
60 };
61 
62 } // namespace PointCloud
63 } // namespace HLR
64 
65 #endif /*LIDAR_INTERPRETER_HPP */
A class for mapping the ROS::Object defined in msg/Object.msg.
Definition: Object.hpp:22
CGAL::Simple_cartesian< double >::Point_3 Point
Data type specifying a point in 3D space.
Definition: Object.hpp:27
std::vector< Object > get_objects(const HLR::Vision::CupDetection &detected_cups) override
Construct the objects in the given CupDetection.
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:16
A class responsible for reading and interpreting the LiDAR data.
Definition: LidarInterpreter.hpp:17