HLR  0.0.1
ObjectInterpreter.hpp
1 #ifndef OBJECTINTERPRETER_HPP
2 #define OBJECTINTERPRETER_HPP
3 
4 #include <chrono>
5 #include <vector>
6 #include <boost/circular_buffer.hpp>
7 #include "LidarInterpreter.hpp"
8 #include "Object.hpp"
9 #include <pcl/point_cloud.h>
10 #include <pcl/point_types.h>
11 
12 namespace HLR
13 {
14 namespace PointCloud
15 {
22 {
23 public:
45  std::vector<Object> get_current_objects(
46  const HLR::Vision::CupDetection& detected_cups,
47  const pcl::PointCloud<pcl::PointXYZ>& point_cloud);
48 
66  std::vector<Object> get_changed_objects(
67  const HLR::Vision::CupDetection& detected_cups,
68  const pcl::PointCloud<pcl::PointXYZ>& point_cloud);
69 
78  std::vector<Object> determine_speed(std::vector<Object>& objects,
79  long milliseconds_since_epoch = -1);
80 
81 private:
82  void add_only_changed_objects(const Object& object,
83  std::vector<Object>& changed_objects) const;
84  void merge_objects(const HLR::Vision::CupDetection& detected_cups,
85  const pcl::PointCloud<pcl::PointXYZ>& point_cloud);
86 
87  // milliseconds since epoch
88  long last_measure_time;
98  std::vector<Object> isolate_objects(
99  const pcl::PointCloud<pcl::PointXYZ>& newest_cloud);
100  std::vector<Object> current_objects;
101  boost::circular_buffer<std::vector<Object>> history =
102  boost::circular_buffer<std::vector<Object>>(5);
103  LidarInterpreter lidar_interpreter;
104 };
105 } // namespace PointCloud
106 } // namespace HLR
107 #endif /* OBJECTINTERPRETER_HPP */
Class responsible for merging the world data from the Kinect and the LiDAR.
Definition: ObjectInterpreter.hpp:21
A class for mapping the ROS::Object defined in msg/Object.msg.
Definition: Object.hpp:24
std::vector< Object > get_changed_objects(const HLR::Vision::CupDetection &detected_cups, const pcl::PointCloud< pcl::PointXYZ > &point_cloud)
Returns all the objects visible at this moment that changed since last call of this function...
std::vector< Object > get_current_objects(const HLR::Vision::CupDetection &detected_cups, const pcl::PointCloud< pcl::PointXYZ > &point_cloud)
Returns all the objects visible at this moment.
std::vector< Object > determine_speed(std::vector< Object > &objects, long milliseconds_since_epoch=-1)
Calculates the speed of the objects in de list based on the middlepoint and given ID...
Collection of detected cups Collection of detected cups where the location of the cups is described i...
Definition: ICupDetector.hpp:17
A class responsible for reading and interpreting the LiDAR data.
Definition: LidarInterpreter.hpp:24