ROS environment installation and configuration

Correspondence between Ubuntu and ROS versions

Ubuntu ROS 1.0 ROS2.0
16.04 LTS Kinetic LTS Ardent
18.04 LTS Melodic LTS Dashing LTS
20.04 LTS Noetic LTS Foxy LTS

Installation process

The process is recorded according to the Ubuntu18.04 version of ROS installation. If you use other versions or ROS2.0, you need to modify it according to the table at the beginning of the article.

add source

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

set key

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

Install ROS

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

View available packages

sudo apt-cache search ros-melodic

Configure the environment to the system

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

Initialize environment variables

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

verify

roscore

Install Gazebo

sudo apt-get update
sudo apt-get install lsb-release wget gnupg
sudo sh -c 'echo "deb http://packages.osrfoundation.org/gazebo/ubuntu-stable `lsb_release -cs` main" > /etc/apt/sources.list.d/gazebo-stable.list'
wget http://packages.osrfoundation.org/gazebo.key -O - | sudo apt-key add -
sudo apt-get update
sudo apt-get install ignition-citadel

Guess you like

Origin blog.csdn.net/yichao_ding/article/details/131099752