12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- #############################################################
- # #
- # Copyright (c) 2021, University of California, Los Angeles #
- # #
- # Authors: Kenny J. Chen, Brett T. Lopez #
- # Contact: kennyjchen@ucla.edu, btlopez@ucla.edu #
- # #
- #############################################################
- cmake_minimum_required(VERSION 3.10.0)
- project(direct_lidar_odometry)
- add_compile_options(-std=c++14)
- set(CMAKE_BUILD_TYPE "Release")
- find_package( PCL REQUIRED )
- include_directories(${PCL_INCLUDE_DIRS})
- add_definitions(${PCL_DEFINITIONS})
- link_directories(${PCL_LIBRARY_DIRS})
- find_package( Eigen3 REQUIRED )
- include_directories(${EIGEN3_INCLUDE_DIR})
- include(FindOpenMP)
- if(OPENMP_FOUND)
- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
- set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}")
- else(OPENMP_FOUND)
- message("ERROR: OpenMP could not be found.")
- endif(OPENMP_FOUND)
- set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
- set(THREADS_PREFER_PTHREAD_FLAG TRUE)
- find_package(Threads REQUIRED)
- find_package(catkin REQUIRED COMPONENTS
- roscpp
- std_msgs
- sensor_msgs
- geometry_msgs
- pcl_ros
- )
- catkin_package(
- CATKIN_DEPENDS
- roscpp
- std_msgs
- sensor_msgs
- geometry_msgs
- pcl_ros
- INCLUDE_DIRS
- include
- LIBRARIES
- ${PROJECT_NAME}
- nano_gicp
- nanoflann
- )
- include_directories(include ${catkin_INCLUDE_DIRS})
- # NanoFLANN
- add_library(nanoflann SHARED
- src/nano_gicp/nanoflann.cc
- )
- target_link_libraries(nanoflann ${PCL_LIBRARIES})
- target_include_directories(nanoflann PUBLIC include ${PCL_INCLUDE_DIRS})
- # NanoGICP
- add_library(nano_gicp SHARED
- src/nano_gicp/lsq_registration.cc
- src/nano_gicp/nano_gicp.cc
- )
- target_link_libraries(nano_gicp ${PCL_LIBRARIES} ${OpenMP_LIBS} nanoflann)
- target_include_directories(nano_gicp PUBLIC include ${PCL_INCLUDE_DIRS} ${EIGEN3_INCLUDE_DIR})
- # Odometry Node
- add_executable(dlo_odom_node src/dlo/odom_node.cc src/dlo/odom.cc)
- add_dependencies(dlo_odom_node ${catkin_EXPORTED_TARGETS})
- target_compile_options(dlo_odom_node PRIVATE ${OpenMP_FLAGS})
- target_link_libraries(dlo_odom_node ${catkin_LIBRARIES} ${PCL_LIBRARIES} ${OpenMP_LIBS} Threads::Threads nano_gicp)
- # Mapping Node
- add_executable (dlo_map_node src/dlo/map_node.cc src/dlo/map.cc)
- add_dependencies(dlo_map_node ${catkin_EXPORTED_TARGETS})
- target_compile_options(dlo_map_node PRIVATE ${OpenMP_FLAGS})
- target_link_libraries(dlo_map_node ${catkin_LIBRARIES} ${PCL_LIBRARIES} ${OpenMP_LIBS} Threads::Threads)
|