1. Ubuntu16.04的安装
ubuntu16.04安装的步骤就省略了,ubuntu官网下载地址:https://www.ubuntu.com/download
2. ROS Kinetic 安装
-
配置系统的软件和更新 设置 下载自 中国的服务器
-
添加中科大的ROS镜像源
$ 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’
- 1
-
配置key
$ sudo apt-key adv —keyserver hkp://ha.pool.sks-keyservers.net:80 —recv-key 421C365BD9FF1F717815A3895523BAEEB01FA116
- 1
-
更新并安装完全版
$ sudo apt-get update
$ sudo apt-get install ros-kinetic-desktop-full- 1
- 2
-
初始化rosdep
$ sudo rosdep init
$ rosdep update- 1
- 2
-
初始化环境
$ echo “source /opt/ros/kinetic/setup.bash” >> ~/.bashrc
$ source ~/.bashrc- 1
- 2
-
安装额外依赖包
$ sudo apt-get install python-rosinstall python-rosinstall-generator python-wstool build-essential
- 1
-
发布ros
$ roscore
- 1
-
创建工作空间
$ mkdir -p ~/catkin_ws/src
$ cd ~/catkin_ws/src
$ catkin_init_workspace- 1
- 2
- 3
-
编译工作空间
$ cd ..
$ catkin_make
$ echo “source ~/catkin_ws/devel/setup.bash”>> ~/.bashrc- 1
- 2
- 3
-
打开新的终端
$ roscore
- 1
开启master、rosout等,出现下图:
-
第二次打开终端
$ rosrun turtlesim turtlesim_node
- 1
此时出现了小乌龟:
-
第二次打开终端
$ rosrun turtlesim turtle_teleop_key
- 1
此时,可以通过键盘方向键控制乌龟运动:
-
添加功能包到 ~/catkin_ws/src (自行添加功能包)
-
编译功能包(自行添加功能包)
$ cd ~/catkin_ws
$ catkin_make- 1
- 2
-
安装额外依赖包
$ sudo apt-get install ros-kinetic-arbotix-* ros-kinetic-map-server ros-kinetic-navigation ros-kinetic-robot-pose-ekf ros-kinetic-moveit
- 1
3. ROS 多机通讯设置
-
主机设置
$ sudo nano /etc/hosts
- 1
在第三行添加 从机的IP地址 (cuser代表从机名 ip可通过ifconfig查看)
192.168.1.116 cuser
- 1
-
从机设置
$ sudo nano /etc/hosts
- 1
在第三行添加 主机的IP地址 (muser代表主机名 ip可通过ifconfig查看)
192.168.1.104 muser
- 1
-
主从机分别使用ping 命令测试网络
$ ping cuser
$ ping muser- 1
- 2
检查网络通讯是否正常
-
主机设置ROS_IP
$ echo “export ROS_IP=192.168.1.104”>> ~/.bashrc
- 1
-
从机设置ROS_IP和ROS_MASTER_URI
$ echo “export ROS_IP=192.168.1.116”>> ~/.bashrc #设置从机名ip
$ echo “export ROS_MASTER_URI=http://muser:11311">> ~/.bashrc #muser代表主机名 配置为使用同一个master- 1
- 2
参考:
相关推荐:
ROS笔记(1) ROS简介
谢谢!
评论(0)
您还未登录,请登录后发表或查看评论