ubuntu18.04安装ROS

###注:由于使用国外的源安装ROS特别缓慢,因此要尽量使用国内的源

#添加镜像源

sudo sh -c '. /etc/lsb-release && echo "deb http://mirrors.tuna.tsinghua.edu.cn/ros/ubuntu/ `lsb_release -cs` main" > /etc/apt/sources.list.d/ros-latest.list'

#添加公钥

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

#更新软件包索引

sudo apt update

#安装桌面完整版

sudo apt install ros-melodic-desktop-full

#查找可用软件包

apt search ros-melodic

#初始化rosdep

sudo rosdep init

rosdep update

#设置环境变量

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

source ~/.bashrc

#安装依赖项

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

你可能感兴趣的:(ubuntu18.04安装ROS)