Skip to content

Shazam213/drone-terrain-reconstruction-

Repository files navigation

Project

Flying a drone over some terrain in ROS with a GPS and a Depth Sensor and to construct a 3D model of that terrain with the incorporation of the Point Cloud Library (PCL).

Flying our drone over a sample terrain:
Getting Point Cloud Data of that terrain: And reconstructing it:

Table Of Contents

About the Project

  • The idea is to have a Drone fly over some terrain in ROS with a GPS and a Depth sensor, then get the pointcloud data from the drone and create a 3D map of the topography of the terrain.
  • The traditional problem addressed by surface reconstruction is to recover the digital representation of a physical shape that has been scanned, where the scanned data contains a wide variety of defects. At its core, therefore, surface reconstruction is the process by which a 3D object is inferred, or “reconstructed”, from a collection of discrete points that sample the shape, which is in our case, is obtained from LiDAR Sensors.
  • Throughout the course of this project, we learnt about several reconstruction techniques that included such as:
    • Subsampling
    • Upsampling
    • Estimation of surface normals
    • Surface reconstruction from normals.
  • The project was started with the use of ROS to obtain the Point Cloud data of a terrain with the use of LiDAR sesnsors. The use of Point Cloud Library followed to create 3D Polygonal Meshes and understanding its usage and experimenting with the various algorithms used in PCL for reconstructing meshes from the point clouds.
  • PCL makes use of many algorithms like Marching Cubes, Grid Projection, Greedy Projection, etc. After experimenting, the project focused on creating the mesh using the Greedy Projection Triangulation algorithm. The data for GPT has been created from the Point Cloud using Moving Least Squares via Maximum Likelihood Estimation.

Tech Stack

File Structure

📦Drone-3D-topography
 ┣ 📂assets                           #contains gifs, videos and images of the results
 ┣ 📂config                           #Rviz config files
 ┣ 📂include                          #include files for the plugins
 ┃ ┗ 📜DialogKeyboard.h  
 ┃ ┗ 📜drone_object_ros.h             
 ┃ ┗ 📜pid_controller.h             
 ┃ ┗ 📜plugin_drone.h             
 ┃ ┗ 📜plugin_ros_cam.h             
 ┃ ┗ 📜sensor_model.h
 ┃ ┗ 📜util_ros_cam.h                 
 ┣ 📂launch                           #launch files
 ┃ ┗ 📜simple.launch
 ┣ 📂models                           #files and meshes used to render the model                       
 ┃ ┗ 📂kinect
 ┃ ┃ ┣ 📂materials
 ┃ ┃ ┣ 📂meshes
 ┃ ┃ ┣ 📜model.config
 ┃ ┃ ┗ 📜model.sdf
 ┣ 📂plugins                         #plugins for the model
 ┃ ┗ 📜libplugin_drone.so
 ┃ ┗ 📜libplugin_ros_cam.so                   
 ┣ 📂scripts                          #C++ program used to run the drone
 ┃ ┣ listener.cpp                     #Used to get PCD from the drone and to process the data using PCL
 ┣ 📂src                              #contains custom plugins used with the drone
 ┃ ┣ 📜DialogKeyboard.cpp
 ┃ ┗ 📜DialogKeyboard.ui
 ┃ ┗ 📜drone_keyboard.cpp
 ┃ ┗ 📜drone_object_ros.cpppid_controller.cpp
 ┃ ┗ 📜plugin_drone.cpp
 ┃ ┗ 📜plugin_ros_cam.cpp
 ┃ ┗ 📜plugin_ros_init.cpp
 ┃ ┗ 📜util_ros_cam.cpp
 ┣ 📂urdf
 ┃ ┗ 📜sjtu_drone.urdf
 ┣ 📂worlds                           #world files
 ┃ ┣ 📜terrain.world
 ┣ 📜CMakeLists.txt
 ┣ 📜README.md
 ┗ 📜package.xml
 

Getting Started

Prerequisites and Installlation

Installation

git clone https://github.com/Shazam213/Drone-3d-topography.git

Add this folder to the src directory of your catkin workspace. If you haven't yet created the src folder, do so using the following command:

mkdir src

Initialise the project with

catkin build
source ~/catkin_ws/devel/setup.bash

Execution

Open three terminals and run the following commands:

  • Terminal 1:
source ~/catkin_ws/devel/setup.bash
roslaunch sjtu_drone simple.launch
  • Terminal 2:
source ~/catkin_ws/devel/setup.bash
rosrun sjtu_drone drone_keyboard
  • Terminal 3:
source ~/catkin_ws/devel/setup.bash
rosrun sjtu_drone listener

Process Flow

Results and Demo

WhatsApp.Video.2022-10-15.at.00.30.56.mp4

Future Work

  • Implement other surface reconstruction algorithms like Marching Cubes Algorithm and Poisson Surface Reconstruction using PCL.
  • Uderstand CGAL To implement other surface reconstruction algorithms.
  • Understand the implementation of Delaunay Triangulation using CGAL.
  • Improve the algorithm to make it work for multiple frames of data.

Contributors

Acknowledgements and Resources

License

MIT License

About

project based on 3d topography mapping using a drone

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published