源文件地址:
https://github.com/raulmur/ORB_SLAM2
安裝的依賴
-
C++11 or C++0x Compiler
-
Pangolin
-
OpenCV
-
Eigen3
DBoW2 and g2o (源文件自帶Included in Thirdparty folder)
出錯1:
這個是查看issue的解決方法
adding #include <unistd.h> , you can put it in System.h instead. All other files include System.h in a nested manner.
https://github.com/raulmur/ORB_SLAM2/issues/317
出錯2:virtual memory exhausted: Cannot allocate memory
[root@Byrd byrd]# free -m
total used free shared buffers cached
Mem: 512 108 403 0 0 28
-/+ buffers/cache: 79 432
Swap: 0 0 0
[root@Byrd ~]# mkdir /opt/images/
[root@Byrd ~]# rm -rf /opt/images/swap
[root@Byrd ~]# dd if=/dev/zero of=/opt/images/swap bs=1024 count=2048000
2048000+0 records in
2048000+0 records out
2097152000 bytes (2.1 GB) copied, 82.7509 s, 25.3 MB/s
[root@Byrd ~]# mkswap /opt/images/swap
mkswap: /opt/images/swap: warning: don't erase bootbits sectors
on whole disk. Use -f to force.
Setting up swapspace version 1, size = 2047996 KiB
no label, UUID=59daeabb-d0c5-46b6-bf52-465e6b05eb0b
[root@hz mnt]# swapon /opt/images/swap
[root@hz mnt]# free -m
total used free shared buffers cached
Mem: 488 481 7 0 6 417
-/+ buffers/cache: 57 431
Swap: 999 0 999
使用完畢後可以關掉swap:
重啓該設置失效
[root@hz mnt]# swapoff swap
[root@hz mnt]# rm -f /opt/images/swap
swap文件也可以不刪除,留着以後使用,關鍵是你的虛擬機硬盤夠用。
參考:https://blog.csdn.net/taiyang1987912/article/details/41695895
共享文件夾設置
虛擬機菜單欄 -> 虛擬機 -> 設置 -> 選項 -> 共享文件夾 -> 總是啓用 -> 添加(我將添加的共享目錄命名爲share_file) ->確定
上面的步驟走完之後會出現 在/mnt/hgfs目錄