Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
10 changes: 3 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,11 @@ 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)
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")
Expand Down Expand Up @@ -66,7 +64,6 @@ include_directories(
${ORB_SLAM3_SOURCE_DIR}/Thirdparty/Sophus
${EIGEN3_INCLUDE_DIR}
${OPENGL_INCLUDE_DIR}
${PCL_INCLUDE_DIRS}
${TorchScatter_INCLUDE_DIRS})

##################################################################################
Expand Down Expand Up @@ -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})

Expand Down Expand Up @@ -322,4 +318,4 @@ target_link_libraries(scannet_rgbd
# gaussian_mapper
# ${ORB_SLAM3_SOURCE_DIR}/lib/libORB_SLAM3.so
# ${realsense2_LIBRARY})
# endif()
# endif()
13 changes: 5 additions & 8 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
57 changes: 0 additions & 57 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,72 +38,15 @@ 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
RUN wget https://github.com/Kitware/CMake/releases/download/v3.22.1/cmake-3.22.1-Linux-x86_64.sh -O /cmake-3.22.1.sh && \
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 && \
Expand Down
12 changes: 0 additions & 12 deletions include/gaussian_mapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,6 @@

#include <jsoncpp/json/json.h>

#include <pcl/point_cloud.h>
#include <pcl/point_types.h>
#include <pcl/filters/voxel_grid.h>
#include <pcl/kdtree/kdtree_flann.h>
#include <pcl/common/transforms.h>
#include <condition_variable>
#include <pcl/visualization/cloud_viewer.h>

#include "ORB-SLAM3/include/System.h"
#include "ORB-SLAM3/Thirdparty/Sophus/sophus/se3.hpp"
Expand Down Expand Up @@ -280,11 +273,6 @@ class GaussianMapper
std::map<camera_id_t, torch::Tensor> viewer_main_undistort_mask_;
std::map<camera_id_t, torch::Tensor> viewer_sub_undistort_mask_;

pcl::KdTreeFLANN<pcl::PointXYZRGB>::Ptr kdtreePointsfull;
pcl::PointCloud<pcl::PointXYZRGB>::Ptr pointCloud;
pcl::VoxelGrid<pcl::PointXYZRGBL> downSizeFilter;
pcl::VoxelGrid<pcl::PointXYZRGB> downSizeFilter1;
pcl::VoxelGrid<pcl::PointXYZRGB> downSizeFilter2;
float filterResolution=0.01;

int num_cameras_;
Expand Down
10 changes: 0 additions & 10 deletions include/gaussian_model.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,20 +40,10 @@
#include "mlp.h"
#include "embedding.h"

#include <pcl/point_types.h>
#include <pcl/point_cloud.h>
#include <pcl/filters/voxel_grid.h>
#include <pcl/octree/octree_pointcloud.h>
#include <pcl/io/pcd_io.h>
#include <pcl/common/common.h>
#include <pcl/filters/passthrough.h>

#include <torchscatter/scatter.h>
#include <torchscatter/cuda/scatter_cuda.h>
#include <torch/script.h>

using PointT = pcl::PointXYZRGB;
using PointCloudT = pcl::PointCloud<PointT>;

#define GAUSSIAN_MODEL_TENSORS_TO_VEC \
this->Tensor_vec_anchor = {this->_anchor}; \
Expand Down
3 changes: 0 additions & 3 deletions src/gaussian_mapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -216,9 +216,6 @@ GaussianMapper::GaussianMapper(
this->scene_->addCamera(camera);
}

kdtreePointsfull.reset(new pcl::KdTreeFLANN<pcl::PointXYZRGB>());
pointCloud.reset(new pcl::PointCloud<pcl::PointXYZRGB>());

}

void GaussianMapper::readConfigFromFile(std::filesystem::path cfg_path)
Expand Down