Search code examples
bashrosslam

ROS_PACKAGE_PATH issue. Need help in setting .bashrc


I have added

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

in .bashrc and I am getting this error during cmake of ORB_SLAM.

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

I have another workspace in "/home/kathir/catkin_ws/devel/setup.bash" in the .bashrc since I was using ROS for 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.

check below for further info

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

Solution

  • The error you are likely seeing is because of your exported variables not taking effect in your current shell. You need it to source it in the current shell for it to take effect,

    source ~/.bashrc
    

    or more simply just

    . ~/.bashrc
    

    which imports all the new environment variables to the existing session. You don't have do this for subsequent sessions, as this will be sourced for every new session opened upon startup.