Visual Servoing Platform  version 3.6.1 under development (2024-11-15)

#include <visp3/gui/vpDisplayPCL.h>

Public Member Functions

 vpDisplayPCL (int posx=0, int posy=0, const std::string &window_name="")
 
 vpDisplayPCL (unsigned int width, unsigned int height, int posx=0, int posy=0, const std::string &window_name="")
 
 ~vpDisplayPCL ()
 
void setVerbose (bool verbose)
 
void startThread (std::mutex &mutex, pcl::PointCloud< pcl::PointXYZ >::Ptr pointcloud)
 
void startThread (std::mutex &mutex, pcl::PointCloud< pcl::PointXYZRGB >::Ptr pointcloud)
 
void setPosition (int posx, int posy)
 
void setWindowName (const std::string &window_name)
 
void stop ()
 

Detailed Description

This class enables real time plotting of 3D point clouds. It relies on the PCL library. To see how to install PCL library, please refer to the Point Cloud Library (PCL) section.

Examples
grabRealSense2.cpp, readRealSenseData.cpp, testRealSense2_D435_pcl.cpp, and tutorial-hsv-segmentation-pcl-viewer.cpp.

Definition at line 55 of file vpDisplayPCL.h.

Constructor & Destructor Documentation

◆ vpDisplayPCL() [1/2]

BEGIN_VISP_NAMESPACE vpDisplayPCL::vpDisplayPCL ( int  posx = 0,
int  posy = 0,
const std::string &  window_name = "" 
)

Default constructor. By default, viewer size is set to 640 x 480.

Definition at line 45 of file vpDisplayPCL.cpp.

◆ vpDisplayPCL() [2/2]

vpDisplayPCL::vpDisplayPCL ( unsigned int  width,
unsigned int  height,
int  posx = 0,
int  posy = 0,
const std::string &  window_name = "" 
)

Constructor able to initialize the display window size.

Parameters
[in]width: Point cloud viewer width.
[in]height: Point cloud viewer height.
[in]posx: Position along X-axis.
[in]posy: Position along Y-axis.
[in]window_name: Window name.

Definition at line 58 of file vpDisplayPCL.cpp.

◆ ~vpDisplayPCL()

vpDisplayPCL::~vpDisplayPCL ( )

Destructor that stops and join the viewer thread if not already done.

See also
stop(), startThread()

Definition at line 68 of file vpDisplayPCL.cpp.

References stop().

Member Function Documentation

◆ setPosition()

void vpDisplayPCL::setPosition ( int  posx,
int  posy 
)

Set the position of the viewer window. This function has to be called prior startThread().

Parameters
[in]posx: Position along x.
[in]posy: Position along y.
See also
setWindowName()
Examples
readRealSenseData.cpp.

Definition at line 189 of file vpDisplayPCL.cpp.

◆ setVerbose()

void vpDisplayPCL::setVerbose ( bool  verbose)

Enable/disable verbose mode.

Parameters
[in]verbose: When true verbose mode is enable.

Definition at line 226 of file vpDisplayPCL.cpp.

◆ setWindowName()

void vpDisplayPCL::setWindowName ( const std::string &  window_name)

Set the name of the viewer windows. This function has to be called prior startThread().

Parameters
[in]window_name: Window name to set.
See also
setPosition()
Examples
readRealSenseData.cpp.

Definition at line 203 of file vpDisplayPCL.cpp.

◆ startThread() [1/2]

void vpDisplayPCL::startThread ( std::mutex &  mutex,
pcl::PointCloud< pcl::PointXYZ >::Ptr  pointcloud 
)

Start the viewer thread able to display a point cloud.

Parameters
[in,out]mutex: Shared mutex.
[in]pointcloud: Point cloud to display.
See also
stop()
Examples
grabRealSense2.cpp, readRealSenseData.cpp, testRealSense2_D435_pcl.cpp, and tutorial-hsv-segmentation-pcl-viewer.cpp.

Definition at line 163 of file vpDisplayPCL.cpp.

◆ startThread() [2/2]

void vpDisplayPCL::startThread ( std::mutex &  mutex,
pcl::PointCloud< pcl::PointXYZRGB >::Ptr  pointcloud_color 
)

Start the viewer thread able to display a textured point cloud.

Parameters
[in,out]mutex: Shared mutex.
[in]pointcloud_color: Textured point cloud to display.
See also
stop()

Definition at line 175 of file vpDisplayPCL.cpp.

◆ stop()

void vpDisplayPCL::stop ( )

Stop the viewer thread and join.

Definition at line 211 of file vpDisplayPCL.cpp.

Referenced by ~vpDisplayPCL().