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

Catkinized on Indigo #70

Open
wants to merge 7 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
4 changes: 4 additions & 0 deletions lsd_slam/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
cmake_minimum_required(VERSION 2.8.3)
project(lsd_slam)
find_package(catkin REQUIRED)
catkin_metapackage()
22 changes: 22 additions & 0 deletions lsd_slam/package.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0"?>
<package>
<name>lsd_slam</name>
<version>0.0.0</version>
<description>
Large-Scale Direct Monocular SLAM
</description>

<author>Jakob Engel</author>
<maintainer email="[email protected]">Jakob Engel</maintainer>
<license>see http://vision.in.tum.de/lsdslam </license>
<url>http://vision.in.tum.de/lsdslam</url>

<license>TODO</license>
<buildtool_depend>catkin</buildtool_depend>
<run_depend>lsd_slam_core</run_depend>
<run_depend>lsd_slam_viewer</run_depend>

<export>
<metapackage/>
</export>
</package>
72 changes: 44 additions & 28 deletions lsd_slam_core/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,24 +1,31 @@
cmake_minimum_required(VERSION 2.8.7)
project(lsd_slam_core)
include($ENV{ROS_ROOT}/core/rosbuild/rosbuild.cmake)

# Set the build type. Options are:
# Coverage : w/ debug symbols, w/o optimization, w/ code-coverage
# Debug : w/ debug symbols, w/o optimization
# Release : w/o debug symbols, w/ optimization
# Set the build type. Options are:
# Coverage : w/ debug symbols, w/o optimization, w/ code-coverage
# Debug : w/ debug symbols, w/o optimization
# Release : w/o debug symbols, w/ optimization
# RelWithDebInfo : w/ debug symbols, w/ optimization
# MinSizeRel : w/o debug symbols, w/ optimization, stripped binaries
set(ROS_BUILD_TYPE Release)

rosbuild_init()

set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib)
set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH})
# MinSizeRel : w/o debug symbols, w/ optimization, stripped binaries
set(CMAKE_BUILD_TYPE Release)
find_package(catkin REQUIRED COMPONENTS
cv_bridge
dynamic_reconfigure
sensor_msgs
image_transport
roscpp
rosbag
cmake_modules
)

find_package(Eigen3 REQUIRED)
find_package(SuiteParse REQUIRED) # Apparently needed by g2o
find_package(Eigen REQUIRED)
find_package(X11 REQUIRED)
include(cmake/FindG2O.cmake)
include(cmake/FindSuiteParse.cmake)

message("-- CHOLMOD_INCLUDE_DIR : " ${CHOLMOD_INCLUDE_DIR})
message("-- CSPARSE_INCLUDE_DIR : " ${CSPARSE_INCLUDE_DIR})
message("-- G2O_INCLUDE_DIR : " ${G2O_INCLUDE_DIR})

# FabMap
# uncomment this part to enable fabmap
Expand All @@ -27,19 +34,24 @@ find_package(X11 REQUIRED)
#add_definitions("-DHAVE_FABMAP")
#set(FABMAP_LIB openFABMAP )

# Dynamic Reconfigure Services
rosbuild_find_ros_package(dynamic_reconfigure)
include(${dynamic_reconfigure_PACKAGE_PATH}/cmake/cfgbuild.cmake)
gencfg()
generate_dynamic_reconfigure_options(
cfg/LSDDebugParams.cfg
cfg/LSDParams.cfg
)

catkin_package(
LIBRARIES lsdslam
DEPENDS Eigen SuiteSparse
DEPENDS libg2o
)

# SSE flags
rosbuild_check_for_sse()
add_definitions("-DUSE_ROS")
add_definitions("-DENABLE_SSE")

# Also add some useful compiler flag
set(CMAKE_CXX_FLAGS
"${CMAKE_CXX_FLAGS} ${SSE_FLAGS} -march=native -std=c++0x"
"${CMAKE_CXX_FLAGS} ${SSE_FLAGS} -march=native -std=c++0x"
)

# Set source files
Expand Down Expand Up @@ -73,6 +85,7 @@ set(SOURCE_FILES
)

include_directories(
include
${EIGEN3_INCLUDE_DIR}
${PROJECT_SOURCE_DIR}/src
${PROJECT_SOURCE_DIR}/thirdparty/Sophus
Expand All @@ -82,17 +95,20 @@ include_directories(


# build shared library.
rosbuild_add_library(lsdslam SHARED ${SOURCE_FILES})
target_link_libraries(lsdslam ${FABMAP_LIB} g2o_core g2o_stuff csparse cxsparse g2o_solver_csparse g2o_csparse_extension g2o_types_sim3 g2o_types_sba X11)
rosbuild_link_boost(lsdslam thread)
add_library(lsdslam SHARED ${SOURCE_FILES})
target_link_libraries(lsdslam ${FABMAP_LIB} ${G2O_LIBRARIES} ${catkin_LIBRARIES} csparse cxsparse X11)
#rosbuild_link_boost(lsdslam thread)


# build live ros node
rosbuild_add_executable(live_slam src/main_live_odometry.cpp)
target_link_libraries(live_slam lsdslam)
add_executable(live_slam src/main_live_odometry.cpp)
target_link_libraries(live_slam lsdslam ${catkin_LIBRARIES} ${G2O_LIBRARIES})


# build image node
rosbuild_add_executable(dataset_slam src/main_on_images.cpp)
target_link_libraries(dataset_slam lsdslam)
add_executable(dataset src/main_on_images.cpp)
target_link_libraries(dataset lsdslam ${catkin_LIBRARIES} ${G2O_LIBRARIES})

# TODO add INSTALL


2 changes: 0 additions & 2 deletions lsd_slam_core/Makefile

This file was deleted.

3 changes: 1 addition & 2 deletions lsd_slam_core/cfg/LSDDebugParams.cfg
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
#! /usr/bin/env python

PACKAGE='lsd_slam_core'
import roslib; roslib.load_manifest(PACKAGE)

#from driver_base.msg import SensorLevels
from dynamic_reconfigure.parameter_generator import *
from dynamic_reconfigure.parameter_generator_catkin import *

gen = ParameterGenerator()

Expand Down
3 changes: 1 addition & 2 deletions lsd_slam_core/cfg/LSDParams.cfg
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
#! /usr/bin/env python

PACKAGE='lsd_slam_core'
import roslib; roslib.load_manifest(PACKAGE)

#from driver_base.msg import SensorLevels
from dynamic_reconfigure.parameter_generator import *
from dynamic_reconfigure.parameter_generator_catkin import *

gen = ParameterGenerator()

Expand Down
81 changes: 0 additions & 81 deletions lsd_slam_core/cmake/FindEigen3.cmake

This file was deleted.

98 changes: 98 additions & 0 deletions lsd_slam_core/cmake/FindG2O.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
# Locate the g2o libraries
# A general framework for graph optimization.
#
# This module defines
# G2O_FOUND, if false, do not try to link against g2o
# G2O_LIBRARIES, path to the libg2o
# G2O_INCLUDE_DIR, where to find the g2o header files
#
# Niko Suenderhauf <[email protected]>
# Adapted by Felix Endres <[email protected]>
# Updated (ROS) by Jeremie Deray <[email protected]>

IF(UNIX)

IF(G2O_INCLUDE_DIR AND G2O_LIBRARIES)
# in cache already
SET(G2O_FIND_QUIETLY TRUE)
ENDIF(G2O_INCLUDE_DIR AND G2O_LIBRARIES)

MESSAGE(STATUS "Searching for g2o ...")
FIND_PATH(G2O_INCLUDE_DIR
NAMES core math_groups types
PATHS /usr/local /usr /opt/ros/$ENV{ROS_DISTRO}/
PATH_SUFFIXES include/g2o include)

IF (G2O_INCLUDE_DIR)
MESSAGE(STATUS "Found g2o headers in: ${G2O_INCLUDE_DIR}")
ENDIF (G2O_INCLUDE_DIR)

FIND_LIBRARY(G2O_CORE_LIB
NAMES g2o_core
PATHS /usr/local /usr /opt/ros/$ENV{ROS_DISTRO}/lib
PATH_SUFFIXES lib)
FIND_LIBRARY(G2O_STUFF_LIB
NAMES g2o_stuff
PATHS /usr/local /usr /opt/ros/$ENV{ROS_DISTRO}/lib
PATH_SUFFIXES lib)
FIND_LIBRARY(G2O_TYPES_SLAM3D_LIB
NAMES g2o_types_slam3d
PATHS /usr/local /usr /opt/ros/$ENV{ROS_DISTRO}/lib
PATH_SUFFIXES lib)
FIND_LIBRARY(G2O_SOLVER_CHOLMOD_LIB
NAMES g2o_solver_cholmod
PATHS /usr/local /usr /opt/ros/$ENV{ROS_DISTRO}/lib
PATH_SUFFIXES lib)
FIND_LIBRARY(G2O_SOLVER_PCG_LIB
NAMES g2o_solver_pcg
PATHS /usr/local /usr /opt/ros/$ENV{ROS_DISTRO}/lib
PATH_SUFFIXES lib)
FIND_LIBRARY(G2O_SOLVER_CSPARSE_LIB
NAMES g2o_solver_csparse
PATHS /usr/local /usr /opt/ros/$ENV{ROS_DISTRO}/lib
PATH_SUFFIXES lib)
FIND_LIBRARY(G2O_INCREMENTAL_LIB
NAMES g2o_incremental
PATHS /usr/local /usr /opt/ros/$ENV{ROS_DISTRO}/lib
PATH_SUFFIXES lib)
FIND_LIBRARY(G2O_CSPARSE_EXTENSION_LIB
NAMES g2o_csparse_extension
PATHS /usr/local /usr /opt/ros/$ENV{ROS_DISTRO}/lib
PATH_SUFFIXES lib)
FIND_LIBRARY(G2O_TYPE_SBA
NAMES g2o_types_sba
PATHS /usr/local /usr /opt/ros/$ENV{ROS_DISTRO}/lib
PATH_SUFFIXES lib)


SET(G2O_LIBRARIES ${G2O_CSPARSE_EXTENSION_LIB}
${G2O_CORE_LIB}
${G2O_STUFF_LIB}
${G2O_TYPES_SLAM3D_LIB}
${G2O_SOLVER_CHOLMOD_LIB}
${G2O_SOLVER_PCG_LIB}
${G2O_SOLVER_CSPARSE_LIB}
${G2O_INCREMENTAL_LIB}
${G2O_TYPE_SBA}
)

# IF(G2O_LIBRARIES AND G2O_INCLUDE_DIR)
# SET(G2O_FOUND "YES")
# IF(NOT G2O_FIND_QUIETLY)
# MESSAGE(STATUS "-- Found libg2o: ${G2O_LIBRARIES}")
# ENDIF(NOT G2O_FIND_QUIETLY)
# ELSE(G2O_LIBRARIES AND G2O_INCLUDE_DIR)
# IF(NOT G2O_LIBRARIES)
# IF(G2O_FIND_REQUIRED)
# message(-- FATAL_ERROR "Could not find libg2o!")
# ENDIF(G2O_FIND_REQUIRED)
# ENDIF(NOT G2O_LIBRARIES)
#
# IF(NOT G2O_INCLUDE_DIR)
# IF(G2O_FIND_REQUIRED)
# message(-- FATAL_ERROR "Could not find g2o include directory!")
# ENDIF(G2O_FIND_REQUIRED)
# ENDIF(NOT G2O_INCLUDE_DIR)
# ENDIF(G2O_LIBRARIES AND G2O_INCLUDE_DIR)

ENDIF(UNIX)
1 change: 1 addition & 0 deletions lsd_slam_core/cmake/FindSuiteParse.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -126,3 +126,4 @@ ELSE(CSPARSE_INCLUDE_DIR AND CSPARSE_LIBRARY)
SET(CSPARSE_FOUND FALSE)
ENDIF(CSPARSE_INCLUDE_DIR AND CSPARSE_LIBRARY)


17 changes: 0 additions & 17 deletions lsd_slam_core/manifest.xml

This file was deleted.

Loading