Ubuntu 18.04安装ROS

1.换源

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

2.设置密钥

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys F42ED6FBAB17C654

3.安装

sudo apt-get update
sudo apt-get install ros-melodic-desktop-full
sudo apt-get install ros-melodic-rqt*

4.rosdep init 找不到命令

sudo apt-get install python-rosdep

5.初始化rosdep:

sudo rosdep init
rosdep update

6.安装rosinstall

sudo apt-get install python-rosinstall

7.设置环境变量

sudo gedit ~/.bashrc

最后加入

source /opt/ros/melodic/setup.bash

保存退出

source ~/.bashrc

8.测试

roscore
rosrun turtlesim turtlesim_node
rosrun turtlesim turtle_teleop_key

你可能感兴趣的:(Ubuntu 18.04安装ROS)