Skip to content

Latest commit

 

History

History
44 lines (32 loc) · 2.82 KB

File metadata and controls

44 lines (32 loc) · 2.82 KB

Real-Time DBSCAN on YDLidar G2

Real-time visualization and clustering of data from the YDLidar G2 using the DBSCAN (Density-Based Spatial Clustering of Applications with Noise) algorithm.. The visualization is implemented with pygame, while the data processing and clustering are handled using numpy and scikit-learn. By clustering objects around with lidar, we can develop further algorithms to control robots in the environment. alt text

Two critical values for DBSCAN to work well. Epsilon (eps) is the maximum distance between two points for them to be considered as in the same neighborhood. min_samples is the minimum number of points required to form a dense region (i.e., a cluster). To optimize them we generate the K-distance graph and silhouette score. alt text

YDLidar G2 Overview

The YDLidar G2 is a 2D triangular lidar sensor with the following features:

Before getting started, make sure to review the following resources:

Prerequisites

To use this project with Python, you will need the following tools:

  • vcpkg: to manage C++ libraries.
  • CMake: to control the software compilation process.
  • SWIG: to connect C/C++ code with various high-level programming languages.
  • Visual Studio is recommended by manufacturer. But I used VS Code, no problem.

Installation and Setup

  • Step 1: Build the YDLidar SDK and Python API
  • Follow the instructions in the YDLidar SDK repository to build the C++ library using CMake and generate the Python bindings using SWIG.
  • Step 2: Install the USB Driver
  • Download and install USB adapter board driver from the YDLidar service support page. After installation, verify the device in the Device Manager. alt text
  • Step 3: Set Up a Python Virtual Environment to avoid compatibility issues

TODO:

  • Improve plotting, add data assosiation
  • Extend it to all lidars for YD Lidar by implementing lidar setup class
  • Enable choice either detect standing objects or not detect them.