310 lines
14 KiB
HTML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Grabbing point clouds / meshes from davidSDK scanners &mdash; Point Cloud Library 1.12.0 documentation</title>
<script type="text/javascript" src="_static/js/modernizr.min.js"></script>
<script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" src="_static/language_data.js"></script>
<script type="text/javascript" src="_static/js/theme.js"></script>
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="index.html" class="icon icon-home"> Point Cloud Library
</a>
<div class="version">
1.12.0
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
<input type="text" name="q" placeholder="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<!-- Local TOC -->
<div class="local-toc"><ul>
<li><a class="reference internal" href="#">Grabbing point clouds / meshes from davidSDK scanners</a><ul>
<li><a class="reference internal" href="#install-davidsdk">Install davidSDK</a></li>
<li><a class="reference internal" href="#configuring-pcl">Configuring PCL</a></li>
<li><a class="reference internal" href="#platform-specific-directives">Platform specific directives</a></li>
<li><a class="reference internal" href="#file-formats">File formats</a></li>
<li><a class="reference internal" href="#calibration">Calibration</a></li>
<li><a class="reference internal" href="#using-the-example">Using the example</a></li>
</ul>
</li>
</ul>
</div>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="index.html">Point Cloud Library</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="index.html">Docs</a> &raquo;</li>
<li>Grabbing point clouds / meshes from davidSDK scanners</li>
<li class="wy-breadcrumbs-aside">
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="section" id="grabbing-point-clouds-meshes-from-davidsdk-scanners">
<span id="david-sdk"></span><h1><a class="toc-backref" href="#id1">Grabbing point clouds / meshes from davidSDK scanners</a></h1>
<p>In this tutorial we will learn how to use the <a class="reference external" href="http://www.david-3d.com/en/products/david-sdk">davidSDK</a> through PCL. This tutorial will show you how to configure PCL and how to use the examples to fetch point clouds/meshes/images from a davidSDK compliant device (such as the <a class="reference external" href="http://www.david-3d.com/en/products/sls-2">SLS-2</a>).</p>
<div class="contents topic" id="contents">
<p class="topic-title">Contents</p>
<ul class="simple">
<li><a class="reference internal" href="#grabbing-point-clouds-meshes-from-davidsdk-scanners" id="id1">Grabbing point clouds / meshes from davidSDK scanners</a><ul>
<li><a class="reference internal" href="#install-davidsdk" id="id2">Install davidSDK</a></li>
<li><a class="reference internal" href="#configuring-pcl" id="id3">Configuring PCL</a></li>
<li><a class="reference internal" href="#platform-specific-directives" id="id4">Platform specific directives</a></li>
<li><a class="reference internal" href="#file-formats" id="id5">File formats</a></li>
<li><a class="reference internal" href="#calibration" id="id6">Calibration</a></li>
<li><a class="reference internal" href="#using-the-example" id="id7">Using the example</a></li>
</ul>
</li>
</ul>
</div>
<div class="section" id="install-davidsdk">
<h2><a class="toc-backref" href="#id2">Install davidSDK</a></h2>
<p>You need a davidSDK to run the SDK on the server side, the official davidSDK does not come with a Makefile or a CMake project. An un-official fork provides a CMake project that enables to easily use the SDK under Linux (with minor tweaks)</p>
<blockquote>
<div><ul class="simple">
<li><a class="reference external" href="http://www.david-3d.com/en/support/downloads">Official davidSDK download page</a></li>
<li><a class="reference external" href="https://gitlab.com/InstitutMaupertuis/davidSDK">Victor Lamoine davidSDK fork</a></li>
</ul>
</div></blockquote>
<p>Please test <a class="reference external" href="https://gitlab.com/InstitutMaupertuis/davidSDK/blob/master/README.md#example-project-using-the-davidsdk">the example project</a> before going further.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">If you use the trial version of the server, the only format available is OBJ (used by default)</p>
</div>
</div>
<div class="section" id="configuring-pcl">
<h2><a class="toc-backref" href="#id3">Configuring PCL</a></h2>
<p>You need at least PCL 1.8.0 to be able to use the davidSDK. You need to make sure <code class="docutils literal notranslate"><span class="pre">WITH_DAVIDSDK</span></code> is set to <code class="docutils literal notranslate"><span class="pre">true</span></code> in the CMake configuration (it should be set to true by default if you have used the un-official davidSDK fork).</p>
<p>The default following values can be tweaked into CMake if you dont have a standard installation, for example:</p>
<div class="highlight-cmake notranslate"><div class="highlight"><pre><span></span>DAVIDSDK_ABI_DIR /opt/davidsdk
</pre></div>
</div>
<p>You can deactivate building the davidSDK support by setting <code class="docutils literal notranslate"><span class="pre">BUILD_DAVIDSDK</span></code> to false. Compile and install PCL.</p>
</div>
<div class="section" id="platform-specific-directives">
<h2><a class="toc-backref" href="#id4">Platform specific directives</a></h2>
<p>It should be easy to use the davidSDK PCL support if you are using PCL on the davidSDK server; the meshes are locally exported on the storage drive and then loaded into PCL as point clouds/meshes. If you are using a Linux distribution you will need to configure more things for the davidSDK PCL implementation to work, create a temporary directory for the davidSDK meshes storage:</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>mkdir -p /var/tmp/davidsdk
sudo chmod <span class="m">755</span> /var/tmp/davidsdk
</pre></div>
</div>
<p>Edit samba configuration (samba must be installed first):</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span><span class="nb">echo</span> -e <span class="s2">&quot;[davidsdk]\n\</span>
<span class="s2"> path = /var/tmp/davidsdk\n\</span>
<span class="s2"> public = yes\n\</span>
<span class="s2"> writeable = yes\n\</span>
<span class="s2"> browseable = yes\n\</span>
<span class="s2"> guest ok = yes\n\</span>
<span class="s2"> create mask = 0775&quot;</span> <span class="p">|</span><span class="se">\</span>
sudo tee -a /etc/samba/smb.conf
</pre></div>
</div>
<p>Restard samba server:</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>sudo service smbd restart
</pre></div>
</div>
<p>Use the <span>setLocalAndRemotePaths</span> function to set the local and remote paths, if you use the same path as above; this doesnt have to be called if the server is running of the same machine as the client.</p>
<div class="highlight-cpp notranslate"><div class="highlight"><pre><span></span><span class="n">davidsdk_ptr</span><span class="o">-&gt;</span><span class="n">setLocalAndRemotePaths</span> <span class="p">(</span><span class="s">&quot;/var/tmp/davidsdk/&quot;</span><span class="p">,</span> <span class="s">&quot;</span><span class="se">\\\\</span><span class="s">name_of_machine</span><span class="se">\\</span><span class="s">davidsdk</span><span class="se">\\</span><span class="s">&quot;</span><span class="p">);</span>
</pre></div>
</div>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">If you get a Error_Fail = -107 error, it is most probably a write access missing in the temporary directory.</p>
</div>
</div>
<div class="section" id="file-formats">
<h2><a class="toc-backref" href="#id5">File formats</a></h2>
<p>Three file formats are available to export the meshes / clouds.</p>
<ul class="simple">
<li>STL: No texture support, binary format</li>
<li>OBJ: Texture support, no binary format available</li>
<li>PLY: Texture support, binary format is available but davidSDK uses ASCII format</li>
</ul>
<p>Use the <span>setFileFormatToOBJ</span>,
<span>setFileFormatToPLY</span>,
<span>setFileFormatToSTL</span> to choose between the different formats.</p>
<p>The default format used is OBJ. (it is compatible with davidSDK server trial version)</p>
</div>
<div class="section" id="calibration">
<h2><a class="toc-backref" href="#id6">Calibration</a></h2>
<p>In order to use the davidSDK scanner the camera and the projector must be calibrated. This can be done by calling the <span>calibrate</span> function of the DavidSDKGrabber object, if the calibration fails, please check <a class="reference external" href="http://wiki.david-3d.com/david-wiki">the wiki</a>.</p>
<p>The davidSDK will only allow you to scan if the scanner is calibrated, the davidSDK provides functions to load and save configuration files for the calibration. Also note that the davidSDK server will automatically reload the last calibration data when restarted.</p>
</div>
<div class="section" id="using-the-example">
<h2><a class="toc-backref" href="#id7">Using the example</a></h2>
<p>The <a class="reference external" href="https://github.com/PointCloudLibrary/pcl/blob/master/visualization/tools/davidsdk_viewer.cpp">pcl_davidsdk_viewer</a> example shows how to display a point cloud grabbed from a davidSDK device using the <span>DavidSDKGrabber</span> class.</p>
<p>When using the DavidSDKGrabber you must connect to the server first; if the server is running locally you dont need to specify an IP address. If you are using davidSDK over a network just call <span>connect</span> with the address IP as a string, please also check that the connection didnt failed:</p>
<div class="highlight-cpp notranslate"><div class="highlight"><pre><span></span><span class="n">davidsdk_ptr</span><span class="o">-&gt;</span><span class="n">connect</span> <span class="p">(</span><span class="s">&quot;192.168.1.50&quot;</span><span class="p">);</span>
<span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="n">davidsdk_ptr</span><span class="o">-&gt;</span><span class="n">isConnected</span> <span class="p">())</span>
<span class="p">{</span>
<span class="n">PCL_ERROR</span> <span class="p">(</span><span class="s">&quot;Cannot connect to davidSDK server.</span><span class="se">\n</span><span class="s">&quot;</span><span class="p">);</span>
<span class="k">return</span> <span class="p">(</span><span class="o">-</span><span class="mi">1</span><span class="p">);</span>
<span class="p">}</span>
</pre></div>
</div>
<a class="reference internal image-reference" href="_images/davidsdk_viewer.jpg"><img alt="_images/davidsdk_viewer.jpg" src="_images/davidsdk_viewer.jpg" style="height: 550px;" /></a>
<div class="admonition warning">
<p class="first admonition-title">Warning</p>
<p class="last">Fetching clouds/meshes from the davidSDK is very slow because the point clouds/meshes are sent through the JSON interface.
Do not expect better performance than 0.07 FPS (using STL format gives best performance).</p>
</div>
<p>Another example is available in <a class="reference external" href="https://github.com/PointCloudLibrary/pcl/blob/master/doc/tutorials/content/sources/davidsdk/">PCL sources</a>, it uses OpenCV to display davidSDK images and the PCLVisualizer to display the point cloud at the same time.</p>
</div>
</div>
</div>
</div>
<footer>
<hr/>
<div role="contentinfo">
<p>
&copy; Copyright
</p>
</div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>