Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Fetching contributors…
Cannot retrieve contributors at this time
327 lines (251 sloc) 10.2 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:
At the moment it supports calibrated stereo rigs, and RGB-D cameras.
Monocular SLAM is NOT supported (yet).
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.
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.
Detailed instructions are listed below.
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:
mkdir newcollege
cd newcollege
wget -nH --cut-dirs=4 -r -l2 --no-parent -A "*.pnm"
wget -nH --cut-dirs=4 -r -l2 --no-parent -A "*.pnm"
wget -nH --cut-dirs=4 -r -l2 --no-parent -A "*.pnm"
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.
git clone git://
Now, enter the project directory
cd ScaViSLAM
and then create and enter the directory for EXTERNAL libraries:
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
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://
cd g2o
mkdir svs_build
cd svs_build
cmake ..
make -j8
cd ../..
Download and install opencv (version 2.3.1a) inside EXTERNAL:
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://
cd Pangolin
mkdir svs_build
cd svs_build
cmake ..
make -j8
cd ../..
Clone and install Sophus in folder EXTERNAL
git clone git://
cd Sophus
mkdir svs_build
cd svs_build
cmake ..
make -j8
cd ../..
Install VisionTools in folder EXTERNAL
git clone 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
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 /ScaViSLAM/
mkdir svs_build_with_pcl
cd svs_build_with_pcl
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.
This is more tricky since we need to make sure that the image stream is
rectified. Some adaptation in the code might be necessary...
You are welcome to report bugs and request features at:
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: ""
- 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:
The coding style is largely influenced by the google c++ coding style guide:
(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
- "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
* 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.