This repository has been archived on 2026-02-22. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
Livox-SDK/docs/index.html
2020-04-01 20:53:55 +08:00

200 lines
19 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 PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>Livox SDK API: 1 Introduction</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
$(document).ready(initResizable);
$(window).load(resizeHeight);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
$(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectlogo"><img alt="Logo" src="1.png"/></td>
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">Livox SDK API
&#160;<span id="projectnumber">V2.1.0</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li class="current"><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
<li>
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</span>
</div>
</li>
</ul>
</div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('index.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div class="header">
<div class="headertitle">
<div class="title">1 Introduction </div> </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><p>Livox SDK is the software development kit designed for all Livox products. It is developed based on C/C++ following Livox SDK Communication Protocol, and provides easy-to-use C style API. With Livox SDK, users can quickly connect to Livox products and receive point cloud data.</p>
<p>Livox SDK consists of Livox SDK communication protocol, Livox SDK core, Livox SDK API, Linux sample, and ROS demo.</p>
<h2>Prerequisites</h2>
<ul>
<li>Ubuntu 14.04/Ubuntu 16.04/Ubuntu 18.04, both x86 and ARM (Nvidia TX2)</li>
<li>Windows 7/10, Visual Studio 2015/2017</li>
<li>C++11 compiler</li>
</ul>
<h1>2 Livox SDK Communication Protocol</h1>
<p>Livox SDK communication protocol opens to all users. It is the communication protocol between user programs and Livox products. The protocol consists of control commands and data format. Please refer to the <a href="https://github.com/Livox-SDK/Livox-SDK/wiki/Livox-SDK-Communication-Protocol">Livox SDK Communication Protocol</a> for detailed information.</p>
<h1>3 Livox SDK Core</h1>
<p>Livox SDK provides the implementation of control commands and point cloud data transmission, as well as the C/C++ API. The basic structure of Livox SDK core is shown as below:</p>
<div class="image">
<img src="sdk.png" alt="sdk.png"/>
<div class="caption">
Livox SDK Architecture</div></div>
<p> User Datagram Protocol (UDP) is used for communication between Livox SDK and LiDAR sensors. Please refer to the Livox SDK Communication Protocol for further information. Point cloud data handler supports point cloud data transmission, while command handler receives and sends control commands. And the C/C++ API is based on command handler and point cloud data handler.</p>
<p>The Livox LiDAR sensors can be connected to host directly or through the Livox Hub. Livox SDK supports both connection methods. When LiDAR units are connected to host directly, the host will establish communication with each LiDAR unit individually. And if the LiDAR units connect to host through Hub, then the host only communicates with the Livox Hub while the Hub communicates with each LiDAR unit.</p>
<h1>4 Livox SDK API</h1>
<p>Livox SDK API provides a set of C style functions which can be conveniently integrated in C/C++ programs. Please refer to the <a href="https://livox-sdk.github.io/Livox-SDK/">Livox SDK API Reference</a> for further information.</p>
<h2>4.1 Installation</h2>
<p>The installation procedures in Ubuntu 18.04/16.04/14.04 LTS and Windows 7/10 are shown here as examples. For Ubuntu 18.04/16.04/14.04 32-bit LTS and Mac, you can get it in <a href="https://github.com/Livox-SDK/Livox-SDK/wiki">Livox-SDK wiki</a>. </p><h3>4.1.1 Ubuntu 18.04/16.04/14.04 LTS</h3>
<h4>Dependencies</h4>
<p>Livox SDK requires <a href="https://cmake.org/">CMake 3.0.0+</a> as dependencies. You can install these packages using apt: </p><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span>&#160;sudo apt install cmake pkg-config</div></div><!-- fragment --> <h4>Compile Livox SDK</h4>
<p>In the Livox SDK directory, run the following commands to compile the project: </p><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span>&#160;git clone https://github.com/Livox-SDK/Livox-SDK.git</div><div class="line"><a name="l00002"></a><span class="lineno"> 2</span>&#160;cd Livox-SDK</div><div class="line"><a name="l00003"></a><span class="lineno"> 3</span>&#160;sudo ./third_party/apr/apr_build.sh</div><div class="line"><a name="l00004"></a><span class="lineno"> 4</span>&#160;cd build &amp;&amp; cmake ..</div><div class="line"><a name="l00005"></a><span class="lineno"> 5</span>&#160;make</div><div class="line"><a name="l00006"></a><span class="lineno"> 6</span>&#160;sudo make install</div></div><!-- fragment --> <h3>4.1.2 Windows 7/10</h3>
<h4>Dependencies</h4>
<p>Livox SDK supports Visual Studio 2015/2017 and requires install <a href="https://cmake.org/">CMake 3.0.0+</a> as dependencies.</p>
<p>In the Livox SDK directory, run the following commands to create the Visual Studio solution file. Generate the 32-bit project:</p>
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span>&#160;cd Livox-SDK</div><div class="line"><a name="l00002"></a><span class="lineno"> 2</span>&#160;.\third_party\apr\apr_build.bat</div><div class="line"><a name="l00003"></a><span class="lineno"> 3</span>&#160;cd build &amp;&amp; \</div><div class="line"><a name="l00004"></a><span class="lineno"> 4</span>&#160;cmake ..</div></div><!-- fragment --><p> Generate the 64-bit project: </p><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span>&#160;cd Livox-SDK</div><div class="line"><a name="l00002"></a><span class="lineno"> 2</span>&#160;.\third_party\apr\apr_build.bat amd64</div><div class="line"><a name="l00003"></a><span class="lineno"> 3</span>&#160;cd build &amp;&amp; \</div><div class="line"><a name="l00004"></a><span class="lineno"> 4</span>&#160;cmake .. -G &quot;Visual Studio 15 2017 Win64&quot;</div></div><!-- fragment --> <h4>Compile Livox SDK</h4>
<p>You can now compile the Livox SDK in Visual Studio.</p>
<h3>4.1.3 ARM-Linux Cross Compile</h3>
<p>The procedure of cross compile Livox-SDK in ARM-Linux are shown below。</p>
<h4>Dependencies</h4>
<p>Host machine requires install cmake and gcc。You can install these packages using apt:</p>
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span>&#160;sudo apt install cmake gcc</div></div><!-- fragment --><h4>Cross Compile Toolchain</h4>
<p>If your ARM board vendor provides a cross compile toolchain, you can skip the following step of installing the toolchain and use the vendor-supplied cross compile toolchain instead.</p>
<p>The following commands will install C and C++ cross compiler toolchains for 32bit and 64bit ARM board. You need to install the correct toolchain for your ARM board. For 64bit SoC ARM board, only install 64bit toolchain, and for 32bit SoC ARM board, only install 32bit toolchain.</p>
<p>Install **ARM 32 bits cross compile toolchain**</p>
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span>&#160;sudo apt-get install gcc-arm-linux-gnueabi g++-arm-linux-gnueabi</div></div><!-- fragment --><p>Install **ARM 64 bits cross compile toolchain**</p>
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span>&#160;sudo apt-get install gcc-aarch64-linux-gnu g++-aarch64-linux-gnu</div></div><!-- fragment --><h4>Cross Compile Livox-SDK</h4>
<p>For **ARM 32 bits toolchain**In the Livox SDK directoryrun the following commands to cross compile the project:</p>
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span>&#160;cd Livox-SDK</div><div class="line"><a name="l00002"></a><span class="lineno"> 2</span>&#160;cd build &amp;&amp; \</div><div class="line"><a name="l00003"></a><span class="lineno"> 3</span>&#160;cmake .. -DCMAKE_SYSTEM_NAME=Linux -DCMAKE_C_COMPILER=arm-linux-gnueabi-gcc -DCMAKE_CXX_COMPILER=arm-linux-gnueabi-g++</div><div class="line"><a name="l00004"></a><span class="lineno"> 4</span>&#160;make</div></div><!-- fragment --><p>For **ARM 64 bits toolchain**In the Livox SDK directoryrun the following commands to cross compile the project:</p>
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span>&#160;cd Livox-SDK</div><div class="line"><a name="l00002"></a><span class="lineno"> 2</span>&#160;cd build &amp;&amp; \</div><div class="line"><a name="l00003"></a><span class="lineno"> 3</span>&#160;cmake .. -DCMAKE_SYSTEM_NAME=Linux -DCMAKE_C_COMPILER=aarch64-linux-gnu-gcc -DCMAKE_CXX_COMPILER=aarch64-linux-gnu-g++</div><div class="line"><a name="l00004"></a><span class="lineno"> 4</span>&#160;make</div></div><!-- fragment --><p><b>Note:</b></p>
<ul>
<li>gcc cross compiler need to support C ++11 standard</li>
</ul>
<h2>4.2 Run Livox SDK Sample</h2>
<p>Two samples are provided in Sample/Lidar and Sample/Hub, which demonstrate how to configure Livox LiDAR units and receive the point cloud data when directly connecting Livox SDK to LiDAR units or by using a Livox Hub, respectively. The sequence diagram is shown as below:</p>
<div class="image">
<img src="sample.png" alt="sample.png"/>
</div>
<h3>4.2.1 Ubuntu 18.04/16.04 /14.04 LTS</h3>
<p>For Ubuntun 18.04/16.04/14.04 LTS, run the <em>lidar_sample</em> if connect with the LiDAR unit(s): </p><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span>&#160;cd sample/lidar &amp;&amp; ./lidar_sample</div></div><!-- fragment --><p> or run the <em>hub_sample</em> if connect with the hub unit(s): </p><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span>&#160;cd sample/hub &amp;&amp; ./hub_sample</div></div><!-- fragment --> <h3>4.2.2 Windows 7/10</h3>
<p>After compiling the Livox SDK as shown in section 4.1.2, you can find <code>hub_sample.exe</code> or <code>lidar_sample.exe</code> in the {Livox-SDK} or {Livox-SDK} folder, respectively, which can be run directly.</p>
<p>Then you can see the information as below:</p>
<div class="image">
<img src="sdk_init.png" alt="sdk_init.png"/>
</div>
<h3>4.3 Connect to the specific LiDAR units</h3>
<p>Samples we provided will connect all the broadcast device in you LAN in default.There are two ways to connect the specific units:</p>
<ul>
<li>run sample with input options</li>
<li>edit the Broadcast Code list in source code</li>
</ul>
<p><b>NOTE:</b></p>
<p>Each Livox LiDAR unit owns a unique Broadcast Code . The broadcast code consists of its serial number and an additional number (1,2, or 3). The serial number can be found on the body of the LiDAR unit (below the QR code).The Broadcast Code may be used when you want to connect to the specific LiDAR unit(s). The detailed format is shown as below:</p>
<div class="image">
<img src="broadcast_code.png" alt="broadcast_code.png"/>
<div class="caption">
Broadcast Code</div></div>
<h4>4.3.1 Program Options</h4>
<p>We provide the following program options for connecting the specific units and saving log file: </p><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span>&#160;[-c]:Register LiDAR units by Broadcast Code. Connect the registered units ONLY. </div><div class="line"><a name="l00002"></a><span class="lineno"> 2</span>&#160;[-l]:Save the log file(In the executable file&#39;s directory).</div><div class="line"><a name="l00003"></a><span class="lineno"> 3</span>&#160;[-h]:Show help.</div></div><!-- fragment --><p> Here is the example: </p><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span>&#160;./lidar_sample -c &quot;00000000000002&amp;00000000000003&amp;00000000000004&quot; -l</div><div class="line"><a name="l00002"></a><span class="lineno"> 2</span>&#160;./hub_sample -c &quot;00000000000001&quot; -l</div></div><!-- fragment --><h4>4.3.2 Edit Broadcast Code List</h4>
<p>Comment the following code section:</p>
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span>&#160;/** Connect all the broadcast device. */</div><div class="line"><a name="l00002"></a><span class="lineno"> 2</span>&#160;int lidar_count = 0;</div><div class="line"><a name="l00003"></a><span class="lineno"> 3</span>&#160;char broadcast_code_list[kMaxLidarCount][kBroadcastCodeSize];</div></div><!-- fragment --><p>Remove the comment of the following code section, set the BROADCAST_CODE_LIST_SIZE and replace the broadcast code lists in the <code>main.c</code> for both LiDAR sample ({Livox-SDK}/sample/lidar/main.c) and Hub sample ({Livox-SDK}/sample/hub/main.c) with the broadcast code of your devices before building.</p>
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span>&#160;/** Connect the broadcast device in list, please input the broadcast code and modify the BROADCAST_CODE_LIST_SIZE. */</div><div class="line"><a name="l00002"></a><span class="lineno"> 2</span>&#160;/*#define BROADCAST_CODE_LIST_SIZE 3</div><div class="line"><a name="l00003"></a><span class="lineno"> 3</span>&#160;int lidar_count = BROADCAST_CODE_LIST_SIZE;</div><div class="line"><a name="l00004"></a><span class="lineno"> 4</span>&#160;char broadcast_code_list[kMaxLidarCount][kBroadcastCodeSize] = {</div><div class="line"><a name="l00005"></a><span class="lineno"> 5</span>&#160; &quot;000000000000002&quot;,</div><div class="line"><a name="l00006"></a><span class="lineno"> 6</span>&#160; &quot;000000000000003&quot;,</div><div class="line"><a name="l00007"></a><span class="lineno"> 7</span>&#160; &quot;000000000000004&quot;</div><div class="line"><a name="l00008"></a><span class="lineno"> 8</span>&#160;};*/</div></div><!-- fragment --><h3>4.4 Generate the lvx file</h3>
<p>We provide the C++ sample to generate the lvx file for hub and LiDAR unit(s). You can use the same way in <code>4.2.1</code> and <code>4.2.2</code> to run them.</p>
<h4>4.4.1 Program Options</h4>
<p>You can alse use the program options in <code>4.3.1</code> to connect specific device and generate the log file, and we provide two new options for lvx file: </p><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span>&#160;[-t] Time to save point cloud to the lvx file.(unit: s)</div><div class="line"><a name="l00002"></a><span class="lineno"> 2</span>&#160;[-p] Get the extrinsic parameter from standard extrinsic.xml file(The same as viewer) in the executable file&#39;s directory.(Especially for LiDAR unit(s) as the hub will calculate the extrinsic parameter by itself)</div></div><!-- fragment --><p> Here is the example: </p><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span>&#160;./lidar_lvx_sample -c &quot;00000000000002&amp;00000000000003&amp;00000000000004&quot; -l -t 10 -p</div><div class="line"><a name="l00002"></a><span class="lineno"> 2</span>&#160;./hub_lvx_sample -c &quot;00000000000001&quot; -l -t 10</div></div><!-- fragment --><h1>5 Support</h1>
<p>You can get support from Livox with the following methods:</p><ul>
<li>Send email to <a href="#" onclick="location.href='mai'+'lto:'+'dev'+'@l'+'ivo'+'xt'+'ech'+'.c'+'om'; return false;">dev@l<span style="display: none;">.nosp@m.</span>ivox<span style="display: none;">.nosp@m.</span>tech.<span style="display: none;">.nosp@m.</span>com</a> with a clear description of your problem and your setup</li>
<li>Github Issues </li>
</ul>
</div></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="footer">Generated by
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.11 </li>
</ul>
</div>
</body>
</html>