306 lines
14 KiB
HTML
Raw Normal View History

<!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 from Ensenso cameras &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 from Ensenso cameras</a><ul>
<li><a class="reference internal" href="#install-ensenso-drivers">Install Ensenso drivers</a></li>
<li><a class="reference internal" href="#configuring-pcl">Configuring PCL</a></li>
<li><a class="reference internal" href="#using-the-example">Using the example</a></li>
<li><a class="reference internal" href="#extrinsic-calibration">Extrinsic calibration</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 from Ensenso cameras</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-from-ensenso-cameras">
<span id="ensenso-cameras"></span><h1><a class="toc-backref" href="#id1">Grabbing point clouds from Ensenso cameras</a></h1>
<p>In this tutorial we will learn how to use the <a class="reference external" href="http://en.ids-imaging.com/">IDS-Imaging</a> Ensenso cameras within PCL. This tutorial will show you how to configure PCL
and how to use the examples to fetch point clouds from the <a class="reference external" href="http://www.ensenso.de/">Ensenso</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-from-ensenso-cameras" id="id1">Grabbing point clouds from Ensenso cameras</a><ul>
<li><a class="reference internal" href="#install-ensenso-drivers" id="id2">Install Ensenso drivers</a></li>
<li><a class="reference internal" href="#configuring-pcl" id="id3">Configuring PCL</a></li>
<li><a class="reference internal" href="#using-the-example" id="id4">Using the example</a></li>
<li><a class="reference internal" href="#extrinsic-calibration" id="id5">Extrinsic calibration</a></li>
</ul>
</li>
</ul>
</div>
<div class="section" id="install-ensenso-drivers">
<h2><a class="toc-backref" href="#id2">Install Ensenso drivers</a></h2>
<p>The Ensenso drivers are free (as in beer) and available for download, for each of them follow the instructions provided:</p>
<blockquote>
<div><ul class="simple">
<li><a class="reference external" href="http://en.ids-imaging.com/download-ueye.html">uEye</a></li>
<li><a class="reference external" href="http://www.ensenso.de/download">Ensenso SDK</a></li>
</ul>
</div></blockquote>
<p>Plug-in the camera and test if the Ensenso is working, launch <code class="docutils literal notranslate"><span class="pre">nxView</span></code> in your terminal to check if you can actually use the camera.</p>
</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 Ensenso cameras. You need to make sure <code class="docutils literal notranslate"><span class="pre">WITH_ENSENSO</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 followed the instructions before).</p>
<p>The default following values can be tweaked into cmake if you dont have a standard installation, for example:</p>
<p>You can deactivate building the Ensenso support by setting <code class="docutils literal notranslate"><span class="pre">WITH_ENSENSO</span></code> to false.
Compile and install PCL.</p>
</div>
<div class="section" id="using-the-example">
<h2><a class="toc-backref" href="#id4">Using the example</a></h2>
<p>The <a class="reference external" href="https://github.com/PointCloudLibrary/pcl/blob/master/visualization/tools/ensenso_viewer.cpp">pcl_ensenso_viewer</a> example shows how to
display a point cloud grabbed from an Ensenso device using the <a class="reference external" href="http://docs.pointclouds.org/trunk/classpcl_1_1_ensenso_grabber.html">EnsensoGrabber</a> class.</p>
<p>Note that this program opens the TCP port of the nxLib tree, this allows you to open the nxLib tree with the nxTreeEdit program (port 24000).
The capture parameters (exposure, gain etc..) are set to default values.
If you have performed and stored an extrinsic calibration it will be temporary reset.</p>
<p>If you are using an Ensenso X device you have to calibrate the device before trying to run the PCL driver. If you dont you will get an error like this:</p>
<div class="highlight-cpp notranslate"><div class="highlight"><pre><span></span><span class="n">Initialising</span> <span class="n">nxLib</span>
<span class="n">Opening</span> <span class="n">Ensenso</span> <span class="n">stereo</span> <span class="n">camera</span> <span class="n">id</span> <span class="o">=</span> <span class="mi">0</span>
<span class="nl">openDevice</span><span class="p">:</span> <span class="n">NxLib</span> <span class="n">error</span> <span class="n">ExecutionFailed</span> <span class="p">(</span><span class="mi">17</span><span class="p">)</span> <span class="n">occurred</span> <span class="k">while</span> <span class="n">accessing</span> <span class="n">item</span> <span class="o">/</span><span class="n">Execute</span><span class="p">.</span>
<span class="p">{</span>
<span class="s">&quot;ErrorSymbol&quot;</span><span class="o">:</span> <span class="s">&quot;InvalidCalibrationData&quot;</span><span class="p">,</span>
<span class="s">&quot;ErrorText&quot;</span><span class="o">:</span> <span class="s">&quot;Stereo camera calibration data is corrupted or not supported yet by the current software version.&quot;</span><span class="p">,</span>
<span class="s">&quot;Execute&quot;</span><span class="o">:</span> <span class="p">{</span>
<span class="s">&quot;Command&quot;</span><span class="o">:</span> <span class="s">&quot;Open&quot;</span><span class="p">,</span>
<span class="s">&quot;Parameters&quot;</span><span class="o">:</span> <span class="p">{</span>
<span class="s">&quot;AllowFirmwareUpload&quot;</span><span class="o">:</span> <span class="n">null</span><span class="p">,</span>
<span class="s">&quot;Cameras&quot;</span><span class="o">:</span> <span class="s">&quot;171197&quot;</span><span class="p">,</span>
<span class="s">&quot;FirmwareUpload&quot;</span><span class="o">:</span> <span class="p">{</span>
<span class="s">&quot;Camera&quot;</span><span class="o">:</span> <span class="n">null</span><span class="p">,</span>
<span class="s">&quot;Projector&quot;</span><span class="o">:</span> <span class="n">null</span>
<span class="p">},</span>
<span class="s">&quot;LoadCalibration&quot;</span><span class="o">:</span> <span class="n">null</span><span class="p">,</span>
<span class="s">&quot;Projector&quot;</span><span class="o">:</span> <span class="n">null</span><span class="p">,</span>
<span class="s">&quot;Threads&quot;</span><span class="o">:</span> <span class="n">null</span>
<span class="p">}</span>
<span class="p">},</span>
<span class="s">&quot;Time&quot;</span><span class="o">:</span> <span class="mi">8902</span><span class="p">,</span>
<span class="s">&quot;TimeExecute&quot;</span><span class="o">:</span> <span class="mi">8901</span><span class="p">,</span>
<span class="s">&quot;TimeFinalize&quot;</span><span class="o">:</span> <span class="mf">0.03477</span><span class="p">,</span>
<span class="s">&quot;TimePrepare&quot;</span><span class="o">:</span> <span class="mf">0.01185</span>
<span class="p">}</span>
</pre></div>
</div>
<div class="highlight-cpp notranslate"><div class="highlight"><pre><span></span><span class="n">ensenso_ptr</span><span class="o">-&gt;</span><span class="n">enumDevices</span> <span class="p">();</span>
<span class="n">ensenso_ptr</span><span class="o">-&gt;</span><span class="n">openTcpPort</span> <span class="p">();</span>
<span class="n">ensenso_ptr</span><span class="o">-&gt;</span><span class="n">openDevice</span> <span class="p">();</span>
<span class="n">ensenso_ptr</span><span class="o">-&gt;</span><span class="n">configureCapture</span> <span class="p">();</span>
<span class="n">ensenso_ptr</span><span class="o">-&gt;</span><span class="n">setExtrinsicCalibration</span> <span class="p">();</span>
</pre></div>
</div>
<p>The code is very similar to the <code class="docutils literal notranslate"><span class="pre">pcl_openni_viewer</span></code>.
All the Ensenso devices connected are listed and then the point cloud are fetched as fast as possible.</p>
<p>Here is an example of the terminal output</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>$ pcl_ensenso_viewer
Initialising nxLib
Number of connected cameras: 1
Serial No Model Status
140242 N10-1210-18 Available
Opening Ensenso stereo camera id = 0
FPS: 3.32594
FPS: 3.367
FPS: 3.79441
FPS: 4.01204
FPS: 4.07747
FPS: 4.20309
Closing Ensenso stereo camera
</pre></div>
</div>
<a class="reference internal image-reference" href="_images/ensenso_viewer.jpg"><img alt="_images/ensenso_viewer.jpg" src="_images/ensenso_viewer.jpg" style="height: 550px;" /></a>
<p>Another example is available in <a class="reference external" href="https://github.com/PointCloudLibrary/pcl/blob/master/doc/tutorials/content/sources/ensenso_cameras/">PCL sources</a>, it uses OpenCV to display Ensenso
images and the PCLVisualizer to display the point cloud at the same time.</p>
</div>
<div class="section" id="extrinsic-calibration">
<h2><a class="toc-backref" href="#id5">Extrinsic calibration</a></h2>
<p>If you want to perform extrinsic calibration of the sensor, please first make sure your EnsensoSDK version is greater than 1.3.
A fully automated extrinsic calibration ROS package is available to help you calibrate the sensor mounted on a robot arm,
the package can be found in the <a class="reference external" href="https://gitlab.com/InstitutMaupertuis/ensenso_extrinsic_calibration">Institut Maupertuis repository</a>.</p>
<p>The following video shows the automatic calibration procedure on a Fanuc R1000iA 80f industrial robot:</p>
<iframe width="800" height="500" src="https://www.youtube.com/embed/2g6gdx8fKX8" frameborder="0" allowfullscreen></iframe></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>