11 May 2016

4.1 Installing ROS

  1. Ubuntu install of indigo
  2. Desktop-Full Install

4.2 Insatlling rosinstall

$ sudo apt-get install python-rosinstall
$ sudo rosdep init
$ rosdep update

4.3 Building ROS Packages with Catkin

安装的文件均在 /opt/ros/indigo 下,但均为只读. 创建个人工作空间可以用来:

  1. 安装第三方ROS包
  2. 开发自己的第三方包

4.4 Creating a catkin Workspace

$ mkdir -p ~/catkin_ws/src
$ cd ~/catkin_ws/src
$ catkin_init_workspace
$ cd ~/catkin_ws # 构建
$ catkin_make
  1. 任何改动后都要重新构建:
    $ source ~/catkin_ws/devel/setup.bash
    $ rospack profile
    
  2. 可以将启动命令添加到 ~/.bashrc 文件
    $ echo "source ~/catkin_ws/devel/setup.bash" >> ~/.bashrc
    

4.5 Doing a “make clean” with catkin

注意:所有源码都在 src 目录,不要删除

$ cd ~/catkin_ws
$ \rm -rf devel build install

然后可以照常构建

$ cd ~/catkin_ws
$ catkin_make
$ source devel/setup.bash

4.6 Rebuilding a Single catkin Package

$ cd ~/catkin_ws
$ catkin_make --pkg package_name

4.7 Mixing catkin and rosbuild Workspaces

….

4.15 Installing Packages with SVN, Git, and Mercurial

Git

$ cd ~/catkin_ws/src
$ git clone git://repository/package_name
$ cd ~/catkin_ws
$ catkin_make
$ source devel/setup.bash
$ rospack profile
$ cd ~/catkin_ws/src/package_name # 构建,更新
$ git pull
$ cd ~/catkin_ws
$ catkin_make
$ source devel/setup.bash

## 4.16 Removing Packages from your Personal catkin Directory 首先应该将要移除的包从 ROS_PACKAGE_PATH 变量中移除,比如要移除一个叫的 my_catkin_package 包:

$ cd ~/catkin_ws/src
$ \rm -rf my_catkin_package
cd ~/catkin_ws
\rm -rf devel build install
catkin_make
source devel/setup.bash

测试移除是否成功:

$ roscd my_ros_package

应该输出:

roscd: No such package 'my_ros_package'


blog comments powered by Disqus