「ROS安装」ROS标准安装方法

前言:

话不多说,我正在忙碌中抽时间写这篇博客。将下列终端指令一一执行,即可成功配置ROS环境。


1. 设置网络时间协议

$sudo apt-get install -y chrony ntpdate
$sudo ntpdate -q ntp.ubuntu.com

2.添加代码列表

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

3.设置公钥(Key)

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

4.更新软件包索引

$sudo apt-get update && sudo apt-get upgrade -y

5.安装ROS Kinetic Kame

$sudo apt-get install ros-kinetic-desktop-full

#安装额外的rqt相关的功能包
$sudo apt-get install ros-kinetic-rqt*

6.初始化rosdep

$sudo rosdep init
$rosdep update

7.安装rosinstall

$sudo apt-get install python-rosinstall

8.加载环境设置文件

$source/opt/ros/kinetic/setup.bash

9.创建并初始化工作目录

$mkdir -p ~/catkin_ws/src
$cd ~/catkin_ws/src
$catkin_init_workspace

$cd ~/catkin_ws/
$catkin_make

$ls

$source ~/catkin_ws/devel/setup.bash

10.测试安装结果

$roscore

看到如下指令,则表示安装成功。

... logging to /home/anan/.ros/log/2b7374fe-4725-11e9-8f11-9cf387dafe8c/roslaunch-ubuntu-7490.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://192.168.1.151:37505/
ros_comm version 1.12.14


SUMMARY
========

PARAMETERS
 * /rosdistro: kinetic
 * /rosversion: 1.12.14

NODES

auto-starting new master
process[master]: started with pid [7500]
ROS_MASTER_URI=http://192.168.1.151:11311/

setting /run_id to 2b7374fe-4725-11e9-8f11-9cf387dafe8c
process[rosout-1]: started with pid [7513]
started core service [/rosout]

按“ctrl”+"c",退出即可。

*补充一条指令,查看我们配置的环境。

$gedit .bashrc

**下面给出一键安装指令,小白亲测有一些不完善的地方:

wget https://raw.githubusercontent.com/oroca/oroca-ros-pkg/kinetic/ros_install.sh && chmod 755 ./ros_install.sh && bash ./ros_install.sh catkin_ws kinetic

猜你喜欢

转载自blog.csdn.net/Robot_Starscream/article/details/88583674