.bashrc 是用来给用户提供方便的。将你常用的packages引援到bashrc里面,这样每次打开一个新的Terminal的时候,他就知道你的东西都在哪里了。有点类似于一个快捷方式的列表。
The name ROS_PACKAGE_PATH
is a environment varaible name. The {ROS_PACKAGE_PATH}
is the name itself, this basiclly means x = PATH + x
, which adds the new path to the old. The colounm :
is used to separet two paths.
export ROS_PACKAGE_PATH=~/ros_workspace:/home/peng/octomapLib/alufr-ros-pkg/:${ROS_PACKAGE_PATH}
你可以用这个简单的命令把源添加到Bashrc里面:
source /opt/ros/hydro/setup.bash
举个简单的例子,这个是我电脑里的 .bashrc:
注意 alias 等号后面不能有空格
$ subl ~/.bashrc
alias mathome='cd /home/mfeng/Matlab-Tests/'
source /opt/ros/hydro/setup.bash
source /usr/share/drcsim/setup.sh
source /home/mfeng/drc_workspace/devel/setup.bash
alias drchome='cd ~/drc_workspace/src/drc/'
alias drcmake='catkin_make install -DCMAKE_INSTALL_PREFIX:PATH=~/drc_workspace/install -C ~/drc_workspace -DCMAKE_BUILD_TYPE=Release'
alias drceclipse='catkin_make --force-cmake -G"Eclipse CDT4 - Unix Makefiles" -
DCMAKE_BUILD_TYPE=Debug -DCMAKE_ECLIPSE_MAKE_ARGUMENTS=-j8 -C ~/drc_workspace'
export GAZEBO_PLUGIN_PATH=/home/mfeng/drc_workspace/devel/lib:${GAZEBO_PLUGIN_PATH}
export GAZEBO_MODEL_PATH=/home/mfeng/drc_workspace/src/drc/field/robotiq:${GAZEBO_MODEL_PATH}
export PYTHONPATH=/home/mfeng/drc_workspace/src/drc/trajopt/build_trajopt/lib:/home/mfeng/drc_workspace/src/drc/trajopt:${PYTHONPATH}
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/lib
export GUROBI_HOME=/opt/gurobi603/linux64
export OPENRAVE_DATA=${OPENRAVE_DATA}:/home/mfeng/drc_workspace/src/drc/trajopt/
alias drctrajopt='cd ~/drc_workspace/src/drc/trajopt/'