参考文章:ROS多机通讯(unable to communicate with master 解决)_kuai-的博客-CSDN博客
第一步
ifconfig
复制
结果为(注意查看自己的inet值并保存)
acc133: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.125.75.219 netmask 255.255.255.0 broadcast xxxxxx
inet6 fe80::1721:1dd1:6cc2:a311 prefixlen 64 scopeid 0x20<link>
ether 00:0c:29:a2:dd:da txqueuelen 1000 (Ethernet)
RX packets 173975 bytes 188553377 (188.5 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 75714 bytes 4684485 (4.6 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet xxxxx netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 2169 bytes 331712 (331.7 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 2169 bytes 331712 (331.7 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
复制
保存
inet 中的192.168.75.219 acc133
第二步
sudo gedit /etc/hosts
复制
得到
xxxxxx localhost
xxxxxx ubuntu
...................
复制
改为
xxxxxx localhost
xxxxxx ubuntu
192.125.75.219 acc133
...................
复制
保存并退出
第三步
输入
ping ens33
复制
得到的结果是否正常,正常使用Ctrl c退出
第四步
打开节点程序
rosrun turtlesim turtlesim_node
复制
正常打开!!成功解决