Fusion SLAM
Home
  • OVERVIEW AND INTRODUCTION
  • INSTALLING
  • DATASETS
  • TUTORIALS FOR ROVIOLI (ONLINE FRONTEND)
  • TUTORIALS FOR USING MAPLAB (OFFLINE TOOLS) - BASICS
  • TUTORIALS FOR USING MAPLAB (OFFLINE TOOLS) - USE-CASES
  • TUTORIALS FOR USING MAPLAB SERVER (ONLINE)
  • HARDWARE INTEGRATION AND SENSOR CALIBRATION
  • TUTORIALS FOR EXTENDING MAPLAB
  • DEVELOPEMENT GUIDELINES
  • ADDITIONAL FORMATS
Project
  • 简体中文
  • English
Home
  • OVERVIEW AND INTRODUCTION
  • INSTALLING
  • DATASETS
  • TUTORIALS FOR ROVIOLI (ONLINE FRONTEND)
  • TUTORIALS FOR USING MAPLAB (OFFLINE TOOLS) - BASICS
  • TUTORIALS FOR USING MAPLAB (OFFLINE TOOLS) - USE-CASES
  • TUTORIALS FOR USING MAPLAB SERVER (ONLINE)
  • HARDWARE INTEGRATION AND SENSOR CALIBRATION
  • TUTORIALS FOR EXTENDING MAPLAB
  • DEVELOPEMENT GUIDELINES
  • ADDITIONAL FORMATS
Project
  • 简体中文
  • English
  • OVERVIEW AND INTRODUCTION

    • Introduction to the Maplab Framework
    • Main Papers
    • Additional Citations
    • Related Research
    • FAQ
    • Known Issues
  • INSTALLING

    • Installing on Ubuntu
    • Compilation and Debugging
  • DATASETS
  • TUTORIALS FOR ROVIOLI (ONLINE FRONTEND)

    • ROVIOLI Introduction
    • Running ROVIOLI in VIO mode: calibartion files, rostopics, bag/topic mode, visualization
    • Running ROVIOLI in Localization mode
    • Multi-session mapping with ROVIOLI
  • TUTORIALS FOR USING MAPLAB (OFFLINE TOOLS) - BASICS

    • Basic Console Usage
    • Parameters (Gflags)
    • Console map management: load, save, basic visualization
    • Inspecting and visualizing a map
    • Map visualization: see your map in RViz!
    • Preparing a single session map: optimization, loop-closure
    • Understanding loop-closure
    • Optimizing VI-Maps
    • Preparing a multi-session map: map anchoring, loop-closure, pose-graph relaxation
    • Dense Reconstruction: attaching resources to map, available reconstruction tools
    • Resource Importer
  • TUTORIALS FOR USING MAPLAB (OFFLINE TOOLS) - USE-CASES

    • Multi-session use case: CLA, multi-floor use-case
    • Map sparsification: make your mapping more efficient
    • Stereo Dense Reconstruction: EuRoC, multi-session reconstruction use-case
    • External Features
  • TUTORIALS FOR USING MAPLAB SERVER (ONLINE)
  • HARDWARE INTEGRATION AND SENSOR CALIBRATION

    • Sensor Calibration Format: ncamera, imu-sigmas
    • Initial sensor calibration with Kalibr
    • Sensor calibration refinement
    • Intel RealSense ZR300
    • VersaVIS
  • TUTORIALS FOR EXTENDING MAPLAB

    • Using the MapManager
    • Using Timing and Statistics
    • /maplab/docs/pages/tutorials-extending-maplab/C_Coding-Examples:-Creating-a-custom-console-plugin.html
    • /maplab/docs/pages/tutorials-extending-maplab/D_Coding-Examples:-Working-with-the-VI-Map.html
    • Console Plugin System
  • DEVELOPEMENT GUIDELINES

    • Importing maplab to Eclipse
    • Contributing to maplab
    • Header Include Guide
    • Debugging applications
    • Expressing frame transformations in code
    • Verbosity Policy
  • ADDITIONAL FORMATS

Compilation and Debugging

Use ccache

ccache is a fast compiler cache. It is a program that sits in front of gcc and monitors what is being compiled. If a file was compiled before in the exact same state, then ccache will serve a compilation request from cache and thus lead to "instant" compilation.

To install ccache:

sudo apt-get install ccache
sudo ln -s /usr/bin/ccache /usr/local/bin/gcc
sudo ln -s /usr/bin/ccache /usr/local/bin/g++
sudo ln -s /usr/bin/ccache /usr/local/bin/cc

Compile the package you need

Avoid running catkin build without specifying a package since this builds the entire workspace which takes a long time. You can specify individual packages simply by adding their names:

catkin build maplab

Build single packages efficiently

If you only changed a single package you can also restrict the build process to this single package:

catkin build maplab --no-deps

Compile in Release/Debug mode

Most packages are not built in Release mode. To build packages in Release mode:

catkin build maplab --cmake-args -DCMAKE_BUILD_TYPE=Release

To set this as the default behavior in your current catkin profile:

catkin config --cmake-args -DCMAKE_BUILD_TYPE=Release

If you are actively developing on maplab, debug symbols will sooner or later be helpful, therefore, we recommend to include them when building. This flag will enable all the optimizations of the release mode, but include debug symbols to give the debugger a change to figure out where in the code the program currently is:

-DCMAKE_BUILD_TYPE=RelWithDebInfo

In order to compile all packages in debug mode, i.e. no optimizations plus debug symbols, use:

-DCMAKE_BUILD_TYPE=Debug

Important: Switching these modes does not automatically rebuild packages that have been build before, therefore, clean the workspace first to be sure the new mode is adopted by all packages.

catkin clean --yes

Change individual packages to Debug mode

If you want to efficiently debug a program it makes sense to switch only the package that the error is contained in to Debug mode.

cd ~/catkin_ws/build/maplab
ccmake .

You will now see a window similar to this:

 BUILD_SHARED_LIBS                ON
 CATKIN_DEVEL_PREFIX              /Users/sheep/catkin_ws/devel
 CATKIN_ENABLE_TESTING            ON
 CATKIN_PACKAGE_PREFIX
 CATKIN_SKIP_TESTING              OFF
 CMAKE_BUILD_TYPE                 Release
 CMAKE_INSTALL_PREFIX             /Users/sheep/catkin_ws/install
 ...

Navigate to the line which says CMAKE_BUILD_TYPE using the cursor keys and press Enter. Now replace Debug with Release. Press c to configure, followed by g to generate. (you might now press e to hide warnings.). Finally press q to quit. Now make the package by invoking:

cd ~/catkin_ws/build/maplab && make -j8

HINT: Don't forget to switch back to Release once you are done with debugging.

Run gdb with arguments

In order to run a process with arguments in gdb, the most efficient way is to use:

gdb --ex run --args ~/devel/lib/maplab/maplab --use_external_memory=false

Where --use_external_memory=false is just an example flag.

For adding gdb or valgrind to ROS launch files see examples here.

Prev
Installing on Ubuntu