LSD-SLAM jade 安装 catkin_make

Tutorial – Building of LSD-SLAM on ROS with Catkin Workspace (ROS Indigo + Ubuntu 14.04 [64-bit]) (English)

In this tutorial, we’ll see how to compile the LSD-SLAM project on Ubuntu 14.04 using the ROS (Robot Operating System) framework in its “Indigo Igloo” version and specifically using “Catkin”, which is currently the official building system of ROS and has become the successor of the original ROS building system known as “Rosbuild”.

In the following, the steps to carry out the installation and compilation of the LSD-SLAM project are described:

1- Once ROS has been installed and configured and we have created a Catkin Workspace, we open a terminal on Ubuntu and we navigate to the folder that we are using as the Catkin Workspace by running the following command:

cd /src

In the preceding command, where appears one must put the location in which the Catkin Workspace is found within the Ubuntu file-system.

2- Within the Workspace we clone the principal “branch” of the LSD-SLAM project with the command: git clone https://github.com/tum-vision/lsd_slam.git

3- In the following, we change to the Catkin “branch” of the LSD-SLAM project with these commands:

cd lsd_slam/
git checkout catkin

4- With the preceding commands, we should already have available in the Workspace the code of the LSD-SLAM “branch” of Catkin, but even so we next perform a simple manual verification to prove that the structure of the project files that we have in our Workspace is in correspondence with the Catkin “branch” of the LSD-SLAM project.

We run the command: ls

The response that we should receive should be the following:

LICENSE lsd_slam lsd_slam_core lsd_slam_viewer README.md

5- At this point, it would only remain for us to install the dependencies that the project needs in order to be compiled.
We must install the following libraries:

ros-indigo-libg2o ros-indigo-cv-bridge liblapack-dev libblas-dev freeglut3-dev libqglviewer-dev libsuitesparse-dev libx11-dev

The installation of these libraries carried out with the following single command:

sudo apt-get install ros-indigo-libg2o ros-indigo-cv-bridge liblapack-dev libblas-dev freeglut3-dev libqglviewer-dev libsuitesparse-dev libx11-dev

6) At this point, we try to perform the compilation. For that, we first of all change to the Catkin Workspace with the instruction: cd

Next we run the command that performs the compilation: catkin_make

In case the compilation is successful, you can go to step 11 to perform the execution test of the project, being able to visualize that way that the whole system works correctly.

7- If the compilation has failed, this is probably because some configuration files of the project are not set up properly for compilation in ROS Indigo with Catkin Workspace. First of all, we open the file “package.xml” both in the folder “lsd_slam/lsd_slam_viewer” and in the folder “lsd_slam/lsd_slam_core”. Once both files are open, we will verify that inside them there are the two following instructions:


cmake_modules

cmake_modules

In case they don’t exist, we will introduce them in the following way:

The instruction cmake_modules will go right after all of the instructions of type

The instruction cmake_modules will go just after all of the instructions of type .

8- We continue verification of the configuration files. Now we will open the file “CMakeFiles.txt” both in the folder “lsd_slam/lsd_slam_viewer” and in the folder “lsd_slam/lsd_slam_core” and we will verify that in both files there is the following instruction:


find_package(cmake_modules REQUIRED)

In case it doesn’t exist, we introduce it just before the first instruction of the type “find_package”.

9- We will finish the test of the configuration files by opening the file “CMakeLists.txt” in the folder “lsd_slam/lsd_slam_core” and verifying that the following instruction exists:


target_link_libraries(lsdslam FABMAPLIB {G2O_LIBRARIES} ${catkin_LIBRARIES} csparse cxsparse X11)

In case the preceding instruction doesn’t exist, there must exist another similar one without the added library “X11”, therefore the only thing that we would have to do would be to add the library “X11” to the instruction “target_link_libraries” as is shown in the instruction above.

10- At this point we return to compiling the project as explained in step 6. The commands for compiling are the following:

cd
catkin_make

In this case the compilation ought to be performed correctly since all of the configuration files are adapted for the compilation in ROS Indigo with Catkin Workspace.

11) At this point, once we have already succeeded in compiling the project, we will carry out a small test of the system with the aid of one of the “.bag” files that the creators of the project provide to test the LSD_SLAM system.

The “.bag” file that we will utilize can be downloaded here: LSD_room.bag.zip
Once the file “LSD_room.bag.zip” is downloaded, it will have to be decompressed.

In the following, we will begin to start the nodes needed to execute the test.

We will open a new terminal and enter the following command to start the ROS CORE: roscore

We open a new terminal and enter the following command to execute the LSD-SLAM visualization node: rosrun lsd_slam_viewer viewer

We open a new terminal and enter the following command to execute the main LSD-SLAM node: rosrun lsd_slam_core live_slam image:=/image_raw camera_info:=/camera_info

At this point it only remains for us to execute the file “LSD_room.bag” with the following instruction: rosbag play /LSD_room.bag

In the command above, would be the location in the Ubuntu file-system where the file “LSD_room.bag” is stored.
这里写图片描述

猜你喜欢

转载自blog.csdn.net/qz1992/article/details/76647935
今日推荐