scan_unifier_node.h
Go to the documentation of this file.
1 /*
2  * Copyright 2017 Fraunhofer Institute for Manufacturing Engineering and Automation (IPA)
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9 
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 
18 #ifndef SCAN_UNIFIER_NODE_H
19 #define SCAN_UNIFIER_NODE_H
20 
21 //##################
22 //#### includes ####
23 
24 // standard includes
25 #include <pthread.h>
26 #include <XmlRpc.h>
27 #include <math.h>
28 
29 // ROS includes
30 #include <ros/ros.h>
31 #include <tf/transform_listener.h>
32 #include <tf/tf.h>
33 #include <tf/transform_datatypes.h>
34 #include <sensor_msgs/PointCloud.h>
39 
40 // ROS message includes
41 #include <sensor_msgs/LaserScan.h>
42 
43 
44 //####################
45 //#### node class ####
47 {
48  private:
58  struct config_struct{
60  std::vector<std::string> input_scan_topics;
61  };
62 
64 
65  std::string frame_;
66 
67  std::vector<message_filters::Subscriber<sensor_msgs::LaserScan>* > message_filter_subscribers_;
68 
70  sensor_msgs::LaserScan> >* synchronizer2_;
72  sensor_msgs::LaserScan,
73  sensor_msgs::LaserScan> >* synchronizer3_;
75  sensor_msgs::LaserScan,
76  sensor_msgs::LaserScan,
77  sensor_msgs::LaserScan> >* synchronizer4_;
78 
79  void messageFilterCallback(const sensor_msgs::LaserScan::ConstPtr& first_scanner,
80  const sensor_msgs::LaserScan::ConstPtr& second_scanner);
81  void messageFilterCallback(const sensor_msgs::LaserScan::ConstPtr& first_scanner,
82  const sensor_msgs::LaserScan::ConstPtr& second_scanner,
83  const sensor_msgs::LaserScan::ConstPtr& third_scanner);
84  void messageFilterCallback(const sensor_msgs::LaserScan::ConstPtr& first_scanner,
85  const sensor_msgs::LaserScan::ConstPtr& second_scanner,
86  const sensor_msgs::LaserScan::ConstPtr& third_scanner,
87  const sensor_msgs::LaserScan::ConstPtr& fourth_scanner);
88 
89  public:
90 
91  // constructor
93 
94  // destructor
96 
97  /* ----------------------------------- */
98  /* --------- ROS Variables ----------- */
99  /* ----------------------------------- */
100 
101  // create node handles
103 
104  // declaration of ros publishers
106 
107  // tf listener
109 
110  // laser geometry projector
112 
113  std::vector<sensor_msgs::PointCloud> vec_cloud_;
114 
115  /* ----------------------------------- */
116  /* ----------- functions ------------- */
117  /* ----------------------------------- */
118 
126  void getParams();
127 
136  bool unifyLaserScans(const std::vector<sensor_msgs::LaserScan::ConstPtr>& current_scans,
137  sensor_msgs::LaserScan& unified_scan);
138 };
139 #endif
config_struct config_
ros::NodeHandle nh_
std::vector< sensor_msgs::PointCloud > vec_cloud_
message_filters::Synchronizer< message_filters::sync_policies::ApproximateTime< sensor_msgs::LaserScan, sensor_msgs::LaserScan > > * synchronizer2_
ros::NodeHandle pnh_
std::vector< message_filters::Subscriber< sensor_msgs::LaserScan > * > message_filter_subscribers_
std::string frame_
message_filters::Synchronizer< message_filters::sync_policies::ApproximateTime< sensor_msgs::LaserScan, sensor_msgs::LaserScan, sensor_msgs::LaserScan > > * synchronizer3_
This structure holds configuration parameters.
void messageFilterCallback(const sensor_msgs::LaserScan::ConstPtr &first_scanner, const sensor_msgs::LaserScan::ConstPtr &second_scanner)
tf::TransformListener listener_
bool unifyLaserScans(const std::vector< sensor_msgs::LaserScan::ConstPtr > &current_scans, sensor_msgs::LaserScan &unified_scan)
unifie the scan information from all laser scans in vec_laser_struct_
void getParams()
function to load parameters from ros parameter server
ros::Publisher topicPub_LaserUnified_
std::vector< std::string > input_scan_topics
laser_geometry::LaserProjection projector_
message_filters::Synchronizer< message_filters::sync_policies::ApproximateTime< sensor_msgs::LaserScan, sensor_msgs::LaserScan, sensor_msgs::LaserScan, sensor_msgs::LaserScan > > * synchronizer4_


cob_scan_unifier
Author(s): Florian Mirus
autogenerated on Wed Apr 7 2021 02:11:48