ROS ORB_SLAM2报错: [rosbuild] rospack found package “ORB_SLAM2“ at ““

错误内容

[rosbuild] rospack found package “ORB_SLAM2” at “”, 
but the current directory is ...

出错原因
根据ORB_SLAM2原repo里的issue ISSUE,出现这个报错是ros找不到ORB_SLAM2这个包的位置,也就是要设置ROS_PACKAGE_PATH

解决方法
在~/.bashrc里添加ROS_PACKAGE_PATH路径:

sudo nano ~/.bashrc
# path_to_project是到ORB_SLAM的ros工作空间路径
export ROS_PACKAGE_PATH=${ROS_PACKAGE_PATH}:path_to_project/catkin_ws/src/ORB_SLAM2/Examples/ROS
source ~/.bashrc

然后验证一下:

echo $ROS_PACKAGE_PATH

出现刚刚的bashrc路径就OK了

问题解决

你可能感兴趣的:(ROS,机器人操作系统,人工智能,linux)