ROS安装与卸载教程
一 ros安装
1.0 设备环境:Ubuntu 14.04 ros indigo
1.1 配置Ubuntu仓库变为允许"restricted," "universe," and "multiverse
1.2
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
这里需要注意的问题是,有些时候由于防火墙原因,有些时候需要点击Mirrors换一个指令,否则可能安装不了哦
1.3
sudo apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net --recv-key 421C365BD9FF1F717815A3895523BAEEB01FA116
sudo apt-get update
sudo apt-get install ros-indigo-desktop-full
sudo rosdep init
rosdep update
echo "source /opt/ros/indigo/setup.bash" >> ~/.bashrc
source ~/.bashrc
1.4 这时会看到ROS的环境变量
$ printenv |grep ROS ROS_ROOT=/opt/ros/indigo/share/ros ROS_PACKAGE_PATH=/opt/ros/indigo/share:/opt/ros/indigo/stacks ROS_MASTER_URI=http://localhost:11311 ROSLISP_PACKAGE_DIRECTORIES= ROS_DISTRO=indigo ROS_ETC_DIR=/opt/ros/indigo/etc/ros
二 ros卸载
sudo apt-get purge ros-*
sudo rm -rf /etc/ros
删除.bashrc中的source /opt/ros/indigo/setup.bash
如果有自己建立的catkin_ws,也删除
三 ros源码安装
卸载之后,我们可以源码安装
sudo apt-get install python-rosdep python-rosinstall-generator python-wstool python-rosinstall build-essential sudo rosdep init rosdep update mkdir ~/ros_catkin_ws cd ~/ros_catkin_ws rosinstall_generator desktop_full --rosdistro indigo --deps --wet-only --tar > indigo-desktop-full-wet.rosinstall wstool init -j8 src indigo-desktop-full-wet.rosinstall rosdep install --from-paths src --ignore-src --rosdistro indigo -y ./src/catkin/bin/catkin_make_isolated --install -DCMAKE_BUILD_TYPE=Release source ~/ros_catkin_ws/install_isolated/setup.bash
如果下载新的包,可以采用建立自己的工作空间的方式
mkdir -p ~/catkin_ws/src cd ~/catkin_ws/src catkin_init_workspace cd ~/catkin_ws/ catkin_make source ~/catkin_ws/devel/setup.bash
参考文献:
1 http://wiki.ros.org/ROS/Tutorials/InstallingandConfiguringROSEnvironment
2 http://wiki.ros.org/indigo/Installation
3 http://wiki.ros.org/indigo/Installation/Source