This project is my master's thesis, successfully defended in 2017 on the highest mark. Full text with detailed charts, images, algorythms and dataflow diagrams is attached, but only in Russian.
Let's assume that we have 2D lidar, which allows to get distance to obstacles only in one plane, but we want to make full 3D point cloud. This goal can be achieved if we perform scan in one plane, then turn lidar a little and perform another scan, and so on. As a result we will get an array of values in spherical coordinate system, each value represents distance to obstacle with two angles between the obstacle and center of lidar and horizon respectfully. We can see something like that: This image is shifted a little to reveal volume. Each yellow dot is a single lidar measurement.
As a raw point cloud this information is not very valuable. What could be extracted from it? We can try to find some patterns, basic geometric shapes, for example.Raw point cloud is converted to a monochrome image (depth map) by projection to a plane, where intensity of each pixel represents distance to an obstacle.
Then we can apply any pattern recognition algorythm. I used the next steps to discover basic shapes:
- Segmentation of the image by applying pixel intensity thresholds. It produces binary images. Because intensity represents distance to an obstacle, we can select objects in foreground or background changing thresholds.
- Removing too small fragments and applying mathematical morphology.
- Applying Canny edge detector.
- Discovering shapes by representing edges in Freeman chain code and calculating compactness measure of a shape. Result is coordinates of a center and radius for circles, coordinates of corners for a rectangle.
Figures on the same image but on the different distance range (defferent values of thershold on the segmentation step):
This system consists of four parts:
- PC with main program. It collects data from lidar, coordinate it movement, processes point clouds and performs patterns recognition. This program is written in LabView. PC connects with motor controller via UART.
- Stepper motor with driver and mechanical parts.
- Lidar. It connected directly to the PC and installed in the holder on the motor shaft.
- Motor controller. It recieves commands from PC and transforms to signals to the driver, made of Arduino plate.