PCLVisualizer随笔

boost::shared_ptr<pcl::visualization::PCLVisualizer> viewer  = boost::make_shared<pcl::visualization::PCLVisualizer>("3D Viewer");
void simpleVis (pcl::PointCloud<pcl::PointXYZI>::ConstPtr cloud){
    viewer->initCameraParameters();
    viewer->setCameraPosition(50, 0, 0,    //pos_x   pos_y   pos_z               camera位置
                              1, 0, -1,      //view_x  view_y  view_z              view向量--相机朝向
                              0, 0, 0); //up_x    up_y    up_z   viewport     up向量
    viewer->setBackgroundColor(0, 0, 0);
    viewer->addPointCloud<pcl::PointXYZI> (cloud, "sample cloud");
    viewer->addCoordinateSystem();
    viewer->setPointCloudRenderingProperties (pcl::visualization::PCL_VISUALIZER_POINT_SIZE, 1, "sample cloud");
    return;
}
posted @ 2021-11-04 21:46  Lachiven  阅读(85)  评论(0编辑  收藏  举报