Closed KJ-Falloutlast closed 1 day ago
@KJ-Falloutlast 这个问题我遇到过的,我记得是open3D的问题,open3D的安装没那么简单。严格按照官网的install教程来,按照好后,检测写个ros的测试节点,看看项目能否正确rosrun,没问题的话,paloc这个也没问题。具体的解决方法我忘记了,得找一下。你要不看看我的CloudMapEvaluation这个cmake仓库能否正常编译使用,这个可以的话,我猜paloc也可以。
非常感谢前辈的建议,就在1个小时前,我也意外地在Open3D的github链接中发现了这个问题,我的解决思路是这样的:
@KJ-Falloutlast 解决就好。我后面整个docker就好了,目前还没有时间整理这些。
∠(°ゝ°)
前辈您好,我关注您的工作很久了,感谢您开源您的工作,向您致敬。我目前在运行您的算法的时候,遇到了如下问题: 首先说下我的机器配置:
Compile as C++11, supported in ROS Kinetic and newer
set(CMAKE_BUILD_TYPE "Release") if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
Clang compiler in macOS only accepts std::random_shuffle in C++14
else () set(CMAKE_CXX_FLAGS "-std=c++14 ${CMAKE_CXX_FLAGS}") set(CMAKE_CXX_STANDARD 14) # WE CAN REMOVE THIS endif ()
message("Current CPU archtecture: ${CMAKE_SYSTEM_PROCESSOR}") if (CMAKE_SYSTEM_PROCESSOR MATCHES "(x86)|(X86)|(amd64)|(AMD64)") include(ProcessorCount) ProcessorCount(N) message("Processer number: ${N}") if (N GREATER 4) add_definitions(-DMP_EN) add_definitions(-DMP_PROC_NUM=3) message("core for MP: 3") elseif (N GREATER 3) add_definitions(-DMP_EN) add_definitions(-DMP_PROC_NUM=2) message("core for MP: 2") else () add_definitions(-DMP_PROC_NUM=1) endif () else () add_definitions(-DMP_PROC_NUM=1) endif () find_package(OpenMP QUIET) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
from fastlio
SET(CMAKE_BUILD_TYPE "Debug")
ADD_COMPILE_OPTIONS(-std=c++14 )
ADD_COMPILE_OPTIONS(-std=c++11 )
set( CMAKE_CXX_FLAGS "-std=c++14 -O3" )
set( CMAKE_CXX_FLAGS "-std=c++11 -O3" )
add_definitions(-w)
add_definitions(-DROOT_DIR=\"${CMAKE_CURRENT_SOURCE_DIR}/\")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fexceptions" )
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -pthread -std=c++0x -std=c++14 -fexceptions")
message("Current CPU archtecture: ${CMAKE_SYSTEM_PROCESSOR}")
if(CMAKE_SYSTEM_PROCESSOR MATCHES "(x86)|(X86)|(amd64)|(AMD64)" )
include(ProcessorCount)
ProcessorCount(N)
message("Processer number: ${N}")
if(N GREATER 4)
add_definitions(-DMP_EN)
add_definitions(-DMP_PROC_NUM=3)
message("core for MP: 3")
elseif(N GREATER 3)
add_definitions(-DMP_EN)
add_definitions(-DMP_PROC_NUM=2)
message("core for MP: 2")
else()
add_definitions(-DMP_PROC_NUM=1)
endif()
else()
add_definitions(-DMP_PROC_NUM=1)
endif()
find_package(OpenMP QUIET)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
from fastlio
for fastlio
add_definitions(-DROOT_DIR=\"${CMAKE_CURRENT_SOURCE_DIR}/\") find_package(PythonLibs REQUIRED) find_path(MATPLOTLIB_CPP_INCLUDE_DIRS "matplotlibcpp.h")
open3d
find_package(Open3D REQUIRED)
eigen
find_package(Eigen3 REQUIRED)
pcl
find_package(PCL 1.8 REQUIRED)
GTSAM
find_package(GTSAM REQUIRED QUIET)
add ceres and openCV GeographicLib
find_package(Ceres REQUIRED) find_package(OpenCV REQUIRED) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "/usr/share/cmake/geographiclib/") find_package (GeographicLib REQUIRED)
###########################################################################
Find Boost
find_package(Boost REQUIRED COMPONENTS filesystem regex timer date_time program_options) if (NOT TARGET Boost::boost) add_library(Boost::boost INTERFACE IMPORTED include/factors/gravity_factor.h include/factors/gravity_estimator.h include/factors/gravity_kalman_filter.h) set_target_properties(Boost::boost PROPERTIES INTERFACE_LINK_LIBRARIES "${Boost_LIBRARIES}" INTERFACE_INCLUDE_DIRECTORIES "${Boost_INCLUDE_DIRS}") endif () ###########################################################################
find_package(catkin REQUIRED COMPONENTS geometry_msgs visualization_msgs nav_msgs sensor_msgs roscpp rospy rosbag std_msgs pcl_ros tf tf_conversions message_generation eigen_conversions rosconsole # 确保包含这个库 )
generate_messages( DEPENDENCIES geometry_msgs )
catkin_package( INCLUDE_DIRS include CATKIN_DEPENDS tf geometry_msgs nav_msgs roscpp rospy std_msgs rosconsole message_runtime DEPENDS
DEPENDS EIGEN3 PCL
)
include_directories( ${catkin_INCLUDE_DIRS} ${EIGEN3_INCLUDE_DIR} ${PCL_INCLUDE_DIRS} ${GTSAM_INCLUDE_DIR} ${Y_INCLUDE_DIRS} ${PYTHON_INCLUDE_DIRS} ${GeographicLib_INCLUDE_DIRS} ${Open3D_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} # add boost include )
fastlio
add_executable(fastlio include/fast_lio/ikd-Tree/ikd_Tree.cpp src/fastlio/laserMapping.cpp src/fastlio/preprocess.cpp)
不需要add_dependencies,它是为了msg, srv而设计
target_link_libraries(fastlio ${catkin_LIBRARIES} ${PCL_LIBRARIES} ${PYTHON_LIBRARIES}) target_include_directories(fastlio PRIVATE ${PYTHON_INCLUDE_DIRS})
pgo_localization
add_executable(pgo_localization src/paloc/paloc.cpp src/paloc/cloud_process.cpp src/paloc/data_saver.cpp include/factors/gravity_factor.h include/factors/gravity_kalman_filter.h include/base_type.cpp )
target_link_libraries(pgo_localization ${catkin_LIBRARIES} ${PCL_LIBRARIES} ${PYTHON_LIBRARIES} ${Open3D_LIBRARIES} ${Boost_LIBRARIES} # add boost ${OpenCV_LIBS} #OpenCV为LIBS ${GeographicLib_LIBRARIES} ${CERES_LIBRARIES} ${OpenMP_CXX_FLAGS} gtsam )