sac.cpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2008 Radu Bogdan Rusu <rusu -=- cs.tum.edu>
3  *
4  * All rights reserved.
5  *
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted provided that the following conditions are met:
8  *
9  * * Redistributions of source code must retain the above copyright
10  * notice, this list of conditions and the following disclaimer.
11  * * Redistributions in binary form must reproduce the above copyright
12  * notice, this list of conditions and the following disclaimer in the
13  * documentation and/or other materials provided with the distribution.
14  *
15  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
16  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
19  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
22  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
23  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
24  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25  * POSSIBILITY OF SUCH DAMAGE.
26  *
27  * $Id: sac.cpp 21050 2009-08-07 21:24:30Z jfaustwg $
28  *
29  */
30 
33 #include <sac.h>
34 
35 using namespace sample_consensus;
36 
38 
41  SAC::getPointCloud (std::vector<int> indices)
42 {
43  PointCloud i_points;
44 
45  // Allocate enough space
46  i_points.points.resize (indices.size ());
47 
48  // Copy the data
49  for (unsigned int i = 0; i < i_points.points.size (); i++)
50  {
51  i_points.points[i].x = sac_model_->getCloud ()->points[indices.at (i)].x;
52  i_points.points[i].y = sac_model_->getCloud ()->points[indices.at (i)].y;
53  i_points.points[i].z = sac_model_->getCloud ()->points[indices.at (i)].z;
54  }
55 
56  return (i_points);
57 }
pcl::PointCloud< pcl::PointXYZ > PointCloud
Definition: sac_model.h:43
PointCloud getPointCloud(std::vector< int > indices)
Return the point cloud representing a set of given indices.
Definition: sac.cpp:41
SACModel * sac_model_
The underlying data model used (i.e. what is it that we attempt to search for).
Definition: sac.h:188
sensor_msgs::PointCloud2 PointCloud
PointCloud * getCloud()
Return a pointer to the point cloud data.
Definition: sac_model.h:183


semantic_point_annotator
Author(s): Radu Bogdan Rusu
autogenerated on Mon Jun 10 2019 14:29:03