控制系统实现_分布式框架
参考教程:
http://www.autolabor.com.cn/book/ROSTutorials/
https://www.bilibili.com/video/BV1Ci4y1L7ZZ/?spm_id_from=333.999.0.0
1. 配置静态IP地址
1.1 配置树莓派静态IP地址
当前分布式框架搭建时,树莓派是作为主机,而PC则作为从机,关于分布式框架的搭建流程,我们需要为树莓派连接无线网络,并设置固定IP,实现如下:
- 硬件准备:使用显示屏或HDMI才即可连接树莓派并启动;
- 为树莓派连接无线网络;
- 为树莓派配置静态IP,具体操作如图:
点击桌面右上角的wifi图标,选择编辑连接,得到如下图所示
查看相应的IP地址
ubuntu@ubuntu:~$ ifconfig
eth0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
ether e4:5f:01:fb:b5:4b txqueuelen 1000 (以太网)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (本地环回)
RX packets 5533 bytes 580598 (580.5 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 5533 bytes 580598 (580.5 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.0.167 netmask 255.255.255.0 broadcast 192.168.0.255
inet6 fe80::e65f:1ff:fefb:b54c prefixlen 64 scopeid 0x20<link>
ether e4:5f:01:fb:b5:4c txqueuelen 1000 (以太网)
RX packets 240095 bytes 333868254 (333.8 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 76135 bytes 10300744 (10.3 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
1.2 配置虚拟机静态IP地址
配置虚拟机静态IP地址和树莓派操作类似
在详细信息(Details)下查看当前ip地址,记录好后,选择IPV4
2. 实现
2.1 准备
先要保证不同计算机处于同一网络中,最好分别设置固定IP,如果为虚拟机,需要将网络适配器改为桥接模式;
查看虚拟机的主机名
rosnoetic@rosnoetic-VirtualBox:~$ hostname
rosnoetic-VirtualBox
查看虚拟机中的ip地址
rosnoetic@rosnoetic-VirtualBox:~$ ifconfig
enp0s3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.43.66 net