invariant_surface_feature_debug.hpp
Go to the documentation of this file.
00001 /****************************************************************
00002  *
00003  * Copyright (c) 2011
00004  *
00005  * Fraunhofer Institute for Manufacturing Engineering
00006  * and Automation (IPA)
00007  *
00008  * +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00009  *
00010  * Project name: care-o-bot
00011  * ROS stack name: cob_environment_perception_intern
00012  * ROS package name: cob_3d_features
00013  * Description:
00014  *
00015  * +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00016  *
00017  * Author: Joshua Hampp, email:joshua.hampp@ipa.fraunhofer.de
00018  *
00019  * Date of creation: 03/2014
00020  * ToDo:
00021  *
00022  *
00023  * +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00024  *
00025  * Redistribution and use in source and binary forms, with or without
00026  * modification, are permitted provided that the following conditions are met:
00027  *
00028  *     * Redistributions of source code must retain the above copyright
00029  *       notice, this list of conditions and the following disclaimer.
00030  *     * Redistributions in binary form must reproduce the above copyright
00031  *       notice, this list of conditions and the following disclaimer in the
00032  *       documentation and/or other materials provided with the distribution.
00033  *     * Neither the name of the Fraunhofer Institute for Manufacturing
00034  *       Engineering and Automation (IPA) nor the names of its
00035  *       contributors may be used to endorse or promote products derived from
00036  *       this software without specific prior written permission.
00037  *
00038  * This program is free software: you can redistribute it and/or modify
00039  * it under the terms of the GNU Lesser General Public License LGPL as
00040  * published by the Free Software Foundation, either version 3 of the
00041  * License, or (at your option) any later version.
00042  *
00043  * This program is distributed in the hope that it will be useful,
00044  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00045  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00046  * GNU Lesser General Public License LGPL for more details.
00047  *
00048  * You should have received a copy of the GNU Lesser General Public
00049  * License LGPL along with this program.
00050  * If not, see <http://www.gnu.org/licenses/>.
00051  *
00052  ****************************************************************/
00053 
00054 #pragma once
00055 
00056 template<typename TSurface, typename Scalar, typename Real, typename TAffine>
00057 void cob_3d_features::InvariantSurfaceFeature<TSurface,Scalar,Real,TAffine>::dbg_mesh_of_subsamp(const TVector &at, const Scalar radius, std::vector<TVector> &pts, std::vector<int> &inds) const {
00058       std::vector<Triangle> submap;
00059       subsample(at, radius, submap);
00060           
00061           for(size_t i=0; i<submap.size(); i++) {
00062                 for(int j=0; j<3; j++) {
00063                         inds.push_back((int)inds.size());
00064                         pts.push_back(submap[i].p3_[j]);
00065                 }
00066           }
00067 }
00068 
00069 template<typename TSurface, typename Scalar, typename Real, typename TAffine>
00070 pcl::PolygonMesh::Ptr cob_3d_features::InvariantSurfaceFeature<TSurface,Scalar,Real,TAffine>::dbg_triangles2mesh(const std::vector<Triangle> &res) const {
00071         pcl::PolygonMesh::Ptr mesh(new pcl::PolygonMesh);
00072         pcl::PointCloud<pcl::PointXYZ> points;
00073         for(size_t i=0; i<res.size(); i++) {
00074                 mesh->polygons.push_back(pcl::Vertices());
00075                 for(int j=0; j<3; j++) {
00076                         mesh->polygons.back().vertices.push_back(points.size());
00077                         pcl::PointXYZ pt;
00078                         pt.x=res[i][j](0);pt.y=res[i][j](1);pt.z=res[i][j](2);
00079                         points.push_back(pt);
00080                 }
00081         }
00082         pcl::toROSMsg(points, mesh->cloud);
00083         return mesh;
00084 }


cob_3d_features
Author(s): Georg Arbeiter
autogenerated on Wed Aug 26 2015 11:02:26