41#include <pcl/pcl_config.h>
44#include <pcl/common/io.h>
45#include <pcl/PolygonMesh.h>
46#include <pcl/io/grabber.h>
70 using Ptr = shared_ptr<DavidSDKGrabber>;
71 using ConstPtr = shared_ptr<const DavidSDKGrabber>;
98 connect (const std::
string & address =
"127.0.0.1",
99 std::uint16_t port = david::DAVID_SDK_DefaultPort);
178 std::
string remote_path);
std::string getFileFormat()
Get file_format_.
bool calibrate(double grid_size)
Calibrate the scanner.
void setRemotePath(std::string path)
Set remote_path_ path directory for scanning files.
void setFileFormatToPLY()
Set file_format_ to "ply".
virtual ~DavidSDKGrabber() noexcept
Destructor inherited from the Grabber interface.
void processGrabbing()
Continuously asks for images and or point clouds/meshes data from the device and publishes them if av...
boost::signals2::signal< sig_cb_davidsdk_mesh > * mesh_signal_
Boost mesh signal.
pcl::EventFrequency frequency_
processGrabbing capture/processing frequency
std::string getName() const
Get class name.
david::ServerInfo connect(const std::string &address="127.0.0.1", std::uint16_t port=david::DAVID_SDK_DefaultPort)
Connect client
void setLocalAndRemotePaths(std::string local_path, std::string remote_path)
Set local_path_ and remote_path_ directory paths.
bool isConnected() const
Check if the client is connected.
void stop()
Stop the data acquisition.
void disconnect(const bool stop_server)
Disconnect client
boost::signals2::signal< sig_cb_davidsdk_image > * image_signal_
Boost image signal.
void setLocalPath(std::string path)
Set local_path_ path directory for scanning files.
DavidSDKGrabber()
Constructor.
boost::signals2::signal< sig_cb_davidsdk_mesh_image > * mesh_image_signal_
Boost mesh + image signal.
std::mutex fps_mutex_
Mutual exclusion for FPS computation.
std::string local_path_
Local path of directory where the scanning file will be located.
bool running_
Whether an davidSDK device is running or not.
std::string getRemotePath()
Get remote_path_ path directory.
std::string file_format_
Export file extension, available formats are STL, OBJ, PLY.
float getFramesPerSecond() const
Obtain the number of frames per second (FPS)
bool grabSingleMesh(pcl::PolygonMesh &mesh)
Capture a single mesh and store it.
boost::signals2::signal< sig_cb_davidsdk_point_cloud > * point_cloud_signal_
Boost point cloud signal.
bool isRunning() const
Check if the data acquisition is still running.
std::string getLocalPath()
Get local_path_ path directory.
void setFileFormatToOBJ()
Set file_format_ to "obj".
david::Client david_
davidSDK client
std::string remote_path_
Remote path of directory where the scanning file will be located.
bool grabSingleCloud(pcl::PointCloud< pcl::PointXYZ > &cloud)
Capture a single point cloud and store it.
void setFileFormatToSTL()
Set file_format_ to "stl".
bool client_connected_
Whether the client is connected.
void start()
Start the point cloud and or image acquisition.
std::thread grabber_thread_
Grabber thread.
boost::signals2::signal< sig_cb_davidsdk_point_cloud_image > * point_cloud_image_signal_
Boost image + point cloud signal.
A helper class to measure frequency of a certain event.
Grabber()=default
Default ctor.
PointCloud represents the base class in PCL for storing collections of 3D points.
shared_ptr< PointCloud< PointT > > Ptr
Define methods for measuring time spent in code blocks.
shared_ptr< ::pcl::PCLImage > Ptr
A point structure representing Euclidean xyz coordinates.
shared_ptr< ::pcl::PolygonMesh > Ptr