Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
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