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

ROS 2 support #5

Merged
merged 7 commits into from
Jan 3, 2024
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
CUDA support via LANGUAGES definitions
christianrauch committed Jan 3, 2024
commit 403583eea34c872af6c2223c46e312c6205c38d9
7 changes: 6 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -4,7 +4,12 @@ project(multimotionfusion)
set(CMAKE_CXX_STANDARD 17)

# Warnings / Errors
add_compile_options(-Wall -Werror -Wno-write-strings -Wno-deprecated-declarations)
add_compile_options(
$<$<COMPILE_LANGUAGE:CXX>:-Wall>
$<$<COMPILE_LANGUAGE:CXX>:-Werror>
$<$<COMPILE_LANGUAGE:CXX>:-Wno-write-strings>
$<$<COMPILE_LANGUAGE:CXX>:-Wno-deprecated-declarations>
)

# Don't follow symlinks when FILE GLOB_RECURSE (and don't warn)
cmake_policy(SET CMP0009 NEW)
13 changes: 6 additions & 7 deletions Core/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.0.2)

project(multimotionfusion)
project(multimotionfusion LANGUAGES CXX CUDA)

message(STATUS "Evaluating Core/CMAKE")

@@ -9,7 +9,6 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}")
include(GNUInstallDirs)

## External packages
find_package(CUDA REQUIRED)
find_package(SuiteSparse REQUIRED)
find_package(OpenCV REQUIRED)
find_package(OpenMP)
@@ -65,7 +64,7 @@ message(STATUS "MULTIMOTIONFUSION_SHADER_DIR: ${MULTIMOTIONFUSION_SHADER_DIR}")

## Includes
include_directories(${Pangolin_INCLUDE_DIRS})
include_directories(${CUDA_INCLUDE_DIRS})
include_directories(${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES})
include_directories(${SUITESPARSE_INCLUDE_DIRS})
include_directories(${PCL_INCLUDE_DIRS})
include_directories(${OpenCV_INCLUDE_DIRS})
@@ -98,8 +97,6 @@ endif(CMAKE_BUILD_TYPE MATCHES Debug)
# disable to use standard 'glTransformFeedbackVaryings' in palce of 'glTransformFeedbackVaryingsNV'
add_definitions(-DNVIDIA_VARYINGS)

CUDA_COMPILE(cuda_objs ${cuda})

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse -msse2 -msse3 -DSHADER_DIR=${MULTIMOTIONFUSION_SHADER_DIR}")

if(CMAKE_BUILD_TYPE MATCHES Debug)
@@ -117,7 +114,6 @@ add_library(${PROJECT_NAME} SHARED
${utils_srcs}
${shader_srcs}
${cuda}
${cuda_objs}
${containers}
${segmentation}
)
@@ -126,7 +122,7 @@ target_include_directories(${PROJECT_NAME} PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}
${ZLIB_INCLUDE_DIR}
${Pangolin_INCLUDE_DIRS}
${CUDA_INCLUDE_DIRS}
${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES}
${OPENNI2_INCLUDE_DIR}
${OpenCV_INCLUDE_DIRS}
${BOOST_INCLUDE_DIRS}
@@ -142,6 +138,9 @@ target_link_libraries(${PROJECT_NAME}
super_point_inference
)

target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_11)
set_target_properties(${PROJECT_NAME} PROPERTIES CUDA_SEPARABLE_COMPILATION ON)

add_library(ransac STATIC "Utils/RigidRANSAC.cpp")
target_link_libraries(ransac Eigen3::Eigen)

9 changes: 4 additions & 5 deletions GUI/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.5)

project(multimotionfusion-gui)
project(multimotionfusion-gui LANGUAGES CXX CUDA)

set(CMAKE_CXX_STANDARD 17)

@@ -23,7 +23,6 @@ option(ROSNODE "read images live as ROS node" ${HASROS})

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}")
find_package(ZLIB REQUIRED)
find_package(CUDA REQUIRED)
find_package(OpenNI2 REQUIRED)
find_package(OpenCV REQUIRED )
find_package(Boost REQUIRED filesystem)
@@ -57,7 +56,7 @@ if(ROSBAG OR ROSNODE)
endif()

include_directories(${ZLIB_INCLUDE_DIR})
include_directories(${CUDA_INCLUDE_DIRS})
include_directories(${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES})
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../Core)
include_directories(${OPENNI2_INCLUDE_DIR})
include_directories(${Pangolin_INCLUDE_DIRS})
@@ -66,7 +65,7 @@ include_directories(${OpenCV_INCLUDE_DIRS})

message(STATUS "Include-directories: ")
message(STATUS "ZLIB_INCLUDE_DIR: ${ZLIB_INCLUDE_DIR}")
message(STATUS "CUDA_INCLUDE_DIRS: ${CUDA_INCLUDE_DIRS}")
message(STATUS "CUDA_INCLUDE_DIRS: ${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES}")
message(STATUS "OPENNI2_INCLUDE_DIR: ${OPENNI2_INCLUDE_DIR}")
message(STATUS "CMAKE_CURRENT_SOURCE_DIR/../Core: ${${CMAKE_CURRENT_SOURCE_DIR}/../Core}")

@@ -112,7 +111,7 @@ target_include_directories(MultiMotionFusionTools PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}
${ZLIB_INCLUDE_DIR}
${Pangolin_INCLUDE_DIRS}
${CUDA_INCLUDE_DIRS}
${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES}
${OPENNI2_INCLUDE_DIR}
${OpenCV_INCLUDE_DIRS}
${BOOST_INCLUDE_DIRS}