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 hkp://ha.pool.sks-keyservers.net:80 --recv-key 421C365BD9FF1F717815A3895523BAEEB01FA116
3更新
sudo apt-get update
4 不同安装方式的不同(选择其中一个就行)
4.1
sudo apt-get install ros-kinetic-desktop-full
包含 ROS, rqt, rviz, robot-generic libraries, 2D/3D simulators, navigation and 2D/3D perception
或
4.2
sudo apt-get install ros-kinetic-desktop
包含ROS, rqt, rviz, and robot-generic libraries
或
4.3
sudo apt-get install ros-kinetic-ros-base
包含(Bare Bones) ROS package, build, and communication libraries. No GUI tools
5 初始化并更新rosdep
sudo rosdep init
rosdep update
6 设置环境
echo "source /opt/ros/kinetic/setup.bash" >> ~/.bashrc
source ~/.bashrc
7 安装所需要的包
sudo apt install python-rosinstall python-rosinstall-generator python-wstool build-essential
其他包的地址
http://repositories.ros.org/status_page/ros_kinetic_default.html
8 测试
roscore
出现
... logging to /home/lv/.ros/log/f84af054-05ea-11ea-8d10-6c71d963d918/roslaunch-lv-23397.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.
started roslaunch server http://lv:37911/
ros_comm version 1.12.14
SUMMARY
========
PARAMETERS
* /rosdistro: kinetic
* /rosversion: 1.12.14
NODES
auto-starting new master
process[master]: started with pid [23408]
ROS_MASTER_URI=http://lv:11311/
setting /run_id to f84af054-05ea-11ea-8d10-6c71d963d918
process[rosout-1]: started with pid [23421]
started core service [/rosout]
测试成功