参考文章:https://blog.csdn.net/qq_43481884/article/details/108895044
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
正常打开!!成功解决
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。