官术网_书友最值得收藏!

Installing ROS on Ubuntu

As per our previous discussion, we know that ROS is a metaoperating system that is installed on a host system. ROS is completely supported on Ubuntu /Linux and in the experimental stages on Windows and OS X. Some of the latest ROS distributions are as follows:

We will now look at the installation procedure of the stable, long-term support (LTS) distribution of ROS called Kinetic on Ubuntu 16.04.3 LTS. ROS Kinetic Kame will be primarily targeted at Ubuntu 16.04 LTS. You can also find instructions to set up ROS in the latest LTS Melodic Morenia on Ubuntu 18.04 LTS after looking at the following instructions. If you are a Windows or OS X user, you can install Ubuntu in a VirtualBox application before installing ROS on it. The link to download VirtualBox is https://www.virtualbox.org/wiki/Downloads.

You can find the complete instructions for doing this at http://wiki.ros.org/kinetic/Installation/Ubuntu.

The steps are as follows:

  1. Configure your Ubuntu repositories to allow restricted, universe, and multiverse downloadable files. We can configure it using Ubuntu's Software & Update tool. We can get this tool by simply searching on the Ubuntu Unity search menu and ticking the shown in the following screenshot:

Ubuntu's Software & Update tool

  1. Set up your system to accept ROS packages from packages.ros.org. ROS Kinetic is supported only on Ubuntu 15.10 and 16.04. The following command will store packages.ros.org in Ubuntu's apt repository list:
    $ sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
  1. Next, we have to add apt-keys. An apt-key is used to manage the list of keys used by apt to authenticate the packages. Packages that have been authenticated using these keys will be considered trusted. The following command will add apt-keys for the ROS packages:
    sudo apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-key 421C365BD9FF1F717815A3895523BAEEB01FA116  
  1. After adding the apt-keys, we have to update the Ubuntu package list. The following command will add and update the ROS packages, along with the Ubuntu packages:
    $ sudo apt-get update
  1. After updating the ROS packages, we can install the packages. The following command will install all the necessary packages, tools, and libraries of ROS:
      $ sudo apt-get install ros-kinetic-desktop-full 
  1. We may need to install additional packages even after the desktop full installation. Each additional installation will be mentioned in the appropriate section. The desktop full install will take some time. After the installation of ROS, you will almost be done. The next step is to initialize rosdep, which enables you to easily install the system dependencies for ROS source packages:
$ sudo rosdep init    
$ rosdep update
  1. To access ROS's tools and commands on the current bash shell, we can add ROS environmental variables to the .bashrc file. This will execute at the beginning of each bash session. The following is a command to add the ROS variable to .bashrc:
    echo "source /opt/ros/kinetic/setup.bash" >> ~/.bashrc   

The following command will execute the .bashrc script on the current shell to generate the change in the current shell:

    source ~/.bashrc  
  1. A useful tool to install the dependency of a package is rosinstall. This tool has to be installed separately. It enables you to easily download many source trees for the ROS package with one command:
    $ sudo apt-get install python-rosinstall python-rosinstall-generator python-wstool build-essential  

The installation of the latest LTS Melodic is similar to the preceding instructions. You can install Melodic along with Ubuntu 18.04 LTS. You can find the complete instructions at http://wiki.ros.org/melodic/Installation/Ubuntu.

After the installation of ROS, we will discuss how to create a sample package in ROS. Before creating the package, we have to create a ROS workspace. The packages are created in the ROS workspace. We will use the catkin build system, which is a set of tools that is used to build packages in ROS. The catkin build system generates an executable or shared library from the source code. ROS Kinetic uses the catkin build system to build packages. Let's look at what catkin is.

主站蜘蛛池模板: 洮南市| 南汇区| 龙南县| 清原| 永川市| 刚察县| 修水县| 孟州市| 黄平县| 竹北市| 庆阳市| 左云县| 庄浪县| 丰宁| 玉龙| 库尔勒市| 台江县| 本溪| 万州区| 怀远县| 曲沃县| 瓮安县| 浦城县| 汤原县| 黔南| 丽江市| 衡水市| 伊吾县| 武陟县| 台中市| 宿松县| 西畴县| 商都县| 永平县| 高阳县| 莱州市| 工布江达县| 金沙县| 霍州市| 韶关市| 岫岩|