先确定自己的环境变量是否设置正确
export | grep ROS
若出现如下的,说明是正确的
declare -x ROSLISP_PACKAGE_DIRECTORIES=""
declare -x ROS_DISTRO="indigo"
declare -x ROS_ETC_DIR="/opt/ros/indigo/etc/ros"
declare -x ROS_MASTER_URI="http://localhost:11311"
declare -x ROS_PACKAGE_PATH="/opt/ros/indigo/share:/opt/ros/indigo/stacks"
declare -x ROS_ROOT="/opt/ros/indigo/share/ros"
1. source /opt/ros/bin/setup.bash
2. mkdir -p ~/catakin_ws/src 连续创建两个目录
3. cd ~/catakin_ws/src 进入目录
4. catkin_init_workspace 初始化工作空间创建CMakelists.txt
ps:以上运行我都没有错误
5. cd .. 进入上一层目录
6. catkin_make
成功执行会现:
-- Build files have been written to: /home/yguo/catakin-ws/build####
#### Running command: "make -j4 -l4" in "/home/yguo/catakin-ws/build"
####
8.
source devel/setup.bash 读取并执行
9.
echo $ROS_PACKAGE_PATH 查看包路径,确保ros_package_path环境变量包括在你的目录中。
/home/sanstyle/catakin_ws/src:/opt/ros/indigo/share:/opt/ros/indigo/stacks
这是我的显示的,因个人习惯而异,证明已经安装成功