PointCloud2Interpreter.h
Go to the documentation of this file.
1 #include <ros/ros.h>
2 #include <tf2_ros/buffer.h>
4 
5 #ifdef PC2ARRAY
6 #include <find_moving_objects/PointCloud2Array.h>
7 #else
8 #include <sensor_msgs/PointCloud2.h>
9 #endif
10 
12 
13 #ifdef NODELET
14 #include <nodelet/nodelet.h>
15 #endif
16 
17 namespace find_moving_objects
18 {
19 
20 #ifdef NODELET
21 # ifdef PC2ARRAY
22 class PointCloud2ArrayInterpreterNodelet : public nodelet::Nodelet
23 # else
24 class PointCloud2InterpreterNodelet : public nodelet::Nodelet
25 # endif
26 #endif
27 #ifdef NODE
28 # ifdef PC2ARRAY
29 class PointCloud2ArrayInterpreterNode
30 # else
31 class PointCloud2InterpreterNode
32 # endif
33 #endif
34 {
35 private:
36  /* DEFAULT PARAMETER VALUES */
38 
39  /* SUBSCRIBE INFO */
40  std::string subscribe_topic;
42 
43  /* HZ CALCULATION */
47  const int max_messages = 100;
48  double start_time;
49  const double max_time = 1.5;
50 
51  /* BANK AND ARGUMENT */
52  std::vector<Bank *> banks;
53  std::vector<BankArgument> bank_arguments;
54 
55  /* TF LISTENER, BUFFER AND TARGET FRAME */
58  std::vector<std::string> tf_filter_target_frames;
59 
60  /* NODE HANDLES (ROS must be initialized when object is created) */
63 
64  /* STATES OF MESSAGE RECEIVING */
65  typedef enum
66  {
69  INIT_BANKS,
71  } state_t;
72  state_t state;
73 
74 #ifdef PC2ARRAY
75  /* MESSAGE FILTER */
78 
79  /* CALLBACK */
80  void pointCloud2ArrayCallback(const find_moving_objects::PointCloud2Array::ConstPtr & msg);
81 #else
82  /* MESSAGE FILTER */
85 
86  /* CALLBACK */
87  void pointCloud2Callback(const sensor_msgs::PointCloud2::ConstPtr & msg);
88 #endif
89 
90 public:
91  /* CONSTRUCTOR & DESTRUCTOR */
92 #ifdef NODELET
93 # ifdef PC2ARRAY
94  PointCloud2ArrayInterpreterNodelet();
95  ~PointCloud2ArrayInterpreterNodelet();
96 # else
97  PointCloud2InterpreterNodelet();
98  ~PointCloud2InterpreterNodelet();
99 # endif
100 
101  virtual void onInit();
102 #endif
103 #ifdef NODE
104 # ifdef PC2ARRAY
105  PointCloud2ArrayInterpreterNode();
106  ~PointCloud2ArrayInterpreterNode();
107 # else
108  PointCloud2InterpreterNode();
109  ~PointCloud2InterpreterNode();
110 # endif
111 
112  void onInit();
113 #endif
114 };
115 
116 } // namespace find_moving_objects
message_filters::Subscriber< sensor_msgs::LaserScan > * tf_subscriber
std::vector< BankArgument > bank_arguments
tf2_ros::TransformListener * tf_listener
tf2_ros::MessageFilter< sensor_msgs::LaserScan > * tf_filter
std::vector< Bank * > banks
void pointCloud2Callback(const sensor_msgs::PointCloud2::ConstPtr &msg)
tf2_ros::Buffer * tf_buffer
std::vector< std::string > tf_filter_target_frames


find_moving_objects
Author(s): Andreas Gustavsson
autogenerated on Mon Jun 10 2019 13:13:19