错误:
Error from directory check: /opt/ros/kinetic/share/ros/core/rosbuild/bin/check_same_directories.py /home/nuc/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/nuc/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)
CMakeLists.txt:4 (rosbuild_init)
解决办法:
gedit ~/.bashrc
需要在文档最后添加
source ~/.bashrc
输出路径进行确认;
echo $ROS_PACKAGE_PATH
显示的结果为:
/opt/ros/kinetic/share:/home/nuc/ORB-SLAM2_RGBD_DENSE_MAP/Examples/ROS:/home/nuc/ORB_SLAM2/Examples/ROS
注意:source /opt/ros/kintic/setup.bash 要写在路径:ROS_PACKGE_PATH=${ROS_PACKGE_PATH}:/home/nuc/ORB-SLAM2_RGBD_DENSE_MAP/Examples/ROS
ROS_PACKGE_PATH=${ROS_PACKGE_PATH} :/home/nuc/ORB_SLAM2/Examples/ROS
的前面。