问题描述
按照open3d官方安装教程在Ubuntu18.04上安装过程中的make步骤遇到问题,
问题描述如下:
显示文件“https://github.com/isl-org/open3d_downloads/releases/download/boringssl-bin/curl_7.79.1_linux_x86_64.tar.gz”下载失败。这是由于国内的用户无法访问github网站导致的。这时需要我们手动下载此文件到
open3D解压后文件夹路径/3rdparty_downloads/curl/
当然可能遇到的无法下载的包不止这一个,按照这个方法依次将无法下载的包手动下载到3rdparty_downloads/目录对应的文件夹里就可以了。(看起来名字差不多的文件夹就是对应的文件夹)接下来就可以流畅地编译并且安装open3d了:
测试用例
Cmakelist文件:
cmake_minimum_required(VERSION 3.20)
project(open3d_library_test)
set(CMAKE_CXX_STANDARD 14)
find_package(Open3D REQUIRED)
include_directories(${Open3D_INCLUDE_DIRS})
message(${Open3D_INCLUDE_DIRS})
add_executable(open3d_library_test main.cpp)
target_link_libraries(open3d_library_test ${Open3D_LIBRARIES})
测试代码:
#include <iostream>
#include <open3d/Open3D.h>
int main(int argc, char * argv[]) {
std::cout << "Hello, Open3D!! " << std::endl;
open3d::utility::SetVerbosityLevel(open3d::utility::VerbosityLevel::Debug);
auto pcd = open3d::io::CreatePointCloudFromFile(argv[1]);
// 1. test downsample
auto downsampled = pcd->VoxelDownSample(0.05);
{
open3d::utility::ScopeTimer timer("FPFH estimation with Radius 0.25");
open3d::pipelines::registration::ComputeFPFHFeature(*downsampled, open3d::geometry::KDTreeSearchParamRadius(0.25));
}
// 2. 估计点云的法向量
{
open3d::utility::ScopeTimer timer("Normal estimation with KNN20");
for (int i = 0; i < 20; i++){
downsampled->EstimateNormals(open3d::geometry::KDTreeSearchParamKNN(20));
}
}
std::cout << downsampled->normals_[0] << std::endl;
std::cout << downsampled->normals_[10] << std::endl;
{
open3d::utility::ScopeTimer timer("Normal estimation with Radius 0.01666");
for(int i=0; i<20; i++){
downsampled->EstimateNormals(open3d::geometry::KDTreeSearchParamRadius(0.01666));
}
}
std::cout << downsampled->normals_[0] << std::endl;
std::cout << downsampled->normals_[10] << std::endl;
open3d::visualization::DrawGeometries({downsampled}, "TestPCD", 960, 540);
return 0;
}
编译后运行
./open3d_library_test 安装包路径/examples/test_data/ICP/cloud_bin_0.pcd
测试结果: