ROS installation on Ubuntu

 The video I watched is the installation of ROS Melodic on Ubuntu18, but the Ubuntu version on my own virtual machine is 16.04. I checked the correspondence and chose to install ROS Kenetic. The installation process is the same.

The Ros version is the most friendly to Ubuntu. Other versions of linux may need to be compiled and installed. This can be installed directly.

The installation process is as follows:

1: Set up the computer to accept software from package.ros.org.

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

Mirroring is also possible, I will do it above.

2: Set Key:

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

If it is a proxy server, you can also:

curl -sSL 'http://keyserver.ubuntu.com/pks/lookup?op=get&search=0xC1CF6E31E6BADE8868B172B4F42ED6FBAB17C654' | sudo apt-key add -

This is useless to me.

3: Update the package of the system

sudo apt-get update

4: Installation

There are many different libraries and tools in ROS. ROS provides four default configurations to help you get started. You can also install the ROS software package separately.

If there is a problem in the next step, you can use the following repository instead of the ros-shadow-fixed repository mentioned above. I don’t understand this, but I choose the one recommended by him, and it’s no problem.

Desktop-Full Install: (Recommended): Contains ROS, rqt, rviz, robot general library, 2D/3D simulator, navigation and 2D/3D perception, I chose this version.

sudo apt-get install ros-kinetic-desktop-full

Desktop Install:   Contains: ROS, rqt, rviz and robot general library

sudo apt-get install ros-kinetic-desktop

ROS-Base:  (Basic Edition) ROS program package, construction and communication library. There is no GUI tool.

sudo apt-get install ros-kinetic-ros-base

Single package:

sudo apt-get install ros-kinetic-PACKAGE

such as:

sudo apt-get install ros-kinetic-slam-gmapping

Found available package commands:

apt-cache search ros-kinetic

5: Environment establishment

Every time a new shell is started, it will be very convenient if the ROS environment variables are automatically added to the bash session, just like this:

echo "source /opt/ros/kinetic/setup.bash" >> ~/.bashrc
source ~/.bashrc

If multiple ROS distributions are installed, ~/.bashrc must only provide setup.bash for the currently used version.

If you only want to change the environment of the current shell, you can enter the following instead of the above:

source /opt/ros/kinetic/setup.bash

If you use zsh instead of bash, you need to run the following command to set up the shell: (I didn't use this)

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

6: Compile the package dependent library

So far, the software required to run the core ROS software package has been installed. In order to create and manage your own ROS workspace, you need various tools and requirements. For example, rosinstall is a commonly used command line tool that allows you to easily download many source trees of ROS software packages with one command.

To install this tool and other dependencies to build the ROS package, run:

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

Initialize rosdep

Before using many ROS tools, rosdep needs to be initialized. rosdep makes it easy for you to install system dependencies for the source to be compiled, and it is necessary to run certain core components in ROS. If rosdep has not been installed, please do the following.

sudo apt install python-rosdep

Initialize rosdep below

sudo rosdep init
rosdep update

7: Verification

Issue the command in the terminal: 

runcore

If it starts normally as follows, the installation is successful.

The official said that the package installed above was  compiled by https://build.ros.org/ , you can view the update.

Refer to http://wiki.ros.org/kinetic/Installation/Ubuntu for the installation process 

The entire installation is complete.

 

 

 

 

 

 

 

Guess you like

Origin blog.csdn.net/leon_zeng0/article/details/114812326