![]() |
Visual Servoing Platform version 3.7.0
|
#include <vpPclViewer.h>
Classes | |
| struct | legendParams |
Public Types | |
| typedef struct vpPclViewer::legendParams | legendParams |
Public Member Functions | |
| vpPclViewer (const std::string &title, const int &width=640, const int &height=480, const int &posU=720, const int &posV=560, const std::string &outFolder=std::string(), const double &ignoreThreshold=0.95) | |
| ~vpPclViewer () | |
| void | setNameWindow (const std::string &nameWindow) |
| void | setOutFolder (const std::string &outputFolder) |
| void | setIgnoreThreshold (const double &thresh) |
| unsigned int | addSurface (const pcl::PointCloud< pcl::PointXYZRGB >::Ptr &surface, const std::string &name="", const std::vector< unsigned char > &v_color=std::vector< unsigned char >()) |
| unsigned int | addSurface (const pcl::PointCloud< pcl::PointXYZRGB >::Ptr &surface, const vpColVector &weights, const std::string &name="", const std::vector< unsigned char > &v_color=std::vector< unsigned char >()) |
| void | updateSurface (const pcl::PointCloud< pcl::PointXYZRGB >::Ptr &surface, const unsigned int &id, const bool &hasToKeepColor=false) |
| void | updateSurface (const pcl::PointCloud< pcl::PointXYZRGB >::Ptr &surface, const unsigned int &id, const vpColVector &weights, const bool &hasToKeepColor=false) |
| void | display (const bool &blocking=false) |
| void | launchThread () |
| void | stopThread () |
Protected Member Functions | |
| void | threadUpdateSurface (const pcl::PointCloud< pcl::PointXYZRGB >::Ptr &surface, const unsigned int &id) |
| void | threadUpdateSurfaceOriginalColor (const pcl::PointCloud< pcl::PointXYZRGB >::Ptr &surface, const unsigned int &id) |
| void | threadUpdateSurface (const pcl::PointCloud< pcl::PointXYZRGB >::Ptr &surface, const unsigned int &id, const vpColVector &weights) |
| void | threadUpdateSurfaceOriginalColor (const pcl::PointCloud< pcl::PointXYZRGB >::Ptr &surface, const unsigned int &id, const vpColVector &weights) |
| void | loopThread () |
Static Protected Member Functions | |
| static void | runThread (vpPclViewer *p_viewer) |
Protected Attributes | |
| std::vector< pcl::PointCloud< pcl::PointXYZRGB >::Ptr > | m_vPointClouds |
| std::vector< std::vector< double > > | m_vhandler |
| pcl::visualization::PCLVisualizer::Ptr | mp_viewer |
| int | m_width |
| int | m_height |
| int | m_posU |
| int | m_posV |
| double | m_ignoreThresh |
| std::vector< std::string > | m_vmeshid |
| std::vector< legendParams > | m_vlegends |
| std::vector< std::mutex * > | m_vpmutex |
| std::vector< vpColVector > | m_vweights |
| std::thread | m_threadDisplay |
| bool | m_hasToRun |
| std::string | m_title |
| bool | m_hasToSavePCDs |
| std::string | m_outFolder |
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. You can either plot in a non-blocking threaded manner or in a blocking manner. The point clouds can be displayed using their original colors, or using uniform colors to match a legend. Additionally, it is possible to use confidence weights to hide points that are not trusted. These weights can result from a robust estimation using for instance the vpRobust class.
Definition at line 66 of file vpPclViewer.h.
| typedef struct vpPclViewer::legendParams vpPclViewer::legendParams |
Structure that contains all the required parameters to display a legend on the viewer.
| vpPclViewer::vpPclViewer | ( | const std::string & | title, |
| const int & | width = 640, | ||
| const int & | height = 480, | ||
| const int & | posU = 720, | ||
| const int & | posV = 560, | ||
| const std::string & | outFolder = std::string(), | ||
| const double & | ignoreThreshold = 0.95 ) |
Construct a new vpPclViewer object.
| title | The title of the window of the viewer. |
| width | The width of the window of the viewer. |
| height | The height of the window of the viewer. |
| posU | The position on the horizontal axis of the screen of the window of the viewer. |
| posV | The position on the vertical axis of the screen of the window of the viewer. |
| outFolder | If different from the empty string, the point clouds will be saved in this folder. |
| ignoreThreshold | A point for which the weight is below this threshold will be displayed in black. |
Referenced by runThread().
| vpPclViewer::~vpPclViewer | ( | ) |
| unsigned int vpPclViewer::addSurface | ( | const pcl::PointCloud< pcl::PointXYZRGB >::Ptr & | surface, |
| const std::string & | name = "", | ||
| const std::vector< unsigned char > & | v_color = std::vector< unsigned char >() ) |
Add a surface to the list of point clouds known by the viewer.
| surface | The surface that must be knwon to be displayed by the PCL viewer. |
| name | The name of the surface that will be displayed in the legend. If empty, it will be automatically generated. |
| v_color | A vector containing the 3 RGB values. |
| unsigned int vpPclViewer::addSurface | ( | const pcl::PointCloud< pcl::PointXYZRGB >::Ptr & | surface, |
| const vpColVector & | weights, | ||
| const std::string & | name = "", | ||
| const std::vector< unsigned char > & | v_color = std::vector< unsigned char >() ) |
Add a surface to the list of point clouds known by the viewer. The points whose weights are below the vpPclViewer::s_ignoreThresh wil be displayed in black.
| surface | The surface that must be knwon to be displayed by the PCL viewer. |
| weights | The confidence weights of each points. Must be between 0 and 1. |
| name | The name of the surface that will be displayed in the legend. If empty, it will be automatically generated. |
| v_color | A vector containing the 3 RGB values. |
| void vpPclViewer::display | ( | const bool & | blocking = false | ) |
Blocking-mode display of the viewer.
| blocking | True if we must wait for the user to press 'Q' to leave the method, false otherwise. |
| void vpPclViewer::launchThread | ( | ) |
Start the drawing thread that permits to have a non-blocking display.
|
protected |
The internal loop of the non-blocking drawing thread.
|
staticprotected |
Internal method that is called by vpPclViewer::launchThread to launch the drawing thread.
| p_viewer | The pointer of the vpPclViewer object that will run the thread (is equal to this ). |
References vpPclViewer().
| void vpPclViewer::setIgnoreThreshold | ( | const double & | thresh | ) |
Set the threshold below which a point must be displayed in black.
| thresh | The threshold below which a point must be displayed in black. |
| void vpPclViewer::setNameWindow | ( | const std::string & | nameWindow | ) |
Set the name of the PCL viewer window.
| nameWindow | The name of the PCL viewer window. |
| void vpPclViewer::setOutFolder | ( | const std::string & | outputFolder | ) |
Set the path to the output folder. If different from the empty string, the point clouds will be saved in this folder.
| outputFolder | The path towards to the output folder, or empty if the point clouds must not be saved. |
| void vpPclViewer::stopThread | ( | ) |
Stop the drawing thread that permits to have a non-blocking display.
|
protected |
Method to update a point cloud known by the viewer when the drawing thread is running. The updated surface will be drawn with the default color that was affected to it.
| surface | The updated surface. |
| id | The ID of the point cloud that must be updated. |
|
protected |
Method to update a point cloud known by the viewer when the drawing thread is running. The updated surface will be drawn with the default color that was affected to it.
| surface | The updated surface. |
| id | The ID of the point cloud that must be updated. |
| weights | The confidence weights of each point. Must be between 0 and 1. |
|
protected |
Method to update a point cloud known by the viewer when the drawing thread is running. The updated surface will be drawn with the color it contains.
| surface | The updated surface. |
| id | The ID of the point cloud that must be updated. |
|
protected |
Method to update a point cloud known by the viewer when the drawing thread is running. The updated surface will be drawn with the color it contains.
| surface | The updated surface. |
| id | The ID of the point cloud that must be updated. |
| weights | The confidence weights of each point. Must be between 0 and 1. |
| void vpPclViewer::updateSurface | ( | const pcl::PointCloud< pcl::PointXYZRGB >::Ptr & | surface, |
| const unsigned int & | id, | ||
| const bool & | hasToKeepColor = false ) |
Update the surface known by id by the viewer.
| surface | The updated surface. |
| id | The ID of the surface that must be updated. |
| hasToKeepColor | If true, will be displayed in its original color. Otherwise, will be displayed in its default color. |
| void vpPclViewer::updateSurface | ( | const pcl::PointCloud< pcl::PointXYZRGB >::Ptr & | surface, |
| const unsigned int & | id, | ||
| const vpColVector & | weights, | ||
| const bool & | hasToKeepColor = false ) |
Update the surface known by id by the viewer.
| surface | The updated surface. |
| id | The ID of the surface that must be updated. |
| weights | The confidence weights of each points. |
| hasToKeepColor | If true, will be displayed in its original color. Otherwise, will be displayed in its default color. |
|
protected |
If true, the drawing thread is running. Otherwise, it is stopped.
Definition at line 250 of file vpPclViewer.h.
|
protected |
If true, the point clouds will be saved at each iteration of the drawing thread.
Definition at line 252 of file vpPclViewer.h.
|
protected |
The height of the window.
Definition at line 241 of file vpPclViewer.h.
|
protected |
The minimum value of the confidence weight of a point to allow it to be displayed.
Definition at line 244 of file vpPclViewer.h.
|
protected |
If non empty, the path to the folders where the point clouds will be saved.
Definition at line 253 of file vpPclViewer.h.
|
protected |
The position along the horizontal axis of the screen of the window.
Definition at line 242 of file vpPclViewer.h.
|
protected |
The position along the vertical axis of the screen of the window.
Definition at line 243 of file vpPclViewer.h.
|
protected |
The non-blocking drawing thread.
Definition at line 249 of file vpPclViewer.h.
|
protected |
The title of the viewer window.
Definition at line 251 of file vpPclViewer.h.
|
protected |
The list of color handlers.
Definition at line 238 of file vpPclViewer.h.
|
protected |
The list of the legend items.
Definition at line 246 of file vpPclViewer.h.
|
protected |
The list of the point cloud names, for the legend.
Definition at line 245 of file vpPclViewer.h.
|
protected |
The list of mutexes protecting the point clouds from data race when using the drawing thread.
Definition at line 247 of file vpPclViewer.h.
|
protected |
The list of point clouds known by the viewer.
Definition at line 237 of file vpPclViewer.h.
|
protected |
The list of confidence weights of each point cloud.
Definition at line 248 of file vpPclViewer.h.
|
protected |
The width of the window.
Definition at line 240 of file vpPclViewer.h.
|
protected |
The PCL viewer permitting the display.
Definition at line 239 of file vpPclViewer.h.