ROS入门教程-安装并配置ROS环境(melodic版本)
说明
- 本教程详细描述了ROS的安装与环境配置。
- 此为 Ubuntu18.04 + melodic安装说明
官方安装ROS说明
ubuntu18.04版本
- ubuntu18.04版本镜像官方下载连接:Ubuntu系统下载 | Ubuntu
ROS的melodic版本安装说明
1、安装源
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'
2、设置key
sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
3、更新
sudo apt-get update
4、安装,这里介绍Desktop-Full安装: (Recommended) : ROS, rqt, rviz, robot-generic libraries, 2D/3D simulators, navigation and 2D/3D perception 和 安装rosinstall,便利的工具
sudo apt-get install ros-melodic-desktop-full
sudo apt install python-rosdep python-rosinstall python-rosinstall-generator python-wstool build-essential
5、解决依赖
sudo rosdep init
rosdep update
6、环境设置
echo "source /opt/ros/melodic/setup.bash" >> ~/.bashrc
source ~/.bashrc
7、测试安装,运行roscore
roscore
- 若正常出现以下信息,说明已经成功安装
.. logging to /home/ubuntu/.ros/log/cb38e680-dee2-11ea-bae1-70665563e003/roslaunch-nx-1205.log
Checking log directory for disk usage. This may take a while.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.
started roslaunch server http://nx:36773/
ros_comm version 1.14.7
SUMMARY
========
PARAMETERS
* /rosdistro: melodic
* /rosversion: 1.14.7
NODES
auto-starting new master
process[master]: started with pid [1215]
ROS_MASTER_URI=http://nx:11311/
setting /run_id to cb38e680-dee2-11ea-bae1-70665563e003
process[rosout-1]: started with pid [1228]
started core service [/rosout]