友情提示:380元/半年,儿童学编程,就上码丁实验室。
Turtlebot3-waffle入门教程-网络设置
说明:
- 介绍如何设置Turtlebot3-waffle的主从模式
- 介绍如何同步时间,如果时间不同步,容易出现TF变换错误
时间同步
- 主从分别安装chrony,参考文章
$ sudo apt-get install chrony
- 主从分别安装ntpdate
$ sudo apt-get install ntpdate
- 主从分别同步时间
$ sudo ntpdate ntp.ubuntu.com
- 检测时间是否同步
$ date
设置:
- 图示:
- ROS需要IP地址在turtlebot和远程PC之间进行通信
- 分别在turtlebot和PC,执行如下命令获得对应的IP地址:
ifconfig
- 修改.bashrc
gedit ~/.bashrc
- TURTLEBOT配置如下:
export ROS_MASTER_URI=http://IP_OF_PC:11311
export ROS_HOSTNAME=IP_OF_TURTLEBOT
- PC配置如下:
export ROS_MASTER_URI=http://IP_OF_PC:11311
export ROS_HOSTNAME=IP_OF_PC
-
ROS_MASTER 运行在远程PC上。
-
让环境生效:
source ~/.bashrc