Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

327 lines (251 sloc) 10.395 kb
***** ScaViSLAM *****
This is a general and scalable framework for visual SLAM. It employs
"Double Window Optimization" (DWO) as described in our ICCV paper:
H. Strasdat, A.J. Davison, J.M.M. Montiel, and K. Konolige
"Double Window Optimisation for Constant Time Visual SLAM"
Proceedings of the IEEE International Conference on Computer Vision, 2011.
Check out the related videos:
http://youtu.be/90Rw3qDuWrw
http://youtu.be/89CNVQ5azsc
At the moment it supports calibrated stereo rigs, and RGB-D cameras.
Monocular SLAM is NOT supported (yet).
*** NOTES AND WARNINGS / READ FIRST ***
This library is a research-level software which is in development.
This is NOT a release version. For sure, features will be added,
bugs will be fixed and the API will change in the future.
Even thought the software is in principal designed to run cross-platform,
it most likely will only work on a recent 64-bit linux (without the need
of adaptations...). It was tested on Ubuntu 11.10 - 64 bit.
(Note there might be problems on 32bit linux related to Eigen3.
http://eigen.tuxfamily.org/dox/TopicUnalignedArrayAssert.html.
I followed the guide describe on this website, but I have not tested it on
32-bit linux yet. Any bug reports/patches are welcome!)
WARNING: There is a bug concerning Eigen3.0 and gcc/g++-4.4. Make sure you install Eigen3.1 as explained below.
(see: http://listengine.tuxfamily.org/lists.tuxfamily.org/eigen/2011/04/msg00013.html
& http://comments.gmane.org/gmane.comp.lib.eigen/2046)
Detailed instructions are listed below.
*** INSTALLATION ***
First download sample image sequences. This will take a while, so do it first.
(These are already rectified stereo images from the New College dataset:
http://www.robots.ox.ac.uk/NewCollegeData/)
>>
cd MY_DATA_DIRECTORY
mkdir newcollege
cd newcollege
wget -nH --cut-dirs=4 -r -l2 --no-parent -A "*.pnm" http://pub1.willowgarage.com/~konolige/data/NewCollege/FullData/StereoImages_1225720041.455302_to_1225720118.251935
wget -nH --cut-dirs=4 -r -l2 --no-parent -A "*.pnm" http://pub1.willowgarage.com/~konolige/data/NewCollege/FullData/StereoImages_1225720118.301927_to_1225720193.248630
wget -nH --cut-dirs=4 -r -l2 --no-parent -A "*.pnm" http://pub1.willowgarage.com/~konolige/data/NewCollege/FullData/StereoImages_1225720193.298630_to_1225720268.945303
<<
Before we start with the installation, we need to perform some preparations.
ScaViSLAM comes with GPU support. Indeed, GPU support is the default option.
(Each GPU method has a CPU equivalent. However those are not tested very much).
Thus, there is an optional dependency on CUDA 4.1 or higher.
Next, install dependencies:
>>
sudo apt-get install freeglut3-dev libglu-dev libglew-dev libboost-all-dev
<<
(This is an incomplete list at the moment, since it is hard to guess which
libraries are installed by default on your linux distribution...)
Now, checkout/clone the ScaViSLAM repository.
>>
cd MY_SOFTWARE_DIRECTORY
git clone git://github.com/strasdat/ScaViSLAM.git
<<
Now, enter the project directory
>>
cd ScaViSLAM
<<
and then create and enter the directory for EXTERNAL libraries:
>>
mkdir EXTERNAL
cd EXTERNAL
<<
The ScaViSLAM build system is designed in a way such that all
dependencies are installed locally in a sub-folder. In this way we avoid
version conflicts (e.g. different OpenCV version which might be installed
system-wide). Please follow the guide step by step and only deviate form
it if you really know what you are doing ;-)
Download Eigen (version 3.1) in folder EXTERNAL
>>
wget http://bitbucket.org/eigen/eigen/get/3.1.0.tar.gz
tar xvf 3.1.0.tar.gz
mv eigen-eigen-ca142d0540d3 eigen3.1
<<
Check out and install g2o (fork with slightly modified cmake file):
>>
git clone git://github.com/strasdat/g2o.git
cd g2o
mkdir svs_build
cd svs_build
cmake ..
make -j8
cd ../..
<<
Download and install opencv (version 2.3.1a) inside EXTERNAL:
>>
wget http://sourceforge.net/projects/opencvlibrary/files/opencv-unix/2.4.2/OpenCV-2.4.2.tar.bz2
tar xvf OpenCV-2.4.2.tar.bz2
mv OpenCV-2.4.2 opencv2
cd opencv2
mkdir svs_build
cd svs_build
cmake ..
make -j8
cd ../..
<<
Clone and install Pangolin
>>
git clone git://github.com/stevenlovegrove/Pangolin.git
cd Pangolin
mkdir svs_build
cd svs_build
cmake ..
make -j8
cd ../..
<<
Clone and install Sophus in folder EXTERNAL
>>
git clone git://github.com/strasdat/Sophus.git
cd Sophus
mkdir svs_build
cd svs_build
cmake ..
make -j8
cd ../..
<<
Install VisionTools in folder EXTERNAL
>>
git clone git://github.com/strasdat/VisionTools.git
cd VisionTools
mkdir svs_build
cd svs_build
cmake ..
make -j8
<<
Move to main project folder "ScaViSLAM" and install ScaViSLAM:
>>
cd ../../../
mkdir svs_build
cd svs_build
cmake ..
make -j8
<<
In case you would like to compile ScaViSLAM WITHOUT CUDA support,
turn CUDA_SUPPORT to OFF in the CMakeLists.txt file.
Make sure the "New College" data set is downloaded completely.
Then add a sym-link inside "ScaViSLAM/data":
>>
cd ../data
ln -s PATH_TO_MY_DATA_DIRECTORY/newcollege newcollege
<<
Run ScaViSLAM on new college image sequence:
>>
cd ../svs_build
./stereo_slam ../data/newcollege.cfg
<<
*** HOW TO USE A RGB-D CAMERA? ***
At the moment, only RGB-D cameras following the PrimeSense reference design
(e.g. Ausus Xtion PRO LIVE) are supported.
First, you need to install PCL (which includes OpenNI):
>>
sudo add-apt-repository ppa:v-launchpad-jochen-sprickerhof-de/pcl
sudo apt-get update
sudo apt-get install libpcl-all
<<
Reinstall ScaViSLAM with PCL support:
>>
cd MY_SOFTWARE_DIRECTORY
cd /ScaViSLAM/
mkdir svs_build_with_pcl
cd svs_build_with_pcl
cmake -DPCL_SUPPORT=ON ..
make -j8
>>
Try out ScaViSLAM with your RGB-D camera life:
>>
./stereo_slam ../data/rgbd-Live.cfg
<<
Dump RGB-D data to the hard disk (to ../data/out; create this directory or
set an appropriate sym-link):
>>
./dump_rgbd ../data/rgbd_live.cfg
<<
Finally, you can process the saved image sequence by adapting the configuration
files "../data/rgbd_example.cfg". Basically, you have to point
"framepipe.path_str" to the saved images.
*** WHAT ABOUT STANDARD STEREO CAMERAS? ***
This is more tricky since we need to make sure that the image stream is
rectified. Some adaptation in the code might be necessary...
*** HOW TO CONTRIBUTE? ***
You are welcome to report bugs and request features at:
https://github.com/strasdat/ScaViSLAM/issues.
To do so click on "New Issue", fill out the form and select the appropriate
label ("Bug" or "Feature Request").
Please feel free to also browse through the "ToDo" and "Future Features"
issues, so you can find out which features are planned to be included
soon ("ToDo") or eventually ("Future Features").
The best and easiest way to contribute is to use the "github" way:
- Register at github (for free).
- Got to: "https://github.com/strasdat/ScaViSLAM"
- Click on "Fork" to create a Fork of ScaViSLAM.
- Commit and push changes into your Fork.
- Click on "Pull Request" in order to ask me whether I would like to merge
the changes into the ScaViSLAM master branch.
(If it is only a small change/bug fix, you could also simply send me
patch etc.)
In order to maximize the likelihood that I will accept your pull request,
please read carefully through the coding style guide:
*** CODING STYLE GUIDE ***
The coding style is largely influenced by the google c++ coding style guide:
http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml
(Reading the document is insightful in any case, even if you don't agree with
"google's" decision!)
I am especially strict about the following rules:
- "When defining a function, parameter order is: inputs, then outputs."
- "All parameters passed by reference must be labeled const."
Thus, the following is NOT okay:
'void method(const Vector2d & in, Vector2d & out)'
Use this instead:
'void method(const Vector2d & in, Vector2d * out)'
- "Of the built-in C++ integer types, the only one used is int. If a program
needs a variable of a different size, use a precise-width integer type
from <stdint.h>, such as int16_t."
- "Use 0 for integers, 0.0 for reals, NULL for pointers, and '\0' for chars."
- "We do not use C++ exceptions."
- "Use the specified order of declarations within a class: public: before
private:, methods before data members (variables), etc."
- "Use a struct only for passive objects that carry data; everything else
is a class."
- "Prefer small and focused functions."
- "Use only approved libraries and language extensions from C++11 (formerly
known as C++0x). Currently, none are approved."
- "We do not allow default function parameters, except in a few uncommon
situations..."
- "Use prefix form (++i) of the increment and decrement operators with
iterators and other template objects."
- "We strongly recommend that you use const whenever it makes sense to do so."
At some points, I deviate from the C++ coding style guide:
- 'Using namespace X;' is okay, but only within(!) the ScaViSLAM namespace.
Never pollute the general namespace '::'.
(However, do not use "using namespace cv" or 'using namespace pangolin'.)
- I use 'boost::thread'.
- In rare cases, it is okay to have public class members.
- It is okay to use streams such as "cout", "cerr", "stringstream". (But
usually, I'd like to use "cerr" and friends only for debugging purposes...)
I also deviate slightly from google's formatting. Therefore the following rule
is the most important one:
"Use common sense and BE CONSISTENT.
If you are editing code, take a few minutes to look at the code around you and
determine its style. If they use spaces around their if clauses, you should,
too. If their comments have little boxes of stars around them, make your
comments have little boxes of stars around them too."
(All cites in "quotation marks" are from the google coding style guide.)
If you would like to use automatic indentation, I recommend you to use
the QtCreator (2.4.0 or newer) for code editing. You can import the ScaViSLAM
code style using "coding_style.xml":
* Open "ScaViSLAM" project in QtCreator.
* Click on "Projects". (Select "ScaViSLAM" tap in case several projects are
open.)
* Click on "Editor Settings".
* Select "Editor Settings: Custom"
* Click on "Coding Style Settings-->Import..." and select "coding_style.xml".
Jump to Line
Something went wrong with that request. Please try again.