ROS_PACKAGE_PATH 问题。在设置 .bashrc 时需要帮助

ROS_PACKAGE_PATH issue. Need help in setting .bashrc

我已经添加了

export ROS_PACKAGE_PATH="/home/kathir/ORB_SLAM":${ROS_PACKAGE_PATH}

.bashrc 中,我在 ORB_SLAMcmake 期间收到此错误。

ORB_SLAM cloned path : "/home/kathir/ORB_SLAM"

我在 .bashrc 中的 "/home/kathir/catkin_ws/devel/setup.bash" 中有另一个工作区,因为我将 ROS 用于 ARDRONE

CMake Error at /opt/ros/indigo/share/ros/core/rosbuild/private.cmake:102 (message):
  [rosbuild] rospack found package "ORB_SLAM" at "", but the current
  directory is "/home/kathir/ORB_SLAM".  You should double-check your
  ROS_PACKAGE_PATH to ensure that packages are found in the correct
  precedence order.

查看下方了解更多信息

kathir@kathir-VirtualBox:~/ORB_SLAM/build$ source .bashrc
bash: .bashrc: No such file or directory
kathir@kathir-VirtualBox:~/ORB_SLAM/build$ $ROS_PACKAGE_PATH
bash: /opt/ros/indigo/share:/opt/ros/indigo/stacks:M$:: No such file or directory

应该使用source ~/.bashrc 使包路径生效

您可能看到的 错误 是因为您导出的变量在当前 shell 中没有生效。你需要它source它在当前shell才能生效,

source ~/.bashrc

或更简单地说

. ~/.bashrc

将所有新环境变量导入现有会话。您不必为后续会话执行此操作,因为这将为启动时打开的每个新会话提供资源。

如果你已经添加路径并写入.bashrc,你可以:

运行 the script: source ~/.bashrc 如其他答案所说;

或者重新打开terminate,接下来每次打开终端,脚本都会运行自动