ROS1入门--安装(Ubuntu18.04,ROS-Modelic)

1.添加ROS软件源

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

这个源是科大的,速度快

2.添加**

wget https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -O - | sudo apt-key add-

新的**,亲测有效

3.安装ROS

sudo apt-get update

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

4.初始化rosdep

sudo rosdep init

rosdep update

在update时如果出现timeout的问题,而且反复出现,换个网络试试,为从无线网换成手机热点,问题得以解决。

5.设置环境变量

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

source ~/.bashrc

6.安装rosinstall

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

7.输入roscore,出现如下界面说明安装成功了

ROS1入门--安装(Ubuntu18.04,ROS-Modelic)