plot.h
Go to the documentation of this file.
00001 /*
00002  * Software License Agreement (BSD License)
00003  *
00004  *  Copyright (c) 2015, Andreas ten Pas
00005  *  All rights reserved.
00006  *
00007  *  Redistribution and use in source and binary forms, with or without
00008  *  modification, are permitted provided that the following conditions
00009  *  are met:
00010  *
00011  *   * Redistributions of source code must retain the above copyright
00012  *     notice, this list of conditions and the following disclaimer.
00013  *   * Redistributions in binary form must reproduce the above
00014  *     copyright notice, this list of conditions and the following
00015  *     disclaimer in the documentation and/or other materials provided
00016  *     with the distribution.
00017  *
00018  *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
00019  *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
00020  *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
00021  *  FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
00022  *  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
00023  *  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
00024  *  BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
00025  *  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00026  *  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
00027  *  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
00028  *  ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
00029  *  POSSIBILITY OF SUCH DAMAGE.
00030  */
00031 
00032 #ifndef PLOT_H
00033 #define PLOT_H
00034 
00035 #include <pcl/visualization/pcl_visualizer.h>
00036 
00037 #include <agile_grasp/grasp_hypothesis.h>
00038 #include <agile_grasp/quadric.h>
00039 
00040 
00041 typedef pcl::PointCloud<pcl::PointXYZ> PointCloud;
00042 typedef pcl::PointCloud<pcl::PointNormal> PointCloudNormal;
00043 
00050 class Plot
00051 {
00052         public:
00053                 
00061                 void plotHands(const std::vector<GraspHypothesis>& hand_list, const PointCloud::Ptr& cloud, std::string str,
00062                         bool use_grasp_bottom = false);
00063                 
00072                 void plotHands(const std::vector<GraspHypothesis>& hand_list,
00073                         const std::vector<GraspHypothesis>& antipodal_hand_list, const PointCloud::Ptr& cloud, std::string str,
00074                         bool use_grasp_bottom = false);
00075                 
00081                 void plotSamples(const std::vector<int>& index_list, const PointCloud::Ptr& cloud);
00082                 
00088                 void plotLocalAxes(const std::vector<Quadric>& quadric_list, const PointCloud::Ptr& cloud);
00089                 
00095                 void plotCameraSource(const Eigen::VectorXi& pts_cam_source_in, const PointCloud::Ptr& cloud);
00096                 
00097         private:
00098                 
00108                 PointCloudNormal::Ptr createNormalsCloud(const std::vector<GraspHypothesis>& hand_list,
00109                         bool plots_only_antipodal, bool plots_grasp_bottom);
00110                 
00121                 void addCloudNormalsToViewer(boost::shared_ptr<pcl::visualization::PCLVisualizer>& viewer,
00122                         const PointCloudNormal::Ptr& cloud, double line_width, double* color_cloud, double* color_normals,
00123                         const std::string& cloud_name, const std::string& normals_name);
00124                 
00134                 void plotHandsHelper(const PointCloudNormal::Ptr& hands_cloud,
00135                         const PointCloudNormal::Ptr& antipodal_hands_cloud, const PointCloud::Ptr& cloud,
00136                         std::string str, bool use_grasp_bottom);
00137                 
00142                 void runViewer(boost::shared_ptr<pcl::visualization::PCLVisualizer>& viewer);
00143                 
00148                 boost::shared_ptr<pcl::visualization::PCLVisualizer> createViewer(std::string title);
00149 };
00150 
00151 #endif /* PLOT_H */ 


agile_grasp
Author(s):
autogenerated on Thu Aug 27 2015 12:01:28