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  // TEMPORARY FIX: keep the id's of the last cups, delete the rest.
87  void tolerance_based_object_detection(double cup_tolerance);
88 
89  // milliseconds since epoch
90  long last_measure_time;
100  std::vector<Object> isolate_objects(
101  const pcl::PointCloud<pcl::PointXYZ>& newest_cloud);
102  std::vector<Object> current_objects;
103  boost::circular_buffer<std::vector<Object>> history =
104  boost::circular_buffer<std::vector<Object>>(5);
105  LidarInterpreter lidar_interpreter;
106 };
107 } // namespace PointCloud
108 } // namespace HLR
109 #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