官网:melodic/Installation/Ubuntu - ROS Wiki

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

sudo sh -c '. /etc/lsb-release && echo "deb http://mirrors.ustc.edu.cn/ros/ubuntu/ $DISTRIB_CODENAME main" > /etc/apt/sources.list.d/ros-latest.list'

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-key 421C365BD9FF1F717815A3895523BAEEB01FA116

sudo apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-key 421C365BD9FF1F717815A3895523BAEEB01FA116

E: Failed to fetch http://cn.archive.ubuntu.com/ubuntu/pool/universe/v/vtk6/libvtk6.3_6.3.0+dfsg1-11build1_amd64.deb Connection failed [IP: 91.189.91.39 80]

E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

apt-get update

rosdep init 报错,提示不能从网站下载

执行如下命令,添加内容

sudo gedit /etc/hosts

# GitHub Start

199.232.28.133 raw.githubusercontent.com

# GitHub End

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

source ~/.bashrc

报错,无该路径文件

执行gedit ~/.bashrc,把文件中最后source /opt/ros/melodic/setup.bash注释或删除,然后执行source ~/.bashrc

在执行roscore时不可用,查看安装过程中,有以下两个安装失败,重新安装ros ,把bashrc中注释的source /opt/ros/melodic/setup.bash打开,然后执行source ~/.bashrc设置成功

然后再运行roscore,可打开,小乌龟测试程序可运行

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

Get:619 http://cn.archive.ubuntu.com/ubuntu bionic/universe amd64 libvtk6.3 amd64 6.3.0+dfsg1-11build1 [31.5 MB]

Err:619 http://cn.archive.ubuntu.com/ubuntu bionic/universe amd64 libvtk6.3 amd64 6.3.0+dfsg1-11build1

Connection failed [IP: 91.189.91.39 80]

Fetched 463 MB in 1h 13min 59s (104 kB/s)

E: Failed to fetch http://cn.archive.ubuntu.com/ubuntu/pool/universe/v/vtk6/libvtk6.3_6.3.0+dfsg1-11build1_amd64.deb Connection failed [IP: 91.189.91.39 80]

E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

小乌龟实例仿真:Ubuntu 18.04安装ROS Melodic_ros melodic jingxiang-CSDN博客

安装:sudo apt-get install ros-melodic-turtlesim

启动roscore:roscore

打开另外一个terminal

rosrun turtlesim turtlesim_node

再打开第三个terminal:控制小乌龟移动rosrun turtlesim turtle_teleop_key

好文链接

评论可见,请评论后查看内容,谢谢!!!评论后请刷新页面。