(1)添加ros软件源
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
(2)添加密钥
sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
(3)更新软件源
sudo apt update
(4)安装ros
sudo apt install ros-melodic-desktop-full
(5)初始化rosdep
sudo apt install rospack-tools
sudo rosdep init
rosdep update