初始化工作空间(此处创建的工作空间名为catkin_ws,读者可自行命名)
mkdir -p ~/catkin_ws/src
cd ~/catkin_ws/src
catkin_init_workspace
编译工作空间
cd ~/catkin_ws/
catkin_make
使得工作空间的环境变量生效
source devel/setup.bash
使得环境变量在所有的终端中都有效
echo "source ~/catkin_ws/devel/setup.bash" >> ~/.bashrc
检查环境变量已经生效,创建一个新终端,输入:
echo $ROS_PACKAGE_PATH