NICE-SLAM代码复现

代码地址:

https://github.com/cvg/nice-slamGitHub - cvg/nice-slam: [CVPR'22] NICE-SLAM: Neural Implicit Scalable Encoding for SLAM

参考链接:

 NICE-SLAM代码复现和解析(解决使用yaml文件配置conda环境时下载慢的问题)icon-default.png?t=N7T8https://blog.csdn.net/qin_liang/article/details/132004046?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522170037671916800182146349%2522%252C%2522scm%2522%253A%252220140713.130102334..%2522%257D&request_id=170037671916800182146349&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2~all~sobaiduend~default-1-132004046-null-null.142%5Ev96%5Epc_search_result_base9&utm_term=nice%20slam%E5%A4%8D%E7%8E%B0&spm=1018.2226.3001.4187

 anaconda环境下升级gcc g++编译neural_renderer_pytorchicon-default.png?t=N7T8https://blog.csdn.net/weixin_43117620/article/details/127986178?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522170047787016800227410267%2522%252C%2522scm%2522%253A%252220140713.130102334.pc%255Fall.%2522%257D&request_id=170047787016800227410267&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2~all~first_rank_ecpm_v1~rank_v31_ecpm-1-127986178-null-null.142%5Ev96%5Epc_search_result_base9&utm_term=anaconda%E7%8E%AF%E5%A2%83%E4%B8%8B%E5%8D%87%E7%BA%A7C%2B%2B&spm=1018.2226.3001.4187

 [已解决] libGL error: MESA-LOADER: failed to open swrasticon-default.png?t=N7T8https://blog.csdn.net/peng_258/article/details/132500323?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522170053629216800227412944%2522%252C%2522scm%2522%253A%252220140713.130102334..%2522%257D&request_id=170053629216800227412944&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2~all~sobaiduend~default-1-132500323-null-null.142%5Ev96%5Epc_search_result_base9&utm_term=libGL%20error%3A%20MESA-LOADER%3A%20failed%20to%20open%20swrast%3A%20%2Fusr%2Flib%2Fdri%2Fswrast_dri.so%3A%20cannot%20open%20shared%20object%20file%3A%20No%20such%20file%20or%20directory%20%28search%20paths%20%2Fusr%2Flib%2Fx86_64-linux-gnu%2Fdri%3A%5C%24%24%7BORIGIN%7D%2Fdri%3A%2Fusr%2F&spm=1018.2226.3001.4187

1.环境配置:

之前用windows系统总是出问题,后来转战linux,本文使用Ubuntu22.04,anaconda自己安装哈。

1.下载压缩包,打开environment.yaml文件,在channels里面添加两行代码:

  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/  
  - https://mirrors.ustc.edu.cn/anaconda/pkgs/free/   

2.按照github教程

sudo apt-get install libopenexr-dev
conda env create -f environment.yaml

 激活创建的虚拟环境

conda activate nice-slam

2.anaconda环境下升级gcc g++

升级gcc和g++到7.3.0版本

conda install -c moussi gcc_impl_linux-64
conda install -c moussi gxx_impl_linux-64

修改gcc和g++软链接

ln -s ~/anaconda3/envs/(envs_name)/bin/x86_64-conda_cos6-linux-gnu-gcc  ~/anaconda3/envs/(envs_name)/bin/gcc
ln -s ~/anaconda3/envs/(envs_name)/bin/x86_64-conda_cos6-linux-gnu-g++  ~/anaconda3/envs/(envs_name)/bin/g++

下载数据集,测试Apartment的可视化效果

python visualizer.py configs/Apartment/apartment.yaml --output output/vis/Apartment

 然后会报错,锁定到gcc和g++版本低,进行解决。

查看gcc和g++版本

gcc -v
Reading specs from ~/anaconda3/envs/(envs_name)/bin/../lib/gcc/x86_64-conda_cos6-linux-gnu/7.3.0/specs
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=~/anaconda3/envs/(envs_name)/bin/../libexec/gcc/x86_64-conda_cos6-linux-gnu/7.3.0/lto-wrapper
Target: x86_64-conda_cos6-linux-gnu
Configured with: /home/conda/feedstock_root/build_artifacts/ctng-compilers_1580517382604/work/.build/x86_64-conda_cos6-linux-gnu/src/gcc/configure --build=x86_64-build_pc-linux-gnu --host=x86_64-build_pc-linux-gnu --target=x86_64-conda_cos6-linux-gnu --prefix=/home/conda/feedstock_root/build_artifacts/ctng-compilers_1580517382604/work/gcc_built --with-sysroot=/home/conda/feedstock_root/build_artifacts/ctng-compilers_1580517382604/work/gcc_built/x86_64-conda_cos6-linux-gnu/sysroot --enable-languages=c,c++,fortran,objc,obj-c++ --with-pkgversion='crosstool-NG 1.23.0.450-d54ae' --enable-__cxa_atexit --disable-libmudflap --enable-libgomp --disable-libssp --enable-libquadmath --enable-libquadmath-support --enable-libsanitizer --enable-libmpx --with-gmp=/home/conda/feedstock_root/build_artifacts/ctng-compilers_1580517382604/work/.build/x86_64-conda_cos6-linux-gnu/buildtools --with-mpfr=/home/conda/feedstock_root/build_artifacts/ctng-compilers_1580517382604/work/.build/x86_64-conda_cos6-linux-gnu/buildtools --with-mpc=/home/conda/feedstock_root/build_artifacts/ctng-compilers_1580517382604/work/.build/x86_64-conda_cos6-linux-gnu/buildtools --with-isl=/home/conda/feedstock_root/build_artifacts/ctng-compilers_1580517382604/work/.build/x86_64-conda_cos6-linux-gnu/buildtools --enable-lto --with-host-libstdcxx='-static-libgcc -Wl,-Bstatic,-lstdc++,-Bdynamic -lm' --enable-threads=posix --enable-target-optspace --enable-plugin --enable-gold --disable-nls --disable-multilib --with-local-prefix=/home/conda/feedstock_root/build_artifacts/ctng-compilers_1580517382604/work/gcc_built/x86_64-conda_cos6-linux-gnu/sysroot --enable-long-long --enable-default-pie
Thread model: posix
gcc version 7.3.0 (crosstool-NG 1.23.0.450-d54ae)

COLLECT_LTO_WRAPPER里面的路径是虚拟环境里的,g++同理。

运行时发现还是有问题

libGL error: MESA-LOADER: failed to open swrast: /usr/lib/dri/swrast_dri.so: cannot open shared object file: No such file or directory (search paths /u  sr/lib/x86_64-linux-gnu/dri:\$${ORIGIN}/dri:/usr/lib/dri, suffix _dri)
libGL error: failed to load driver: swrast
GLFW Error: GLX: Failed to create context: GLXBadFBConfig
Failed to create window
[DrawGeometries] Failed creating OpenGL window.

解决方法

cd  /usr/lib/
sudo mkdir dri
sudo ls -s  /lib/x86_64-linux-gnu/dri/swrast_dri.so    swrast_dri.so

 出现新问题

libGL error: MESA-LOADER: failed to open swrast: /home/wyc/anaconda3/envs/randlanet/bin/../lib/libstdc++.so.6: version `GLIBCXX_3.4.30' not found (req   uired by /lib/x86_64-linux-gnu/libLLVM-13.so.1) (search paths /usr/lib/x86_64-linux-gnu/dri:\$${ORIGIN}/dri:/usr/lib/dri, suffix _dri)
libGL error: failed to load driver: swrast
GLFW Error: GLX: Failed to create context: GLXBadFBConfig
Failed to create window
[DrawGeometries] Failed creating OpenGL window.

 进入虚拟环境

 conda install -c conda-forge gcc

最终解决了! 

3.可视化运行

python visualizer.py configs/Apartment/apartment.yaml --output output/vis/Apartment

 

4.Demo运行 

可以看出Demo的输入文件有RGB图像,深度图,相机内参,位姿。

python -W ignore run.py configs/Demo/demo.yaml

生成的文件如下: 

进行可视化 

python visualizer.py configs/Demo/demo.yaml 

 

  • 3
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 3
    评论
要配置ORB-SLAM3的环境,您需要按照以下步骤操作: 1. 安装依赖库:ORB-SLAM3需要使用一些第三方库,例如OpenCV、Eigen、Pangolin等。确保您已经安装了这些库。您可以通过以下命令在Ubuntu上安装它们: ``` sudo apt-get install libeigen3-dev libopencv-dev libpangolin-dev ``` 2. 克隆ORB-SLAM3的代码库:使用Git工具克隆ORB-SLAM3的代码库到您的本地机器上: ``` git clone https://github.com/UZ-SLAMLab/ORB_SLAM3.git ``` 3. 编译ORB-SLAM3:进入克隆的代码库目录,并创建一个build目录。然后,使用CMake来配置和构建ORB-SLAM3: ``` cd ORB_SLAM3 mkdir build cd build cmake .. make -j4 ``` 4. 下载Vocabulary文件:在ORB-SLAM3的代码库中,有一个vocabulary文件夹。您需要下载一个适合您的应用的vocabulary文件。例如,如果您想使用ORB-SLAM3的Monocular模式,可以从官方网站(https://github.com/UZ-SLAMLab/ORB_SLAM3#downloads)下载Monocular-vocabulary文件,并将其放置在vocabulary文件夹中。 5. 配置数据集:ORB-SLAM3需要一个输入图像序列作为输入数据集。您可以使用自己的数据集,或者从ORB-SLAM3的官方网站上下载一些示例数据集。 6. 运行ORB-SLAM3:使用以下命令来运行ORB-SLAM3,并指定您的数据集和相机参数: ``` ./Examples/Monocular/mono_tum Vocabulary/ORBvoc.txt Examples/Monocular/TUMX.yaml 数据集的路径 ``` 这些步骤可以帮助您配置和运行ORB-SLAM3。请确保按照文档提供的说明进行操作。如果遇到任何问题,您可以参考ORB-SLAM3的官方文档或在相关论坛上寻求帮助。
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值