roscore失败,提示RLException: Unable to contact my own server

在给Jetson Xavior配环境的过程中,发现roscore会报错,报错如下:

robot@robot:~$ roscore
... logging to /home/robot/.ros/log/67bcd434-f455-11eb-b3b6-204ef6c5f181/roslaunch-robot-22150.log
Checking log directory for disk usage. This may take a while.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

RLException: Unable to contact my own server at [http://192.168.100.3:41153/].
This usually means that the network is not configured properly.

A common cause is that the machine cannot connect to itself.  Please check
for errors by running:

	ping 192.168.100.3

For more tips, please see

	http://wiki.ros.org/ROS/NetworkSetup

The traceback for the exception was written to the log file

这是由于在.bashrc里设置了启动ros时的地址和名称,我这里是copy了别人的镜像文件,所以出现了这个问题,他们原来是开机就启动连接一个指定的ip地址。
但在我这里现在不需要这么做,所以要做些修改:
以下是原始的.bashrc启动ros的部分,可见问题是由最后两行引起的

source /opt/ros/melodic/setup.bash
#source /home/robot/hku15_car_ws/devel/setup.bash
export LD_LIBRARY_PATH=/usr/local/cuda/lib
export PATH=$PATH:/usr/local/cuda-10.2/bin
export LD_LIBRARY_PATH=/opt/ros/melodic/lib
export ROS_MASTER_URI=http://192.168.100.3:11311
export ROS_HOSTNAME=192.168.100.3

所以,只要改一下这个地址和用户名就可以了
改成如下:

export ROS_MASTER_URI=http://robot.local:11311
export ROS_HOSTNAME=robot.local

修改后保存,然后在source一次.bashrc就可以了。
然后再次启动roscore,成功

robot@robot:~$ roscore
... logging to /home/robot/.ros/log/a3782aa6-0575-11ec-b3b6-204ef6c5f181/roslaunch-robot-24896.log
Checking log directory for disk usage. This may take a while.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://robot.local:33981/
ros_comm version 1.14.11


SUMMARY
========

PARAMETERS
 * /rosdistro: melodic
 * /rosversion: 1.14.11

NODES

auto-starting new master
process[master]: started with pid [24915]
ROS_MASTER_URI=http://robot.local:11311/

setting /run_id to a3782aa6-0575-11ec-b3b6-204ef6c5f181
process[rosout-1]: started with pid [24928]
started core service [/rosout]
  • 7
    点赞
  • 42
    收藏
    觉得还不错? 一键收藏
  • 6
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 6
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值