This repository provides a library which can be used to deploy SLAM for the DJI Tello Drone. The implementation makes use of the ORB-SLAM2 algorithm to create a point cloud map by analyzing the video feed from the drone which is communicated using ROS, with the DJITelloPy library used to receive the frames.
- Modified ORB_SLAM2 (with point cloud outputting) repository (All depenencies of this library must be resolved)
- The DJITelloPy repository
- ROS Kinetic
- Clone the master branch of this repository as vrrl.
git clone https://gitlab.com/Salarios77/vrrl.git vrrl
- Add the SLAM_ROS directory to the ROS_PACKAGE_PATH by the following line to your bashrc and restart the terminal console.
export ROS_PACKAGE_PATH=${ROS_PACKAGE_PATH}:'PATH_TO_VRRL'/vrrl/SLAM_ROS
- Change directory to the SLAM_ROS package folder.
cd vrrl/SLAM_ROS
- Change the set (ORB_SLAM2_DIR ...) line in CMakeLists.txt to refer to the directory where the ORB_SLAM2 library is located.
set (ORB_SLAM2_DIR "PATH_TO_ORB_SLAM2/ORB_SLAM2")
- Create a build folder and build the package. Source setup.bash.
mkdir build && cd build cmake .. make source devel/setup.bash
- Run the Mono node from the SLAM_ROS package which will wait for the video feed from the drone.
rosrun SLAM_ROS Mono ../../Calibration/ORBvoc.txt ../../Calibration/tello.yaml
- Open a new terminal console and change directory to vrrl/Tello. Then, initiate video recording from the drone.
cd vrrl/Tello python FrameCapture.py
-
Make sure you have a distribution of python with the right packages. Have roscore running in the background.
-
Run the code to start a listener node.
python3 pc_filter.py
-
Run the ros command to convert a pcd file to a pointcloud message.
rosrun pcl_ros pcd_to_pointcloud path_to_pcd
The camera parameters and ORB-SLAM2 vocabulary can be configured by modifying the files under vrrl/Calibration. See the ORB_SLAM2 repository for further information.