ros主从关系

主机:

在~/.bashrc里面输入

export ROS_MASTER_URI=http://localhost:11311
export ROS_HOSTNAME=192.168.4.1

其ip地址如下:

inet addr:192.168.4.1  Bcast:192.168.4.255  Mask:255.255.255.0

从机:

IP地址:inet addr:192.168.4.59  Bcast:192.168.4.255  Mask:255.255.255.0

在~/.bashr里面输入

export ROS_MASTER_URI=http://192.168.4.1:11311
export ROS_HOSTNAME=192.168.4.59

上位机联通工作站的时候莫名其妙遇到这个错误 Couldn't find an AF_INET address for xxx,
在工作站端

hostname -I    输出>>192.168.0.109

export ROS_IP=192.168.0.109

然后就不会再报错了,为了避免每次打开terminal都要重复上面两句,可以在环境变量~/.bashrc加入

export ROS_IP=`hostname -I`

原文地址:https://www.cnblogs.com/gary-guo/p/10130413.html