![]() |
Visual Servoing Platform version 3.7.0
|
#include <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 | display (const bool &blocking=false) |
| void | startThread (const bool &colorThread=false) |
| void | startThread (std::mutex &mutex, pcl::PointCloud< pcl::PointXYZ >::Ptr pointcloud, const std::string &name="", const vpColor &color=vpColor::red) |
| void | startThread (std::mutex &mutex, pcl::PointCloud< pcl::PointXYZRGB >::Ptr pointcloud) |
| void | addPointCloud (std::mutex &mutex, pcl::PointCloud< pcl::PointXYZ >::Ptr pointcloud, const std::string &name="", const vpColor &color=vpColor::red) |
| void | addPointCloud (std::mutex &mutex, pcl::PointCloud< pcl::PointXYZRGB >::Ptr pointcloud) |
| void | setPosition (int posx, int posy) |
| void | setWindowName (const std::string &window_name) |
| void | stop () |
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.
The vpDisplayPCL can be used in monothread mode, or you may try to install PCL from source and then recompile ViSP.
Tutorials
If you want detailed explanation on how to use this class, you may have a look at:
Definition at line 96 of file vpDisplayPCL.h.
| 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.
| [in] | posx | Horizontal position of the viewer on screen. |
| [in] | posy | Vertical position of the viewer on screen. |
| [in] | window_name | Name of the viewer window. |
Definition at line 54 of file vpDisplayPCL.cpp.
| 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.
| [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 67 of file vpDisplayPCL.cpp.
| vpDisplayPCL::~vpDisplayPCL | ( | ) |
Destructor that stops and join the viewer thread if not already done.
Definition at line 77 of file vpDisplayPCL.cpp.
References stop().
| void vpDisplayPCL::addPointCloud | ( | std::mutex & | mutex, |
| pcl::PointCloud< pcl::PointXYZ >::Ptr | pointcloud, | ||
| const std::string & | name = "", | ||
| const vpColor & | color = vpColor::red ) |
Insert a point cloud to display.
| [in] | mutex | Mutex that protects the point-cloud. |
| [in] | pointcloud | The point-cloud to display. |
| [in] | name | The name of the point cloud to be displayed in the legend. |
| [in] | color | The color in which you want the point cloud to be displayed. |
Definition at line 400 of file vpDisplayPCL.cpp.
| void vpDisplayPCL::addPointCloud | ( | std::mutex & | mutex, |
| pcl::PointCloud< pcl::PointXYZRGB >::Ptr | pointcloud ) |
Insert a colored point cloud to display.
| [in] | mutex | Mutex that protects the point-cloud. |
| [in] | pointcloud | The point-cloud to display. |
Definition at line 413 of file vpDisplayPCL.cpp.
| void vpDisplayPCL::display | ( | const bool & | blocking = false | ) |
Monothread display method.
| [in] | blocking | If true, the program execution will be stopped until a key is pressed. If false, will refresh the display and then the program execution will automatically resume. |
Definition at line 124 of file vpDisplayPCL.cpp.
References stop().
| void vpDisplayPCL::setPosition | ( | int | posx, |
| int | posy ) |
Set the position of the viewer window. This function has to be called prior startThread().
| [in] | posx | : Position along x. |
| [in] | posy | : Position along y. |
Definition at line 429 of file vpDisplayPCL.cpp.
| void vpDisplayPCL::setVerbose | ( | bool | verbose | ) |
Enable/disable verbose mode.
| [in] | verbose | : When true verbose mode is enable. |
Definition at line 469 of file vpDisplayPCL.cpp.
| void vpDisplayPCL::setWindowName | ( | const std::string & | window_name | ) |
Set the name of the viewer windows. This function has to be called prior startThread().
| [in] | window_name | : Window name to set. |
Definition at line 443 of file vpDisplayPCL.cpp.
| void vpDisplayPCL::startThread | ( | const bool & | colorThread = false | ) |
Start the viewer thread able to display a point cloud.
| [in] | colorThread | If true, assumes that the point clouds contain RGB information. If false, assumes that the point clouds contain only XYZ information and display them along with a legend using monochromic colors. |
Definition at line 332 of file vpDisplayPCL.cpp.
References vpException::fatalError.
| void vpDisplayPCL::startThread | ( | std::mutex & | mutex, |
| pcl::PointCloud< pcl::PointXYZ >::Ptr | pointcloud, | ||
| const std::string & | name = "", | ||
| const vpColor & | color = vpColor::red ) |
Start the viewer thread able to display a point cloud.
| [in,out] | mutex | : Shared mutex. |
| [in] | pointcloud | : Point cloud to display. |
| [in] | name | The name of the point cloud to be displayed in the legend. |
| [in] | color | The color in which you want the point cloud to be displayed. |
Definition at line 357 of file vpDisplayPCL.cpp.
References vpException::fatalError.
| void vpDisplayPCL::startThread | ( | std::mutex & | mutex, |
| pcl::PointCloud< pcl::PointXYZRGB >::Ptr | pointcloud_color ) |
Start the viewer thread able to display a textured point cloud.
| [in,out] | mutex | : Shared mutex. |
| [in] | pointcloud_color | : Textured point cloud to display. |
Definition at line 378 of file vpDisplayPCL.cpp.
References vpException::fatalError.
| void vpDisplayPCL::stop | ( | ) |
Stop the viewer thread and join.
Definition at line 451 of file vpDisplayPCL.cpp.
Referenced by display(), and ~vpDisplayPCL().