0

I want to make the point bigger by using "setPointCloudRenderingProperties".
this is my code:

#include <pcl/point_cloud.h>
#include <pcl/PointIndices.h>
#include <pcl/pcl_base.h>
#include <pcl/point_types.h>
#include <pcl/visualization/pcl_visualizer.h>
#include <iostream>
using pcl::PointCloud;
using pcl::PointXYZ;
using namespace std;
int main (int , char **){
    PointCloud<PointXYZ>::Ptr cloud (new PointCloud<PointXYZ>);
    cloud->height=40;
    cloud->width=50;
    cloud->resize(cloud->height*cloud->width);
    for(int i=0;i<cloud->height;i++){
        for(int j=0;j<cloud->width;j++){
            PointXYZ &p=cloud->at(j,i);
            p.x=(i+1)*1.0/10;
            p.y=(j+1)*1.0/10;
            p.z=0;
        }
    }

    pcl::visualization::PCLVisualizer p ("cloud");

    p.addCoordinateSystem (1.0, "first");

    pcl::visualization::PointCloudColorHandlerCustom<PointXYZ> handle(cloud, 0, 180, 0);
    p.addPointCloud(cloud, handle, "cloud", 0);
    p.setPointCloudRenderingProperties(pcl::visualization::PCL_VISUALIZER_POINT_SIZE,200, "cloud", 0);

    p.setCameraPosition(0, 0,20,0, 0, 0,0,2,0);
    p.spin ();
    p.saveScreenshot("/home/guan/Desktop/2_200.png");

}

Look at the part of setPointCloudRenderingProperties,I set the PCL_VISUALIZER_POINT_SIZE 200 or 10 ,the point of the pointcloud not change.

Look at the my picture:

PCL_VISUALIZER_POINT_SIZE 200

PCL_VISUALIZER_POINT_SIZE 10

I don't know why.

guanjun
  • 39
  • 6

1 Answers1

0

in fact,my problem solved when i change my computer(Before that, I've been using virtual machines):)

guanjun
  • 39
  • 6