Implement Aerial Lidar SLAM for UAVs Using MATLAB - MATLAB
Video Player is loading.
Current Time 0:00
Duration 6:08
Loaded: 4.52%
Stream Type LIVE
Remaining Time 6:08
 
1x
  • Chapters
  • descriptions off, selected
  • captions off, selected
      Video length is 6:08

      Implement Aerial Lidar SLAM for UAVs Using MATLAB

      Lidar SLAM is a subset of Simultaneous Localization and Mapping or SLAM algorithms, used to develop a map of an environment and localize the pose of a platform or autonomous vehicle in that map. Lidar SLAM algorithms allow the platform to map out unknown environments using a 2D or 3D Lidar sensor.

      MATLAB® and Simulink® provide SLAM algorithms, functions, and analysis tools to develop various mapping applications. In this video, you will learn how to use Lidar Toolbox™ with MATLAB to implement 3D Lidar SLAM algorithm on 3D aerial lidar data collected from an unmanned aerial vehicle (UAV). Further, you can use the 3D aerial lidar maps for applications like path planning, obstacle avoidance, and package delivery.

      Published: 2 Nov 2021

      Hello, everyone. In this video, we will show how to implement simultaneous localization and mapping or SLAM on Aerial Lidar point cloud. We'll be using point cloud data streams from lighthouse sensor mounted on a UAV in the simulation and run. MATLAB provides a broad range of simulation environments. It can be used to implement similar workflows in different application areas.

      Automated Driving Toolbox and UAV Toolbox contains unreal based simulators and keyboard simulation environments. And there is RoadRunner, you create static objects for unreal simulation environment. In this example, we'll use simulation environment available in UAV Toolbox.

      Our work will start with simulating the city environment with the UAV in it. We will then stream lidar data from the simulated lidar model to a MATLAB system. After that, we'll register point plots based on feature descriptors extracted from each point cloud. Finally, we'll implement post graph optimization to correct the drifts that have happened in the registration step and build the complete map.

      Let's start with simulating the environment. We will make use of a city simulation containing lots of roads and buildings. We'll first define a trajectory for our UAV. Note that two trajectory loops have been utilized to ensure loop closure, which is useful in post graph optimization. We are using a Simulink model to perform this simulation. We can now load the Simulink model by running this script.

      There are four main parts to the Simulink model. First one is the Simulation 3D Scene Configuration block. You can find this block from the Simulink library by searching Simulation 3D Scene. This configures the scene to the US city block that we saw earlier. The second block is our Simulation 3D UAV Vehicle model. This places our UAV on the scene and moves it through the trajectory using the xyz and your data we loaded before.

      The third block up on the top is the Simulation 3D Lidar block. We are using the Lidar Model available in UAV Toolbox for this example. This mounts a lidar sensor on top of our UAV. You can select the sensor and configure the parameters like distance, range, range resolution, field of view, et cetera. And the fourth block we have is our MATLAB system. Here we will process the lidar data from the sensor to iteratively create the map.

      Now let's run our simulation. Running the simulation shows the UAV flying on the predefined trajectory and capturing lidar data. The MATLAB System block in our Simulink model collects this data and stitches it together to build a map of the arena. Before I explain how the MATLAB system block operates, I'll briefly explain Point Cloud Registration.

      Point Cloud Registration is the process of stitching multiple point clouds to create a combined bigger point cloud. If we have point cloud data and accurate pose data for each instances, we can use the pose info to stitch the point cloud. But this is not always the case. Our pose info will not be that accurate. So here I'll show how to create the 3D map with only point cloud data in MATLAB.

      We first read two consecutive point clouds and then do some basic preprocessing, like ground removal and down sampling. After that, we'll extract FPFHfeatures from both point cloud using exrtractFPFHfeatures function. Then to match them, we'll use pcmatchfeatures function. Here you can see that we have two point cloud in red and blue colors and the match features are connected with yellow lights.

      Now we'll use these matched features to estimate the transformation between point clouds using estimateGeometricTransform3D function. This will give us the rigid transformation between the point clouds. We'll use pcalign function to align these point clouds using the rigid transformation metrics.

      Here is our align point cloud based on the match features. This is what is happening in the MATLAB system block. It uses the point cloud registration functions for preprocessing, extracting, and matching FPFH descriptors, estimating the transformation, and aligning the point clouds. We'll do this for every third point cloud that is fed into the MATLAB system. This accelerate the processing and accumulates enough motion between the scans.

      Once the simulation is complete, we can see that the map is not aligned properly. This is because There were minor drifts in each registration steps which then accumulated over time when we built the map. We will now apply Pose Graph Optimization to correct these drifts and build the map properly.

      Pose Graph Optimization is a separate topic by its own. Due, to time constraints I would recommend you to watch this MATLAB TikTok. It explains Pose Graph Optimization and how it will help to have a better estimate of the current and past pose and a better model of the environment.

      So here is our final output after Pose Graph Optimization. You can see our optimized three point process in the red color and the map is now aligned properly. It's much cleaner than the one which we got earlier, and it resembles our actual arena. This concludes the Aerial Lidar SLAM workflow. If you have any questions or comments, please let us know.

      View more related videos