generate animation of point clouds and cubes

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

generate animation of point clouds and cubes

fferroni
Hello,

I am trying to use the PCLVisualizer class to visualize a dynamic point
cloud and some known cubes (bounding boxes).

I tried the following unsuccessfully. I just get a white screen.

pcl::visualization::PCLVisualizer viewer("Viewer");
viewer.setBackgroundColor (0, 0, 0);
pcl::PointCloud<pcl::PointXYZRGB>::Ptr cloud (new
pcl::PointCloud<pcl::PointXYZRGB>);
viewer.addPointCloud<pcl::PointXYZRGB>(cloud);
viewer.setPointCloudRenderingProperties
(pcl::visualization::PCL_VISUALIZER_POINT_SIZE, 3, "cloud");
viewer.addCoordinateSystem (1.0);
viewer.initCameraParameters();

for ( ... ){
# get point cloud
# get cubes
viewer.updatePointCloud<pcl::PointXYZRGB>(cloud);

   for (const auto& cube: cubes) {
         viewer.addCube(cube.x_min ... ); ///< etc.
   }
}

what am I doing wrong?




--
Sent from: http://www.pcl-users.org/
_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users
Reply | Threaded
Open this post in threaded view
|

Re: generate animation of point clouds and cubes

Sérgio Agostinho
You're not "spinning" (running the main event loop) the viewer.

http://pointclouds.org/documentation/tutorials/pcl_visualizer.php

Check the main loop at the end of the main function.

Cheers


_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users
Reply | Threaded
Open this post in threaded view
|

Re: generate animation of point clouds and cubes

fferroni
Thanks! Works like a charm now.



--
Sent from: http://www.pcl-users.org/
_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users