Code Monkey home page Code Monkey logo

livox-sdk2's Introduction

Livox SDK2

Introduction

Livox SDK2 is a software development kit designed for all Livox lidars such as HAP and Mid-360. It is developed based on C/C++ following Livox SDK2 Communication Protocol, and provides easy-to-use C style APIs. With the Livox SDK2, users can quickly connect to the Livox Lidars and receive point cloud data.

Livox SDK2 consists of Livox SDK2 core code, Livox SDK2 APIs and three samples.

Prerequisites

  • x86

    • Ubuntu 20.04 / Ubuntu 18.04
  • Windows 10 & Visual Studio 2019

  • Compiler supporting C++11

  • ARM: to be suppoted soon

Livox SDK2 API

Livox SDK2 API provides a set of C-style APIs, which can be conveniently integrated in C/C++ programs. Please refer to the Livox SDK2 APIs.

Livox SDK2 Communication Protocol

Livox SDK2 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 documents below:

HAP(TX/T1):

Mid-360:

Installation

Ubuntu 20.04 / 18.04

Dependencies:

Install the CMake using apt:

$ sudo apt install cmake

Compile and install the Livox-SDK2:

$ git clone https://github.com/Livox-SDK/Livox-SDK2.git
$ cd ./Livox-SDK2/
$ mkdir build
$ cd build
$ cmake .. && make -j
$ sudo make install

Note : The generated shared library and static library are installed to the directory of "/usr/local/lib". The header files are installed to the directory of "/usr/local/include".

Uninstall sdk:

$ sudo rm -rf /usr/local/lib/liblivox_lidar_sdk_*
$ sudo rm -rf /usr/local/include/livox_lidar_*

Windows 10

Dependencies:

Preparation:

> git clone https://github.com/Livox-SDK/Livox-SDK2.git
> cd Livox-SDK2
> md build && cd build

Generate a 64-bit project:

> cmake .. -G "Visual Studio 16 2019" -A x64

Generate a 32-bit project:

> cmake .. -G "Visual Studio 16 2019" -A Win32

Compiling:

You can now compile the Livox-SDK2 in Visual Studio 2019.

How to Run the Sample

Livox SDK2 includes three samples, which are "livox_lidar_quick_start", "logger" and "multi_lidars_upgrade".

Livox lidar quick start

Ubuntu 20.04 / 18.04

Connect to the Lidar(s), and run the program 'livox_lidar_quick_start' :

$ cd samples/livox_lidar_quick_start && ./livox_lidar_quick_start ../../../samples/livox_lidar_quick_start/config.json

Windows 10

After compiling the Livox SDK2 as shown in Installation above, you can find 'livox_lidar_quick_start.exe' in the directory of 'Livox-SDK2\out\build\x64-Release\samples\livox_lidar_quick_start\'.

Copy the config file 'Livox-SDK2\sample\livox_lidar_quick_start\config.json' into the directory containing the program 'livox_lidar_quick_start.exe', and run:

> livox_lidar_quick_start.exe config.json

Then you can see the information as below:

> [info] Data Handle Init Succ.  [data_handler.cpp] [Init] [42]
> [info] Create detection channel detection socket:0  [device_manager.cpp] [CreateDetectionChannel] [232]

In the example, the config file 'config.json' is copied to the same directory containing the program 'livox_lidar_quick_start.exe'.

Note :

  1. When using HAP lidar / Mid-360 lidar, you can also replace "config.json" with "hap_config.json" / "mid360_config.json" in the command above.
  2. For how to configure config.json / hap_config.json / mid360_config.json file, pealse refer to config file description.

Logger

Parameters Configuration

Parameter Detailed description Default
lidar_log_enable Enable or disable lidar logger.
Logger is enabled by default.
true
lidar_log_cache_size_MB Set lidar log cache size. The unit is MB .
500
lidar_log_path Set the save path of lidar log file.
The log file is saved in the current path by default.
"./"

These Parameters are located in config.json / hap_config.json / mid360_config.json files

Run the 'logger'

Ubuntu 20.04 / 18.04

Connect to the Lidar(s), and run the program 'logger' :

$ cd samples/logger && ./logger ../../../samples/logger/config.json
Windows 10

After compiling the Livox SDK2 as shown in Installation above, you can find 'logger.exe' in the directory of 'Livox-SDK2\out\build\x64-Release\samples\logger\'.

Copy the config file 'Livox-SDK2\sample\logger\config.json' into the directory containing the program 'logger.exe', and run:

> logger.exe config.json

In the example, the config file 'config.json' is copied to the same directory containing the program 'logger.exe'.

Note :

  1. When using HAP lidar / Mid-360 lidar, you can also replace "config.json" with "hap_config.json" / "mid360_config.json" in the command above.
  2. For how to configure config.json / hap_config.json / mid360_config.json file, pealse refer to config file description.

Multi-lidars upgrade

Ubuntu 20.04 / 18.04

Connect to the Lidar(s), and run the program 'multi_lidars_upgrade' :

$ cd samples/multi_lidars_upgrade && ./multi_lidars_upgrade ../../../samples/multi_lidars_upgrade/config.json [firmware file path]

After executing the above command, Lidar stops and the firmware upgrade starts. The Lidar(s) upgrade takes a while and the upgrade progress is printed on termial. Also "upgrade successfully" will be printed on terminal when finishing upgrading.

Windows 10

After compiling the Livox SDK2 as shown in Installation above, you can find 'multi_lidars_upgrade.exe' in the directory of 'Livox-SDK2\out\build\x64-Release\samples\multi_lidars_upgrade\'.

Copy the config file 'Livox-SDK2\sample\multi_lidars_upgrade\config.json' and firmware file into the directory containing the program 'multi_lidars_upgrade.exe', and run:

> multi_lidars_upgrade.exe config.json [firmware file name]

In the example, the config file 'config.json' is copied to the same directory containing the program 'multi_lidars_upgrade.exe'.

Note :

  1. When using HAP lidar / Mid-360 lidar, you can also replace "config.json" with "hap_config.json" / "mid360_config.json" in the command above.
  2. For how to configure config.json / hap_config.json / mid360_config.json file, pealse refer to config file description.

Support

You can get support from Livox via:

  • Send an email to [email protected], appended with detailed description for your problem and your setup;
  • Raise a github issue

livox-sdk2's People

Contributors

sina-sixwheel avatar

Forkers

purple-mesh

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.