问题一
<span style="background-color:rgb(255,255,255);">Building ROS nodes
mkdir: cannot create directory ‘build’: File exists
[rosbuild] Building package ORB_SLAM2
[rosbuild] Error from directory check: /opt/ros/kinetic/share/ros/core/rosbuild/bin/check_same_directories.py /home/nvidia/ORBSLAM2/ORB_SLAM2/Examples/ROS/ORB_SLAM2
1
Traceback (most recent call last):
File "/opt/ros/kinetic/share/ros/core/rosbuild/bin/check_same_directories.py", line 46, in <module>
raise Exception
Exception
CMake Error at /opt/ros/kinetic/share/ros/core/rosbuild/private.cmake:102 (message):
[rosbuild] rospack found package "ORB_SLAM2" at "", but the current
directory is "/home/nvidia/ORBSLAM2/ORB_SLAM2/Examples/ROS/ORB_SLAM2". You
should double-check your ROS_PACKAGE_PATH to ensure that packages are found
in the correct precedence order.
Call Stack (most recent call first):
/opt/ros/kinetic/share/ros/core/rosbuild/public.cmake:177 (_rosbuild_check_package_location)
<a href="https://wx2.qq.com/cgi-bin/mmwebwx-bin/webwxcheckurl?requrl=http%3A%2F%2FCMakeLists.txt%3A4&skey=%40crypt_d4526f3_cee58ae55fc4f024ed7c53ec14a9f070&deviceid=e229686437474105&pass_ticket=undefined&opcode=2&scene=1&username=@a9980bb39a454579f6fc182cc7150259c54221ac201912fb57b3a10c3a0f480e"> CMakeLists.txt:4</a> (rosbuild_init)
-- Configuring incomplete, errors occurred!
See also "/home/nvidia/ORBSLAM2/ORB_SLAM2/Examples/ROS/ORB_SLAM2/build/CMakeFiles/CMakeOutput.log".
make: *** No targets specified and no makefile found. Stop.</span>
查看.bashrc 文件是否添加路径
export ROS_PACKAGE_PATH=${ROS_PACKAGE_PATH}:“PATH”/ORB_SLAM3/Examples/ROS
进行软连接
sudo ln -s “路径”/ORB_SLAM2/Examples/ROS/ORB_SLAM2 /opt/ros/kinetic/share/ORB_SLAM2
问题二
与上面问题类似,查看报错需要rosdep update,rosdep update更新失败。使用鱼香大佬的rosdepc。
sudo apt-get install rosdepc
#或者
sudo pip install rosdepc
sudo rosdepc init
rosdepc update
问题三
出现 undefined reference to symbol '_ZN5boost6system15system_categoryEv'
加入以下两句,原连接
find_package(Boost COMPONENTS filesystem system REQUIRED)#加在其他find_package下面
set(LIBS
${OpenCV_LIBS}
${EIGEN3_LIBS}
${Pangolin_LIBRARIES}
${Boost_LIBRARIES} #加的是这句
${PROJECT_SOURCE_DIR}/../../../Thirdparty/DBoW2/lib/libDBoW2.so
${PROJECT_SOURCE_DIR}/../../../Thirdparty/g2o/lib/libg2o.so
${PROJECT_SOURCE_DIR}/../../../lib/libORB_SLAM2.so
)
问题四
catkin_orb-slam2/src/ORB_SLAM2/src/ViewerAR.cc:160:28: error: ‘usleep’ was not declared in this scope
usleep(5000);
在ViewerAR.cc头文件加入
#include <unistd.h>