玩命加载中 . . .

在Ubuntu上安装ROS


Robot Operating System (ROS or ros) is an open source robotics middleware suite. Although ROS is not an operating system but a collection of software frameworks for robot software development, it provides services designed for a heterogeneous computer cluster such as hardware abstraction, low-level device control, implementation of commonly used functionality, message-passing between processes, and package management.
—— Explanation of ROS on Wikipedia

When you want to develop robotics applications, ROS is probably your best choice. With this in mind, I recently started learning ROS. I will write a several blog posts to document my learning rocess. And this post will introduce how to install ROS Noetic on Ubuntu 20.04.

💡 Note:

It's worth mentioning that there are many versions of ROS. And you need to go for the version that fits your desktop system. For example, I'm using Ubuntu 20.04 for work, so I will install the Noetic version; if your desktop system is Debian or other releases of Ubuntu, you should choose another version.

Actually, it's not difficult, since the official documentation(中文版官方文档) is very detailed. Alright, here we go!

Installation

Configuration

At first, you should configure your ubuntu repositories. Set up your sources.list with below command:

sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'

Then set up your keys:

sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
sudo apt update

attention:

If you get an error like this:

"The repositories ... does not have a Release file."

This may be caused by choosing the wrong version. Such as installing Noetic on Ubuntu 20.10

Installation

First pick how much of ROS you would like to install:

  • Desktop-Full Install (Recommended) : Everything in Desktop plus 2D/3D simulators and 2D/3D perception packages

    sudo apt install ros-noetic-desktop-full

  • Desktop Install: Everything in ROS-Base plus tools like rqt and rviz

    sudo apt install ros-noetic-desktop

  • ROS-Base (Bare Bones) : ROS packaging, build, and communication libraries. No GUI tools.

    sudo apt install ros-noetic-ros-base

Environment Setup

This is a very important step. Only after you have completed this step will you be able to use ROS well on your machine.

ROS is installed at /opt/ros/noetic. If you want to use ROS commands, it is necessary to source the setup script:

  • bash

    echo "source /opt/ros/noetic/setup.bash" >> ~/.bashrc
    source ~/.bashrc
  • zsh

    echo "source /opt/ros/noetic/setup.zsh" >> ~/.zshrc
    source ~/.zshrc

Dependencies

Run below command to install some tools and dependencies for building ROS packages:

sudo apt install python3-rosdep python3-rosinstall python3-rosinstall-generator python3-wstool build-essential

Initialize

To Initial ROS, do this:

sudo apt install python3-rosdep
sudo rosdep init
rosdep update

🔧 error:

If you failed, changing the network environment might work.

Now you can use ROS smoothly.

References

ROS Wiki | Ubuntu install of ROS Noetic


文章作者: Mond
版权声明: 本博客所有文章除特別声明外,均采用 CC BY-NC 4.0 许可协议。转载请注明来源 Mond !
  目录