Ubuntu18.04安装ROS Melodic

1.参考资料

ros安装
http://wiki.ros.org/melodic/Installation/Ubuntu
清华大学开源软件镜像站
https://mirror.tuna.tsinghua.edu.cn/

2.设置下载源

sudo sh -c ‘echo “deb https://mirrors.tuna.tsinghua.edu.cn/ros/ubuntu/ bionic main” > /etc/apt/sources.list.d/ros-latest.list’
报错时改为http
sudo sh -c ‘echo “deb http://mirrors.tuna.tsinghua.edu.cn/ros/ubuntu/ bionic main” > /etc/apt/sources.list.d/ros-latest.list’

3.设置密钥

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

4.安装

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

5.设置环境

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

6.安装依赖包

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

sudo rosdep init
报错
ERROR: cannot download default sources list from:
https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/sources.list.d/20-default.list
Website may be down

百度域名IP查询工具,查找raw.githubusercontent.com网站的IP然后
sudo sh -c ‘echo “185.199.109.133 raw.githubusercontent.com” >> /etc/hosts’
重新执行sudo rosdep init
rosdep update

7.验证安装

第一个终端运行
roscore
第二个终端运行
rosrun turtlesim turtlesim_node
第三个终端运行
rosrun turtlesim turtle_teleop_key

你可能感兴趣的:(ROS机器人系统,linux,机器人,ubuntu)