diff --git a/Examples/ROS/orb_slam3/CMakeLists.txt b/Examples/ROS/orb_slam3/CMakeLists.txt deleted file mode 100644 index 6a7dd3c..0000000 --- a/Examples/ROS/orb_slam3/CMakeLists.txt +++ /dev/null @@ -1,134 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -include($ENV{ROS_ROOT}/core/rosbuild/rosbuild.cmake) - -rosbuild_init() - -IF(NOT ROS_BUILD_TYPE) - SET(ROS_BUILD_TYPE Release) -ENDIF() - -MESSAGE("Build type: " ${ROS_BUILD_TYPE}) - -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -O3 -march=native ") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -O3 -march=native") -add_definitions(-w) -# Check C++11 or C++0x support -include(CheckCXXCompilerFlag) -CHECK_CXX_COMPILER_FLAG("-std=c++14" COMPILER_SUPPORTS_CXX14) -if(COMPILER_SUPPORTS_CXX14) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14") - add_definitions(-DCOMPILEDWITHC11) - message(STATUS "Using flag -std=c++14.") -else() - message(FATAL_ERROR "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.") -endif() - -LIST(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/../../../cmake_modules) - -find_package(catkin REQUIRED COMPONENTS - roscpp - cv_bridge - image_transport -) - -# 要保证整个工程的opencv版本一致,包括dbow,源码以及ros相关的 -# 3 4 都可以正常运行 -find_package(OpenCV 4.2) - if(NOT OpenCV_FOUND) - message(FATAL_ERROR "OpenCV > 4.2 not found.") - endif() - -find_package(Eigen3 3.1.0 REQUIRED) -find_package(Pangolin REQUIRED) - -catkin_package( - INCLUDE_DIRS include - LIBRARIES ${PROJECT_NAME} - CATKIN_DEPENDS roscpp cv_bridge image_transport - DEPENDS OpenCV EIGEN3 Pangolin -) - -include_directories( - include - ${catkin_INCLUDE_DIRS} - ${PROJECT_SOURCE_DIR} - ${PROJECT_SOURCE_DIR}/../../../ - ${PROJECT_SOURCE_DIR}/../../../include - ${PROJECT_SOURCE_DIR}/../../../include/CameraModels - ${PROJECT_SOURCE_DIR}/../../../Thirdparty/Sophus - ${Pangolin_INCLUDE_DIRS} -) - -set(LIBS -${OpenCV_LIBS} -${EIGEN3_LIBS} -${Pangolin_LIBRARIES} -${PROJECT_SOURCE_DIR}/../../../Thirdparty/DBoW2/lib/libDBoW2.so -${PROJECT_SOURCE_DIR}/../../../Thirdparty/g2o/lib/libg2o.so -${PROJECT_SOURCE_DIR}/../../../lib/libORB_SLAM3.so --lboost_system -) - -# Node for monocular camera -add_executable(Mono src/ros_mono.cc) -target_link_libraries(Mono - ${LIBS} - ${catkin_LIBRARIES} -) - -## Node for monocular camera -#rosbuild_add_executable(Mono -#src/ros_mono.cc -#) -# -#target_link_libraries(Mono -#${LIBS} -#) - -# Node for monocular camera (Augmented Reality Demo) -# 由于里面代码没有将cv::mat 改成 SOPUS的暂时注释掉,不然会报错 -# rosbuild_add_executable(MonoAR -# src/AR/ros_mono_ar.cc -# src/AR/ViewerAR.h -# src/AR/ViewerAR.cc -# ) - -# target_link_libraries(MonoAR -# ${LIBS} -# ) - -# Node for stereo camera -#rosbuild_add_executable(Stereo -#src/ros_stereo.cc -#) -# -#target_link_libraries(Stereo -#${LIBS} -#) -# -## Node for RGB-D camera -#rosbuild_add_executable(RGBD -#src/ros_rgbd.cc -#) -# -#target_link_libraries(RGBD -#${LIBS} -#) -# -## Node for monocular-inertial camera -#rosbuild_add_executable(Mono_Inertial -#src/ros_mono_inertial.cc -#) -# -#target_link_libraries(Mono_Inertial -#${LIBS} -#) -# -## Node for stereo-inertial camera -#rosbuild_add_executable(Stereo_Inertial -#src/ros_stereo_inertial.cc -#) -# -#target_link_libraries(Stereo_Inertial -#${LIBS} -#) diff --git a/ROS/orb_slam3/CMakeLists.txt b/ROS/orb_slam3/CMakeLists.txt new file mode 100644 index 0000000..30ba40f --- /dev/null +++ b/ROS/orb_slam3/CMakeLists.txt @@ -0,0 +1,105 @@ +cmake_minimum_required(VERSION 3.15) +project(orb_slam3) # 替换为你的项目名称 + +find_package(catkin REQUIRED COMPONENTS + roscpp + cv_bridge + image_transport +) + +find_package(OpenCV 4.2 REQUIRED) +find_package(Eigen3 3.1.0 REQUIRED) +find_package(Pangolin REQUIRED) + +catkin_package( + INCLUDE_DIRS include + LIBRARIES ${PROJECT_NAME} + CATKIN_DEPENDS roscpp cv_bridge image_transport + DEPENDS OpenCV EIGEN3 Pangolin +) + +include_directories( + include + ${catkin_INCLUDE_DIRS} + ${PROJECT_SOURCE_DIR} + ${PROJECT_SOURCE_DIR}/../../ + ${PROJECT_SOURCE_DIR}/../../include + ${PROJECT_SOURCE_DIR}/../../include/CameraModels + ${PROJECT_SOURCE_DIR}/../../Thirdparty/Sophus + ${PROJECT_SOURCE_DIR}/../../Thirdparty/DBoW2 + ${Pangolin_INCLUDE_DIRS} +) + +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -O3 -march=native -std=c++14") + +set(LIBS + ${OpenCV_LIBS} + ${EIGEN3_LIBS} + ${Pangolin_LIBRARIES} + ${PROJECT_SOURCE_DIR}/../../Thirdparty/DBoW2/lib/libDBoW2.so + ${PROJECT_SOURCE_DIR}/../../Thirdparty/g2o/lib/libg2o.so + ${PROJECT_SOURCE_DIR}/../../lib/libORB_SLAM3.so + -lboost_system + ${catkin_LIBRARIES} +) + +# Node for monocular camera +add_executable(Mono src/ros_mono.cc) +target_link_libraries(Mono ${LIBS}) + +## Node for monocular camera +#rosbuild_add_executable(Mono +#src/ros_mono.cc +#) +# +#target_link_libraries(Mono +#${LIBS} +#) + +# Node for monocular camera (Augmented Reality Demo) +# 由于里面代码没有将cv::mat 改成 SOPUS的暂时注释掉,不然会报错 +# rosbuild_add_executable(MonoAR +# src/AR/ros_mono_ar.cc +# src/AR/ViewerAR.h +# src/AR/ViewerAR.cc +# ) + +# target_link_libraries(MonoAR +# ${LIBS} +# ) + +# Node for stereo camera +#rosbuild_add_executable(Stereo +#src/ros_stereo.cc +#) +# +#target_link_libraries(Stereo +#${LIBS} +#) +# +## Node for RGB-D camera +#rosbuild_add_executable(RGBD +#src/ros_rgbd.cc +#) +# +#target_link_libraries(RGBD +#${LIBS} +#) +# +## Node for monocular-inertial camera +#rosbuild_add_executable(Mono_Inertial +#src/ros_mono_inertial.cc +#) +# +#target_link_libraries(Mono_Inertial +#${LIBS} +#) +# +## Node for stereo-inertial camera +#rosbuild_add_executable(Stereo_Inertial +#src/ros_stereo_inertial.cc +#) +# +#target_link_libraries(Stereo_Inertial +#${LIBS} +#) diff --git a/Examples/ROS/orb_slam3/Vocabulary/ORBvoc.txt b/ROS/orb_slam3/Vocabulary/ORBvoc.txt similarity index 100% rename from Examples/ROS/orb_slam3/Vocabulary/ORBvoc.txt rename to ROS/orb_slam3/Vocabulary/ORBvoc.txt diff --git a/Examples/ROS/orb_slam3/config/Asus.yaml b/ROS/orb_slam3/config/Asus.yaml similarity index 100% rename from Examples/ROS/orb_slam3/config/Asus.yaml rename to ROS/orb_slam3/config/Asus.yaml diff --git a/Examples/ROS/orb_slam3/config/camera1280.yaml b/ROS/orb_slam3/config/camera1280.yaml similarity index 100% rename from Examples/ROS/orb_slam3/config/camera1280.yaml rename to ROS/orb_slam3/config/camera1280.yaml diff --git a/Examples/ROS/orb_slam3/config/camera1920.yaml b/ROS/orb_slam3/config/camera1920.yaml similarity index 100% rename from Examples/ROS/orb_slam3/config/camera1920.yaml rename to ROS/orb_slam3/config/camera1920.yaml diff --git a/Examples/ROS/orb_slam3/include/ros_mono.h b/ROS/orb_slam3/include/ros_mono.h similarity index 89% rename from Examples/ROS/orb_slam3/include/ros_mono.h rename to ROS/orb_slam3/include/ros_mono.h index bf55727..7bd8e8d 100644 --- a/Examples/ROS/orb_slam3/include/ros_mono.h +++ b/ROS/orb_slam3/include/ros_mono.h @@ -3,7 +3,7 @@ #include #include -#include "../../../../include/System.h" // 确保路径正确 +#include "../../include/System.h" // 确保路径正确 namespace autolabor { diff --git a/Examples/ROS/orb_slam3/launch/orb_slam3_1280.launch b/ROS/orb_slam3/launch/orb_slam3_1280.launch similarity index 99% rename from Examples/ROS/orb_slam3/launch/orb_slam3_1280.launch rename to ROS/orb_slam3/launch/orb_slam3_1280.launch index d8cca34..c0e124e 100644 --- a/Examples/ROS/orb_slam3/launch/orb_slam3_1280.launch +++ b/ROS/orb_slam3/launch/orb_slam3_1280.launch @@ -11,7 +11,6 @@ - diff --git a/Examples/ROS/orb_slam3/manifest.xml b/ROS/orb_slam3/manifest.xml similarity index 100% rename from Examples/ROS/orb_slam3/manifest.xml rename to ROS/orb_slam3/manifest.xml diff --git a/Examples/ROS/orb_slam3/package.xml b/ROS/orb_slam3/package.xml similarity index 100% rename from Examples/ROS/orb_slam3/package.xml rename to ROS/orb_slam3/package.xml diff --git a/Examples/ROS/orb_slam3/src/AR/ViewerAR.cc b/ROS/orb_slam3/src/AR/ViewerAR.cc similarity index 100% rename from Examples/ROS/orb_slam3/src/AR/ViewerAR.cc rename to ROS/orb_slam3/src/AR/ViewerAR.cc diff --git a/Examples/ROS/orb_slam3/src/AR/ViewerAR.h b/ROS/orb_slam3/src/AR/ViewerAR.h similarity index 100% rename from Examples/ROS/orb_slam3/src/AR/ViewerAR.h rename to ROS/orb_slam3/src/AR/ViewerAR.h diff --git a/Examples/ROS/orb_slam3/src/AR/ros_mono_ar.cc b/ROS/orb_slam3/src/AR/ros_mono_ar.cc similarity index 100% rename from Examples/ROS/orb_slam3/src/AR/ros_mono_ar.cc rename to ROS/orb_slam3/src/AR/ros_mono_ar.cc diff --git a/Examples/ROS/orb_slam3/src/ros_mono.cc b/ROS/orb_slam3/src/ros_mono.cc similarity index 99% rename from Examples/ROS/orb_slam3/src/ros_mono.cc rename to ROS/orb_slam3/src/ros_mono.cc index 7b8177e..ec1bfb4 100644 --- a/Examples/ROS/orb_slam3/src/ros_mono.cc +++ b/ROS/orb_slam3/src/ros_mono.cc @@ -15,8 +15,6 @@ * You should have received a copy of the GNU General Public License along with ORB-SLAM3. * If not, see . */ - - #include "ros_mono.h" #include #include diff --git a/Examples/ROS/orb_slam3/src/ros_mono_inertial.cc b/ROS/orb_slam3/src/ros_mono_inertial.cc similarity index 100% rename from Examples/ROS/orb_slam3/src/ros_mono_inertial.cc rename to ROS/orb_slam3/src/ros_mono_inertial.cc diff --git a/Examples/ROS/orb_slam3/src/ros_rgbd.cc b/ROS/orb_slam3/src/ros_rgbd.cc similarity index 100% rename from Examples/ROS/orb_slam3/src/ros_rgbd.cc rename to ROS/orb_slam3/src/ros_rgbd.cc diff --git a/Examples/ROS/orb_slam3/src/ros_stereo.cc b/ROS/orb_slam3/src/ros_stereo.cc similarity index 100% rename from Examples/ROS/orb_slam3/src/ros_stereo.cc rename to ROS/orb_slam3/src/ros_stereo.cc diff --git a/Examples/ROS/orb_slam3/src/ros_stereo_inertial.cc b/ROS/orb_slam3/src/ros_stereo_inertial.cc similarity index 100% rename from Examples/ROS/orb_slam3/src/ros_stereo_inertial.cc rename to ROS/orb_slam3/src/ros_stereo_inertial.cc