最近在准备比赛,在Ubuntu16.04系统中安装完成ROS(Kinect版本)的时候,在进行第一次ROS安装测试的时候,发现roscore启动不成功,而是出现了类似以下的Error:
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.
Unable to contact my own server at [http://192.168.1.104:54385/].
This usually means that the network is not configured properly.
A common cause is that the machine cannot ping itself. Please check
for errors by running:
ping XXXX(这里的XXXX的内容每个电脑显示的东西不一样)
For more tips, please see
http://www.ros.org/wiki/ROS/NetworkSetup
解决方法是:
打开配置文件 ~/.bashrc 。 在末尾增加如下内容。
打开.bashrc文件命令:
sudo gedit ~/.bashrc
打开文件之后,在文件的末尾添加以下内容:
export ROS_HOSTNAME=localhost
export ROS_MASTER_URI=http://localhost:11311
(这个括号里面的内容请不要理会,博主还没有写完,到时候再加content
更改以下为,
export ROS_HOSTNAME=终端电脑名称 即@与:之间部分
export ROS_MASTER_URI=http://终端电脑名称 即@与:之间部分:11311
)
添加完成之后请 Ctrl+s 保存一下文件,然后使用以下的命令更新环境变量:
source ~/.bashrc