Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Indigo devel #12

Open
wants to merge 16 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 0 additions & 65 deletions CMakeLists.txt

This file was deleted.

14 changes: 0 additions & 14 deletions ExampleGroovyHydro.launch

This file was deleted.

62 changes: 23 additions & 39 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ If you use ORB-SLAM in an academic work, please cite:

#2. Prerequisites (dependencies)

With the catkin version you only need to install the dependencies running rosdep.
Skip to the installation step.

##2.1 Boost

We use the Boost library to launch the different threads of our SLAM system.
Expand All @@ -35,7 +38,7 @@ We use the Boost library to launch the different threads of our SLAM system.

##2.2 ROS
We use ROS to receive images from the camera or from a recorded sequence (rosbag), and for visualization (rviz, image_view).
**We have tested ORB-SLAM in Ubuntu 12.04 with ROS Fuerte, Groovy and Hydro**.
**We have tested ORB-SLAM in Ubuntu 12.04 with ROS Fuerte, Groovy, Hydro and Indigo**.
If you do not have already installed ROS in your computer, we recommend you to install the Full-Desktop version of ROS Fuerte (http://wiki.ros.org/fuerte/Installation/Ubuntu).

##2.3 g2o (included)
Expand All @@ -56,56 +59,33 @@ It only depends on OpenCV, but it should be included in the ROS distribution.

#3. Installation

1. Make sure you have installed ROS and all library dependencies (boost, eigen3, cholmod, blas, lapack).

2. In your ROS package path (check your environment variable `ROS_PACKAGE_PATH`) clone this repository:
1. In your ROS package path (check your environment variable `ROS_PACKAGE_PATH`) clone this repository:

git clone https://github.com/raulmur/ORB_SLAM.git ORB_SLAM

3. Build g2o. Go into `Thirdparty/g2o/` and execute:

mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
make

*Tip: To achieve the best performance in your computer, set your favorite compilation flags in line 97 and 98 of* `Thirdparty/g2o/CMakeLists.txt`
(by default -03 -march=native)

4. Build DBoW2. Go into Thirdparty/DBoW2/ and execute:

mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
make
2. Run this line from your catkin workspace root, `indigo` here should be replaced with your preferred ROS distro.
`rosdep install --from-paths src --ignore-src --rosdistro indigo -y`

*Tip: Set your favorite compilation flags in line 4 and 5 of* `Thirdparty/DBoW2/CMakeLists.txt` (by default -03 -march=native)

5. Build ORB_SLAM. In the ORB_SLAM root execute:

mkdir build
cd build
cmake .. -DROS_BUILD_TYPE=Release
make
3. Build all by running catkin_make in your workspace root.

*Tip: Set your favorite compilation flags in line 12 and 13 of* `Thirdparty/DBoW2/CMakeLists.txt` (by default -03 -march=native)

#4. Usage

**See section 5 to run the Example Sequence**.

1. Launch ORB-SLAM from the terminal (`roscore` should have been already executed):
1. Launch orb_slam from the terminal (`roscore` should have been already executed):

rosrun ORB_SLAM ORB_SLAM PATH_TO_VOCABULARY PATH_TO_SETTINGS_FILE
rosrun orb_slam orb_slam PATH_TO_VOCABULARY PATH_TO_SETTINGS_FILE

You have to provide the path to the ORB vocabulary and to the settings file. The paths must be absolute or relative to the ORB_SLAM directory.
We already provide the vocabulary file we use in `ORB_SLAM/Data/ORBvoc.yml`. Uncompress the file, as it will be loaded much faster.
You have to provide the path to the ORB vocabulary and to the settings file. The paths must be absolute or relative to the orb_slam directory.
We already provide the vocabulary file we use in `orb_slam/Data/ORBvoc.yml`. Uncompress the file, as it will be loaded much faster.

2. The last processed frame is published to the topic `/ORB_SLAM/Frame`. You can visualize it using `image_view`:
2. The last processed frame is published to the topic `/orb_slam/Frame`. You can visualize it using `image_view`:

rosrun image_view image_view image:=/ORB_SLAM/Frame _autosize:=true
rosrun image_view image_view image:=/orb_slam/Frame _autosize:=true

3. The map is published to the topic `/ORB_SLAM/Map`, the current camera pose and global world coordinate origin are sent through `/tf` in frames `/ORB_SLAM/Camera` and `/ORB_SLAM/World` respectively. Run `rviz` to visualize the map:
3. The map is published to the topic `/orb_slam/Map`, the current camera pose and global world coordinate origin are sent through `/tf` in frames `/orb_slam/Camera` and `/orb_slam/World` respectively. Run `rviz` to visualize the map:

*in ROS Fuerte*:

Expand All @@ -115,11 +95,11 @@ It only depends on OpenCV, but it should be included in the ROS distribution.

rosrun rviz rviz -d Data/rviz.rviz

4. ORB_SLAM will receive the images from the topic `/camera/image_raw`. You can now play your rosbag or start your camera node.
4. orb_slam will receive the images from the topic `/camera/image_raw`. You can now play your rosbag or start your camera node.
If you have a sequence with individual image files, you will need to generate a bag from them. We provide a tool to do that: https://github.com/raulmur/BagFromImages.


**Tip: Use a roslaunch to launch `ORB_SLAM`, `image_view` and `rviz` from just one instruction. We provide an example**:
**Tip: Use a roslaunch to launch `orb_slam`, `image_view` and `rviz` from just one instruction. We provide an example**:

*in ROS Fuerte*:

Expand All @@ -128,6 +108,10 @@ If you have a sequence with individual image files, you will need to generate a
*in ROS Groovy or Hydro*:

roslaunch ExampleGroovyHydro.launch

*in ROS Groovy or Hydro*:

roslaunch orb_slam orb_slam.launch


#5. Example Sequence
Expand Down Expand Up @@ -157,7 +141,7 @@ We provide the settings and the rosbag of an example sequence in our lab. In thi

#6. The Settings File

ORB_SLAM reads the camera calibration and setting parameters from a YAML file. We provide an example in `Data/Settings.yaml`, where you will find all parameters and their description. We use the camera calibration model of OpenCV.
orb_slam reads the camera calibration and setting parameters from a YAML file. We provide an example in `Data/Settings.yaml`, where you will find all parameters and their description. We use the camera calibration model of OpenCV.

Please make sure you write and call your own settings file for your camera (copy the example file and modify the calibration)

Expand All @@ -172,5 +156,5 @@ The system is able to initialize from planar and non-planar scenes. In the case

#8. Need Help?

If you have any trouble installing or running ORB-SLAM, contact the authors.
If you have any trouble installing or running orb_slam, contact the authors.

29 changes: 23 additions & 6 deletions Thirdparty/g2o/CMakeLists.txt → g2o/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,27 @@
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
SET(CMAKE_LEGACY_CYGWIN_WIN32 0)
cmake_minimum_required(VERSION 2.8.3)
project(g2o)

PROJECT(g2o)
find_package(catkin REQUIRED)

LIST(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake_modules)
find_package(Cholmod REQUIRED)
find_package(Eigen3 REQUIRED)

catkin_package(
INCLUDE_DIRS .
LIBRARIES g2o_solver_cholmod g2o_solver_dense
g2o_stuff g2o_types_sba
g2o_types_sim3 g2o_types_slam3d
)

include_directories(
include
${EIGEN3_INCLUDE_DIR}
${CHOLMOD_INCLUDE_DIR}
${PROJECT_SOURCE_DIR}
)

set(g2o_SOURCE_DIR ${PROJECT_SOURCE_DIR}/g2o)

# The library prefix
SET(LIB_PREFIX g2o_)
Expand Down Expand Up @@ -55,9 +75,6 @@ IF(WIN32)
ELSE(WIN32)
SET(g2o_LIBRARY_OUTPUT_DIRECTORY ${g2o_SOURCE_DIR}/lib CACHE PATH "Target for the libraries")
ENDIF(WIN32)
SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${g2o_LIBRARY_OUTPUT_DIRECTORY})
SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${g2o_LIBRARY_OUTPUT_DIRECTORY})
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${g2o_RUNTIME_OUTPUT_DIRECTORY})

# Set search directory for looking for our custom CMake scripts to
# look for SuiteSparse, QGLViewer, and Eigen3.
Expand Down
File renamed without changes.
22 changes: 22 additions & 0 deletions g2o/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#ifndef G2O_CONFIG_H
#define G2O_CONFIG_H

/* #undef G2O_HAVE_OPENGL */
/* #undef G2O_OPENGL_FOUND */
/* #undef G2O_OPENMP */
#define G2O_SHARED_LIBS 1
/* #undef G2O_LGPL_SHARED_LIBS */

// available sparse matrix libraries
#define G2O_HAVE_CHOLMOD 1
/* #undef G2O_HAVE_CSPARSE */

#define G2O_CXX_COMPILER "GNU /usr/bin/c++"

// give a warning if Eigen defaults to row-major matrices.
// We internally assume column-major matrices throughout the code.
#ifdef EIGEN_DEFAULT_TO_ROW_MAJOR
# error "g2o requires column major Eigen matrices (see http://eigen.tuxfamily.org/bz/show_bug.cgi?id=422)"
#endif

#endif
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
22 changes: 22 additions & 0 deletions g2o/g2o/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#ifndef G2O_CONFIG_H
#define G2O_CONFIG_H

/* #undef G2O_HAVE_OPENGL */
/* #undef G2O_OPENGL_FOUND */
/* #undef G2O_OPENMP */
#define G2O_SHARED_LIBS 1
/* #undef G2O_LGPL_SHARED_LIBS */

// available sparse matrix libraries
#define G2O_HAVE_CHOLMOD 1
/* #undef G2O_HAVE_CSPARSE */

#define G2O_CXX_COMPILER "GNU /usr/bin/c++"

// give a warning if Eigen defaults to row-major matrices.
// We internally assume column-major matrices throughout the code.
#ifdef EIGEN_DEFAULT_TO_ROW_MAJOR
# error "g2o requires column major Eigen matrices (see http://eigen.tuxfamily.org/bz/show_bug.cgi?id=422)"
#endif

#endif
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ADD_LIBRARY(core ${G2O_LIB_TYPE}
ADD_LIBRARY(${LIB_PREFIX}core ${G2O_LIB_TYPE}
base_edge.h
base_binary_edge.h hyper_graph_action.cpp
base_binary_edge.hpp hyper_graph_action.h
Expand Down Expand Up @@ -37,11 +37,9 @@ robust_kernel_factory.cpp robust_kernel_factory.h
g2o_core_api.h
)

SET_TARGET_PROPERTIES(core PROPERTIES OUTPUT_NAME ${LIB_PREFIX}core)
TARGET_LINK_LIBRARIES(${LIB_PREFIX}core ${LIB_PREFIX}stuff)

TARGET_LINK_LIBRARIES(core stuff)

INSTALL(TARGETS core
INSTALL(TARGETS ${LIB_PREFIX}core
RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin
LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib
ARCHIVE DESTINATION ${CMAKE_INSTALL_PREFIX}/lib
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
ADD_LIBRARY(solver_cholmod ${G2O_LIB_TYPE}
ADD_LIBRARY(${LIB_PREFIX}solver_cholmod ${G2O_LIB_TYPE}
solver_cholmod.cpp
linear_solver_cholmod.h
)

INCLUDE_DIRECTORIES(${CHOLMOD_INCLUDE_DIR})

SET_TARGET_PROPERTIES(solver_cholmod PROPERTIES OUTPUT_NAME ${LIB_PREFIX}solver_cholmod)

ADD_DEFINITIONS(${BLAS_DEFINITIONS} ${LAPACK_DEFINITIONS})
TARGET_LINK_LIBRARIES(solver_cholmod ${CHOLMOD_LIBRARIES} ${BLAS_LIBRARIES} ${LAPACK_LIBRARIES} core)
TARGET_LINK_LIBRARIES(${LIB_PREFIX}solver_cholmod ${CHOLMOD_LIBRARIES} ${BLAS_LIBRARIES} ${LAPACK_LIBRARIES} ${LIB_PREFIX}core)

INSTALL(TARGETS solver_cholmod
INSTALL(TARGETS ${LIB_PREFIX}solver_cholmod
RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin
LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib
ARCHIVE DESTINATION ${CMAKE_INSTALL_PREFIX}/lib
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
ADD_LIBRARY(solver_dense ${G2O_LIB_TYPE}
ADD_LIBRARY(${LIB_PREFIX}solver_dense ${G2O_LIB_TYPE}
solver_dense.cpp linear_solver_dense.h
)

SET_TARGET_PROPERTIES(solver_dense PROPERTIES OUTPUT_NAME ${LIB_PREFIX}solver_dense)
TARGET_LINK_LIBRARIES(${LIB_PREFIX}solver_dense ${LIB_PREFIX}core)

TARGET_LINK_LIBRARIES(solver_dense core)

INSTALL(TARGETS solver_dense
INSTALL(TARGETS ${LIB_PREFIX}solver_dense
RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin
LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib
ARCHIVE DESTINATION ${CMAKE_INSTALL_PREFIX}/lib
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
ADD_LIBRARY(stuff ${G2O_LIB_TYPE}

ADD_LIBRARY(${LIB_PREFIX}stuff ${G2O_LIB_TYPE}
filesys_tools.h string_tools.h
color_macros.h macros.h timeutil.cpp
command_args.cpp misc.h sparse_helper.cpp timeutil.h
Expand All @@ -10,9 +11,7 @@ ADD_LIBRARY(stuff ${G2O_LIB_TYPE}
g2o_stuff_api.h
)

SET_TARGET_PROPERTIES(stuff PROPERTIES OUTPUT_NAME ${LIB_PREFIX}stuff)

INSTALL(TARGETS stuff
INSTALL(TARGETS ${LIB_PREFIX}stuff
RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin
LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib
ARCHIVE DESTINATION ${CMAKE_INSTALL_PREFIX}/lib
Expand All @@ -33,7 +32,7 @@ IF(OPENGL_FOUND)
ENDIF()

IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux" AND NOT ANDROID)
TARGET_LINK_LIBRARIES(stuff rt)
TARGET_LINK_LIBRARIES(${LIB_PREFIX}stuff rt)
ENDIF()

FILE(GLOB headers "${CMAKE_CURRENT_SOURCE_DIR}/*.h" "${CMAKE_CURRENT_SOURCE_DIR}/*.hpp")
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
ADD_LIBRARY(types_sba ${G2O_LIB_TYPE}
ADD_LIBRARY(${LIB_PREFIX}types_sba ${G2O_LIB_TYPE}
types_sba.h types_six_dof_expmap.h
types_sba.cpp types_six_dof_expmap.cpp
g2o_types_sba_api.h
)

SET_TARGET_PROPERTIES(types_sba PROPERTIES OUTPUT_NAME ${LIB_PREFIX}types_sba)
TARGET_LINK_LIBRARIES(${LIB_PREFIX}types_sba ${LIB_PREFIX}core ${LIB_PREFIX}types_slam3d)

TARGET_LINK_LIBRARIES(types_sba core types_slam3d)

INSTALL(TARGETS types_sba
INSTALL(TARGETS ${LIB_PREFIX}types_sba
RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin
LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib
ARCHIVE DESTINATION ${CMAKE_INSTALL_PREFIX}/lib
Expand Down
File renamed without changes.
File renamed without changes.
Loading