From f51446899ed51f3d266c0cd882fb3ea35cc40f04 Mon Sep 17 00:00:00 2001 From: goodsleep Date: Thu, 16 Oct 2025 22:35:10 +0800 Subject: [PATCH 1/4] --- CMakeLists.txt | 6 +---- docker/Dockerfile | 57 --------------------------------------- include/gaussian_mapper.h | 12 --------- include/gaussian_model.h | 10 ------- src/gaussian_mapper.cpp | 3 --- 5 files changed, 1 insertion(+), 87 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0e18813..179bb9c 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,9 +14,7 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-declarations") set(CAFFE2_USE_CUDNN on) -set(Boost_LIBRARY_DIR /usr/lib/x86_64-linux-gnu/) -# set(PCL_DIR /home/lzy/dependency/pcl/build) -find_package(PCL REQUIRED) + # Uncomment the following line if you want to solve CMake Warning "Failed to compute shorthash for libnvrtc.so" # set(PYTHON_EXECUTABLE "/usr/bin/python3") # set(Torch_DIR /home/lzy/workingspace/Photo-SLAM/Torch/libtorch/share/cmake/Torch) @@ -66,7 +64,6 @@ include_directories( ${ORB_SLAM3_SOURCE_DIR}/Thirdparty/Sophus ${EIGEN3_INCLUDE_DIR} ${OPENGL_INCLUDE_DIR} - ${PCL_INCLUDE_DIRS} ${TorchScatter_INCLUDE_DIRS}) ################################################################################## @@ -180,7 +177,6 @@ target_link_libraries(gaussian_mapper Eigen3::Eigen simple_knn cuda_rasterizer - ${PCL_LIBRARIES} /usr/local/lib/libtorchscatter.so ${OpenMP_CXX_FLAGS}) diff --git a/docker/Dockerfile b/docker/Dockerfile index 6c366f8..301c73c 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -38,14 +38,6 @@ RUN apt-get install -y \ libswscale-dev \ libswresample-dev \ libssl-dev \ - # Install dependencies for PCL - libflann-dev \ - libusb-1.0-0-dev \ - liblz4-dev \ - libgtest-dev \ - libopenni-dev \ - libgdal-dev \ - libosmesa6-dev \ && rm -rf /var/lib/apt/lists/* # cmake @@ -53,57 +45,8 @@ RUN wget https://github.com/Kitware/CMake/releases/download/v3.22.1/cmake-3.22.1 chmod +x /cmake-3.22.1.sh && \ /cmake-3.22.1.sh --skip-license --prefix=/usr/local -# pcl1.14.1 -# 安装 VTK 9.3 -RUN mkdir /vtk && cd /vtk && \ - wget https://github.com/Kitware/VTK/archive/refs/tags/v9.3.0.zip -O vtk-9.3.0.zip && \ - unzip vtk-9.3.0.zip && \ - rm vtk-9.3.0.zip - -RUN cd /vtk/VTK-9.3.0 && \ - mkdir build && cd build && \ - cmake -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_INSTALL_PREFIX=/usr/local \ - -DVTK_RENDERING_BACKEND=OpenGL2 \ - -DVTK_USE_X=OFF \ - -DVTK_USE_COCOA=OFF \ - -DVTK_USE_OPENGL2=ON \ - -DBUILD_SHARED_LIBS=ON \ - -DVTK_USE_SYSTEM_GLFW=ON \ - -DBUILD_EXAMPLES=OFF \ - -DVTK_OPENGL_HAS_OSMESA=ON \ - -DVTK_USE_OSMESA=OFF \ - .. && \ - make -j$(nproc) && \ - make install - -# Download PCL 1.14.1 and compile it -RUN wget https://github.com/PointCloudLibrary/pcl/archive/refs/tags/pcl-1.14.1.tar.gz -O pcl-1.14.1.tar.gz && \ - tar -xvzf pcl-1.14.1.tar.gz && \ - rm pcl-1.14.1.tar.gz - -RUN apt-get update && apt-get install -y \ - libx11-dev \ - qt5-qmake \ - qtbase5-dev \ - freeglut3-dev \ - libpcap-dev \ - && rm -rf /var/lib/apt/lists/* -# Build PCL -RUN cd pcl-pcl-1.14.1 && \ - mkdir build && \ - cd build && \ - cmake -DCMAKE_BUILD_TYPE=Release \ - -DWITH_PCL_VISUALIZATION=OFF \ - -DBUILD_visualization=OFF \ - -DBUILD_tools=OFF \ - .. && \ - make -j$(nproc) && \ - make install && \ - ldconfig - # libtorch RUN cd / && \ wget https://download.pytorch.org/libtorch/cu118/libtorch-cxx11-abi-shared-with-deps-2.0.1%2Bcu118.zip -O libtorch-cu118.zip && \ diff --git a/include/gaussian_mapper.h b/include/gaussian_mapper.h index a680ee3..7227ea2 100755 --- a/include/gaussian_mapper.h +++ b/include/gaussian_mapper.h @@ -40,13 +40,6 @@ #include -#include -#include -#include -#include -#include -#include -#include #include "ORB-SLAM3/include/System.h" #include "ORB-SLAM3/Thirdparty/Sophus/sophus/se3.hpp" @@ -280,11 +273,6 @@ class GaussianMapper std::map viewer_main_undistort_mask_; std::map viewer_sub_undistort_mask_; - pcl::KdTreeFLANN::Ptr kdtreePointsfull; - pcl::PointCloud::Ptr pointCloud; - pcl::VoxelGrid downSizeFilter; - pcl::VoxelGrid downSizeFilter1; - pcl::VoxelGrid downSizeFilter2; float filterResolution=0.01; int num_cameras_; diff --git a/include/gaussian_model.h b/include/gaussian_model.h index 4ee9daf..9a7fc69 100755 --- a/include/gaussian_model.h +++ b/include/gaussian_model.h @@ -40,20 +40,10 @@ #include "mlp.h" #include "embedding.h" -#include -#include -#include -#include -#include -#include -#include - #include #include #include -using PointT = pcl::PointXYZRGB; -using PointCloudT = pcl::PointCloud; #define GAUSSIAN_MODEL_TENSORS_TO_VEC \ this->Tensor_vec_anchor = {this->_anchor}; \ diff --git a/src/gaussian_mapper.cpp b/src/gaussian_mapper.cpp index a4a24f7..75fe11b 100755 --- a/src/gaussian_mapper.cpp +++ b/src/gaussian_mapper.cpp @@ -216,9 +216,6 @@ GaussianMapper::GaussianMapper( this->scene_->addCamera(camera); } - kdtreePointsfull.reset(new pcl::KdTreeFLANN()); - pointCloud.reset(new pcl::PointCloud()); - } void GaussianMapper::readConfigFromFile(std::filesystem::path cfg_path) From 3adfb3e6c784714efcd4374476be5526bf9b88a1 Mon Sep 17 00:00:00 2001 From: goodsleep Date: Sat, 18 Oct 2025 20:54:49 +0800 Subject: [PATCH 2/4] Update build.sh --- build.sh | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/build.sh b/build.sh index 3a1322b..98ea2fa 100755 --- a/build.sh +++ b/build.sh @@ -8,7 +8,7 @@ cd ./ORB-SLAM3/Thirdparty/DBoW2 mkdir build cd build -cmake .. -DCMAKE_BUILD_TYPE=Release -DOpenCV_DIR=/usr/local/lib/cmake/opencv4# add OpenCV_DIR definitions if needed, example: +cmake .. -DCMAKE_BUILD_TYPE=Release # add OpenCV_DIR definitions if needed, example: #cmake .. -DCMAKE_BUILD_TYPE=Release -DOpenCV_DIR=/home/rapidlab/libs/opencv/lib/cmake/opencv4 make -j @@ -36,18 +36,15 @@ cd .. mkdir build cd build -cmake .. -DCMAKE_BUILD_TYPE=Release -DOpenCV_DIR=/usr/local/lib/cmake/opencv4 # add OpenCV_DIR definitions if needed, example: +cmake .. -DCMAKE_BUILD_TYPE=Release # add OpenCV_DIR definitions if needed, example: #cmake .. -DCMAKE_BUILD_TYPE=Release -DOpenCV_DIR=/home/rapidlab/libs/opencv/lib/cmake/opencv4 -# make -j128 make -j8 - # Photo-SLAM -echo "Building Photo-SLAM ..." +echo "Building SEGS-SLAM ..." cd ../.. mkdir build cd build -# cmake .. # add Torch_DIR and/or OpenCV_DIR definitions if needed, example: Debug -cmake .. -DOpenCV_DIR=/usr/local/lib/cmake/opencv4 -# make -j128 +cmake .. # add Torch_DIR and/or OpenCV_DIR definitions if needed, example: +#cmake .. -DTorch_DIR=/home/rapidlab/libs/libtorch/share/cmake/Torch -DOpenCV_DIR=/home/rapidlab/libs/opencv/lib/cmake/opencv4 make -j8 From b5517d745a04a0d950d32e22643b7a569d1e5ac7 Mon Sep 17 00:00:00 2001 From: goodsleep Date: Sat, 18 Oct 2025 21:27:10 +0800 Subject: [PATCH 3/4] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6b89cca..980e02e 100755 --- a/README.md +++ b/README.md @@ -87,7 +87,7 @@ docker images sudo docker run --gpus all -it --name segs-slam segs-slam-image /bin/bash ``` -Then you can go to [Installation of SEGS-SLAM](## 📦 Installation)directly. +Then you can go to [Installation of SEGS-SLAM](#3-installation-of-segs-slam)directly. ### 2.2 Prerequisites From 68ac02386407633413b38de381da54b2d47ff87f Mon Sep 17 00:00:00 2001 From: goodsleep Date: Sat, 18 Oct 2025 21:28:07 +0800 Subject: [PATCH 4/4] Update CMakeLists.txt --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 179bb9c..18ce05e 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,7 +18,7 @@ set(CAFFE2_USE_CUDNN on) # Uncomment the following line if you want to solve CMake Warning "Failed to compute shorthash for libnvrtc.so" # set(PYTHON_EXECUTABLE "/usr/bin/python3") # set(Torch_DIR /home/lzy/workingspace/Photo-SLAM/Torch/libtorch/share/cmake/Torch) -set(Torch_DIR /home/lzy/dependency/libtorch/share/cmake/Torch) +# set(Torch_DIR /home/lzy/dependency/libtorch/share/cmake/Torch) find_package(Torch REQUIRED) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TORCH_CXX_FLAGS} -pthread") @@ -318,4 +318,4 @@ target_link_libraries(scannet_rgbd # gaussian_mapper # ${ORB_SLAM3_SOURCE_DIR}/lib/libORB_SLAM3.so # ${realsense2_LIBRARY}) -# endif() \ No newline at end of file +# endif()