concatenate_data.h
Go to the documentation of this file.
1 /*
2  * Software License Agreement (BSD License)
3  *
4  * Copyright (c) 2009, Willow Garage, Inc.
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
10  *
11  * * Redistributions of source code must retain the above copyright
12  * notice, this list of conditions and the following disclaimer.
13  * * Redistributions in binary form must reproduce the above
14  * copyright notice, this list of conditions and the following
15  * disclaimer in the documentation and/or other materials provided
16  * with the distribution.
17  * * Neither the name of Willow Garage, Inc. nor the names of its
18  * contributors may be used to endorse or promote products derived
19  * from this software without specific prior written permission.
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
27  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
31  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32  * POSSIBILITY OF SUCH DAMAGE.
33  *
34  * $Id: concatenate_data.h 35231 2011-01-14 05:33:20Z rusu $
35  *
36  */
37 
38 #ifndef PCL_IO_CONCATENATE_DATA_H_
39 #define PCL_IO_CONCATENATE_DATA_H_
40 
41 // ROS includes
42 #include <tf/transform_listener.h>
49 
50 namespace pcl_ros
51 {
53 
61  {
62  public:
63  typedef sensor_msgs::PointCloud2 PointCloud2;
64  typedef PointCloud2::Ptr PointCloud2Ptr;
65  typedef PointCloud2::ConstPtr PointCloud2ConstPtr;
66 
69 
74 
77 
78  void onInit ();
79  void subscribe ();
80  void unsubscribe ();
81 
82  private:
85 
88 
91 
93  std::vector<boost::shared_ptr<message_filters::Subscriber<PointCloud2> > > filters_;
94 
96  std::string output_frame_;
97 
100 
103 
107 
113 
118  inline void
120  {
121  PointCloud2 cloud;
122  cloud.header.stamp = input->header.stamp;
123  nf_.add (boost::make_shared<PointCloud2> (cloud));
124  }
125 
127  void input (const PointCloud2::ConstPtr &in1, const PointCloud2::ConstPtr &in2,
128  const PointCloud2::ConstPtr &in3, const PointCloud2::ConstPtr &in4,
129  const PointCloud2::ConstPtr &in5, const PointCloud2::ConstPtr &in6,
130  const PointCloud2::ConstPtr &in7, const PointCloud2::ConstPtr &in8);
131 
132  void combineClouds (const PointCloud2 &in1, const PointCloud2 &in2, PointCloud2 &out);
133  };
134 }
135 
136 #endif //#ifndef PCL_ROS_IO_CONCATENATE_H_
pcl_ros::PointCloudConcatenateDataSynchronizer::PointCloudConcatenateDataSynchronizer
PointCloudConcatenateDataSynchronizer(int queue_size)
Empty constructor.
Definition: concatenate_data.h:73
ros::Publisher
pass_through.h
boost::shared_ptr
pcl_ros
Definition: boundary.h:46
pcl_ros::PointCloudConcatenateDataSynchronizer::onInit
void onInit()
Definition: concatenate_data.cpp:46
pcl_ros::PointCloudConcatenateDataSynchronizer::maximum_queue_size_
int maximum_queue_size_
The maximum number of messages that we can store in the queue.
Definition: concatenate_data.h:87
pcl_ros::PointCloudConcatenateDataSynchronizer::output_frame_
std::string output_frame_
Output TF frame the concatenated points should be transformed to.
Definition: concatenate_data.h:96
pcl_ros::PointCloudConcatenateDataSynchronizer::input_topics_
XmlRpc::XmlRpcValue input_topics_
Input point cloud topics.
Definition: concatenate_data.h:99
pcl_ros::PointCloudConcatenateDataSynchronizer::ts_a_
boost::shared_ptr< message_filters::Synchronizer< sync_policies::ApproximateTime< PointCloud2, PointCloud2, PointCloud2, PointCloud2, PointCloud2, PointCloud2, PointCloud2, PointCloud2 > > > ts_a_
Synchronizer.
Definition: concatenate_data.h:111
pcl_ros::PointCloudConcatenateDataSynchronizer::approximate_sync_
bool approximate_sync_
True if we use an approximate time synchronizer versus an exact one (false by default).
Definition: concatenate_data.h:90
pcl_ros::PointCloudConcatenateDataSynchronizer::input_callback
void input_callback(const PointCloud2ConstPtr &input)
Input point cloud callback. Because we want to use the same synchronizer object, we push back empty e...
Definition: concatenate_data.h:119
pcl_ros::PointCloudConcatenateDataSynchronizer::PointCloud2
sensor_msgs::PointCloud2 PointCloud2
Definition: concatenate_data.h:63
pcl_ros::PointCloudConcatenateDataSynchronizer::unsubscribe
void unsubscribe()
Definition: concatenate_data.cpp:196
pcl_ros::PointCloudConcatenateDataSynchronizer::nf_
message_filters::PassThrough< PointCloud2 > nf_
Null passthrough filter, used for pushing empty elements in the synchronizer.
Definition: concatenate_data.h:106
pcl_ros::PointCloudConcatenateDataSynchronizer::input
void input(const PointCloud2::ConstPtr &in1, const PointCloud2::ConstPtr &in2, const PointCloud2::ConstPtr &in3, const PointCloud2::ConstPtr &in4, const PointCloud2::ConstPtr &in5, const PointCloud2::ConstPtr &in6, const PointCloud2::ConstPtr &in7, const PointCloud2::ConstPtr &in8)
Input callback for 8 synchronized topics.
Definition: concatenate_data.cpp:247
subscriber.h
pcl_ros::PointCloudConcatenateDataSynchronizer::PointCloudConcatenateDataSynchronizer
PointCloudConcatenateDataSynchronizer()
Empty constructor.
Definition: concatenate_data.h:68
pcl_ros::PointCloudConcatenateDataSynchronizer::combineClouds
void combineClouds(const PointCloud2 &in1, const PointCloud2 &in2, PointCloud2 &out)
Definition: concatenate_data.cpp:206
pcl_ros::PointCloudConcatenateDataSynchronizer::ts_e_
boost::shared_ptr< message_filters::Synchronizer< sync_policies::ExactTime< PointCloud2, PointCloud2, PointCloud2, PointCloud2, PointCloud2, PointCloud2, PointCloud2, PointCloud2 > > > ts_e_
Definition: concatenate_data.h:112
message_filters::PassThrough::add
void add(const EventType &evt)
exact_time.h
transform_listener.h
nodelet_topic_tools::NodeletLazy
nodelet_lazy.h
message_filters::sync_policies
message_filters::PassThrough< PointCloud2 >
pcl_ros::PointCloudConcatenateDataSynchronizer
PointCloudConcatenateFieldsSynchronizer is a special form of data synchronizer: it listens for a set ...
Definition: concatenate_data.h:60
pcl_ros::PointCloudConcatenateDataSynchronizer::pub_output_
ros::Publisher pub_output_
The output PointCloud publisher.
Definition: concatenate_data.h:84
pcl_ros::PointCloudConcatenateDataSynchronizer::tf_
tf::TransformListener tf_
TF listener object.
Definition: concatenate_data.h:102
tf::TransformListener
synchronizer.h
approximate_time.h
pcl_ros::PointCloudConcatenateDataSynchronizer::~PointCloudConcatenateDataSynchronizer
virtual ~PointCloudConcatenateDataSynchronizer()
Empty destructor.
Definition: concatenate_data.h:76
pcl_ros::PointCloudConcatenateDataSynchronizer::PointCloud2Ptr
PointCloud2::Ptr PointCloud2Ptr
Definition: concatenate_data.h:64
pcl_ros::PointCloudConcatenateDataSynchronizer::filters_
std::vector< boost::shared_ptr< message_filters::Subscriber< PointCloud2 > > > filters_
A vector of message filters.
Definition: concatenate_data.h:93
pcl_ros::PointCloudConcatenateDataSynchronizer::PointCloud2ConstPtr
PointCloud2::ConstPtr PointCloud2ConstPtr
Definition: concatenate_data.h:65
XmlRpc::XmlRpcValue
pcl_ros::PointCloudConcatenateDataSynchronizer::subscribe
void subscribe()
Definition: concatenate_data.cpp:92


pcl_ros
Author(s): Open Perception, Julius Kammerl , William Woodall
autogenerated on Fri Jul 12 2024 02:54:40