extract_indices.cpp
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: extract_indices.cpp 35876 2011-02-09 01:04:36Z rusu $
35  *
36  */
37 
40 
42 bool
44 {
45  has_service = true;
46 
47  srv_ = boost::make_shared <dynamic_reconfigure::Server<pcl_ros::ExtractIndicesConfig> > (nh);
48  dynamic_reconfigure::Server<pcl_ros::ExtractIndicesConfig>::CallbackType f = boost::bind (&ExtractIndices::config_callback, this, _1, _2);
49  srv_->setCallback (f);
50 
51  use_indices_ = true;
52  return (true);
53 }
54 
56 void
57 pcl_ros::ExtractIndices::config_callback (pcl_ros::ExtractIndicesConfig &config, uint32_t /*level*/)
58 {
59  boost::mutex::scoped_lock lock (mutex_);
60 
61  if (impl_.getNegative () != config.negative)
62  {
63  impl_.setNegative (config.negative);
64  NODELET_DEBUG ("[%s::config_callback] Setting the extraction to: %s.", getName ().c_str (), (config.negative ? "indices" : "everything but the indices"));
65  }
66 }
67 
70 
pcl_ros::ExtractIndices
ExtractIndices extracts a set of indices from a PointCloud as a separate PointCloud.
Definition: extract_indices.h:53
ExtractIndices
pcl_ros::ExtractIndices ExtractIndices
Definition: extract_indices.cpp:68
getName
ROSCONSOLE_CONSOLE_IMPL_DECL std::string getName(void *handle)
pcl_ros::PCLNodelet::use_indices_
bool use_indices_
Set to true if point indices are used.
Definition: pcl_nodelet.h:95
pcl_ros::ExtractIndices::srv_
boost::shared_ptr< dynamic_reconfigure::Server< pcl_ros::ExtractIndicesConfig > > srv_
Pointer to a dynamic reconfigure service.
Definition: extract_indices.h:57
f
f
PLUGINLIB_EXPORT_CLASS
#define PLUGINLIB_EXPORT_CLASS(class_type, base_class_type)
extract_indices.h
nodelet::Nodelet
class_list_macros.hpp
pcl_ros::ExtractIndices::config_callback
void config_callback(pcl_ros::ExtractIndicesConfig &config, uint32_t level)
Dynamic reconfigure service callback.
Definition: extract_indices.cpp:57
ros::NodeHandle
NODELET_DEBUG
#define NODELET_DEBUG(...)
pcl_ros::ExtractIndices::child_init
virtual bool child_init(ros::NodeHandle &nh, bool &has_service)
Child initialization routine.
Definition: extract_indices.cpp:43


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