zhoupengwei / tloam

T-LOAM: Truncated Least Squares Lidar-only Odometry and Mapping in Real-Time
GNU General Public License v3.0
237 stars 38 forks source link

Open3d with cuda9.0 #4

Open PigletPh opened 2 years ago

PigletPh commented 2 years ago

hi,the work is excellent.But when I set up the open3d 0.12.0 environment, I used cuda9.0 and kept reporting errors. The content is as follows. Does the 0.12.0 version support cuda9.0? CMake Error at /home/zhangcz/third_parts/cmake-3.18.0-Linux-x86_64/share/cmake-3.18/Modules/CMakeDetermineCUDACompiler.cmake:552 (message): The CMAKE_CUDA_ARCHITECTURES: 75-real do not all work with this compiler. Try: 30 instead.

zhoupengwei commented 2 years ago

@jiu876 Hi, Thank you for your attention. I'm not sure wheather the open3d 12.0 supports cuda 9.0. The cuda10.x and cuda 11.x can work well with it. This project does not depend on the cuda module in it. so if you want, you can try to disable the cuda moduel compilation eg. cmake -DBUILD_CUDA_MODULE=OFF. Sorry about that.

PigletPh commented 2 years ago

@jiu876 Hi, Thank you for your attention. I'm not sure wheather the open3d 12.0 supports cuda 9.0. The cuda10.x and cuda 11.x can work well with it. This project does not depend on the cuda module in it. so if you want, you can try to disable the cuda moduel compilation eg. cmake -DBUILD_CUDA_MODULE=OFF. Sorry about that.

Thanks for your answer,I follow your solution,but a new problem appear: CMake Error at CMakeLists.txt:171 (message): 3DML depends on TensorFlow or PyTorch Ops. Enable them with -DBUILD_TENSORFLOW_OPS=ON or -DBUILD_PYTORCH_OPS=ON

zhoupengwei commented 2 years ago

@jiu876 This module will cause linking errors due to C++11 API support. You can try to compile it as follows:

git clone --recursive https://github.com/intel-isl/Open3D
cd Open3D && source util/scripts/install-deps-ubuntu.sh
mkdir build && cd build
cmake -DBUILD_EIGEN3=ON -DBUILD_GLEW=ON -DBUILD_GLFW=ON -DBUILD_JSONCPP=ON -DBUILD_PNG=ON -DGLIBCXX_USE_CXX11_ABI=ON -DPYTHON_EXECUTABLE=/usr/bin/python3 -DBUILD_UNIT_TESTS=ON ..
make -j4
sudo make install

Good luck!

PigletPh commented 2 years ago

@zpw6106 Thanks for your answer,I have successfully built the Open3D library ,but when I catkin build,there is a problem about yawl-cpp. When I did not install the yawl library, but installed ROS-Melodic and Open3D, I can successfully compile using catkin build;However, if I install yawl 0.6.3 and use the command cmake [-G generator] [-DYAML_BUILD_SHARED_LIBS=ON] .., the following error will be reported:

/usr/bin/ld: /usr/local/lib/libyaml-cpp.a(scanscalar.cpp.o): relocation R_X86_64_PC32 against symbol _ZNK4YAML5RegEx14MatchUncheckedINS_16StreamCharSourceEEEiRKT_' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: 最后的链结失败: 错误的值 collect2: error: ld returned 1 exit status make[2]: *** [/home/zhangcz/local_code/tloam_ws/devel/lib/libkitti_reader_nodelet.so] Error 1 make[1]: *** [CMakeFiles/kitti_reader_nodelet.dir/all] Error 2 make[1]: *** 正在等待未完成的任务.... /usr/bin/ld: /usr/local/lib/libyaml-cpp.a(scanscalar.cpp.o): relocation R_X86_64_PC32 against symbol_ZNK4YAML5RegEx14MatchUncheckedINS16StreamCharSourceEEEiRKT' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: 最后的链结失败: 错误的值 collect2: error: ld returned 1 exit status make[2]: [/home/zhangcz/local_code/tloam_ws/devel/lib/libsegmentation_nodelet.so] Error 1 make[1]: [CMakeFiles/segmentation_nodelet.dir/all] Error 2 /usr/bin/ld: /usr/local/lib/libyaml-cpp.a(convert.cpp.o): relocation R_X86_64_PC32 against symbol `_ZN4YAML11InvalidNodeC1ENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: 最后的链结失败: 错误的值 collect2: error: ld returned 1 exit status

zhoupengwei commented 2 years ago

@jiu876 It looks like your yaml-cpp isn't compiling correctly. From your output, it looks like your yaml-cpp has been compiled into a static library, which will cause linking errors. You can try to recompile as follows:

sudo rm -rf /usr/local/include/yaml-cpp /usr/local/lib/libyaml-cpp* /usr/local/lib/cmake/yaml-cpp
cd yaml-cpp-yaml-cpp-0.6.3/
mkdir build && cd build 
cmake -DYAML_BUILD_SHARED_LIBS=ON ../
make -j4 && sudo make install

You can check the output of the terminal to notice the correct dynamic link library. This is shown below:

Install the project...
-- Install configuration: "Release"
-- Installing: /usr/local/lib/libyaml-cpp.so.0.6.3
-- Installing: /usr/local/lib/libyaml-cpp.so.0.6
-- Installing: /usr/local/lib/libyaml-cpp.so
PigletPh commented 2 years ago

@zpw6106 Thanks for your answer,when I run the command roslaunch tloam tloam_kitti.launch,there is a error about the kitti path 111 : My kitti path is 屏幕截图 2021-11-14 14:38:29 : And I changed the data_path in kitti_reader.yawl:data_path: /home/zhangcz/odometry,how to solve it,thanks!

PigletPh commented 2 years ago

@zpw6106 I solved the problem,the kitti path changed:~/odometry/dataset/sequences/00/,but when I run the code,at frame 3246, the code will stop running, what's the matter 屏幕截图 2021-11-16 16:12:39 ?

PigletPh commented 2 years ago

@zpw6106 I changed the code in regisration.cpp:scan_edge_size >= 5 && scan_sphere_size >= 5 && scan_planar_size >= 5 && scan_ground_size >= 5,and the KITTI00 dataset can run entirely.Here are other questions to ask you: 1.How to run the code in VLP16 not dataset because I have a Velodyne16 lidar? 2.How to keep track and map? Looking forward to your answer.

zhoupengwei commented 2 years ago

@jiu876 First of all, thank you for attention my work, If you want to use the tloam on VLP-16. You need to pay attention to the following step:

Hope this can help you !

PigletPh commented 2 years ago

@zpw6106 Thanks for your answers, it is very helpful to me, and I will try to solve these problems. For the newly added real-time node, is there any code for reference, I am not familiar with nodelet yet, thank you very much!