ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
1

can´t run roscore - unable to contact my own server

asked 2018-08-24 09:24:06 -0600

firuze gravatar image

updated 2018-08-24 09:27:29 -0600

Hello, I am pretty new at ROS and I have to work on Odroid for my project. ROS is installed on my Odroid and it was working sort of fine until I wanted to create SSH connection with the computer. I want to attach the odroid on a robot and run the command from my computer.

But at the moment, even while the Odroid is not attached to the robot, I can´t run roscore on it. It gives me the following error:

Unable to contact my own server at [http://192.168.1.105:44827/]
This usually means that the network is not configured properly.
A common cause is that th machine cannot ping itself. Please check for errors by running:
ping 192.168.1.105

On my odriod when I type hostname -I to learn the IP it gives me:

192.168.1.225

when I check the bashrc file on odroid it says

export ROS_MASTER_URI=http://192.168.1.105:11311
export ROS_HOSTNAME=192.168.1.105

Meanwhile on my main computer that I want to give the command, the result for hostname -I

10.1.214.229

The bashrc file:

export ROS_MASTER_URI=http://192.168.1.105:11311/
export ROS_HOSTNAME=192.168.1.21

I want to find solution firstly why I can not run roscore on my odroid and then where do i do wrong with my IP setting?

Thank you for your answers in advance!

edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted
1

answered 2018-08-24 09:28:25 -0600

gvdhoorn gravatar image

updated 2018-08-24 09:34:10 -0600

192.168.1.105 is not the IP of your Odroid (any more).

It could have been earlier, but according to your hostname -I output, it is now 192.168.1.225.

You're setting ROS_HOSTNAME=192.168.1.105, which makes roscore try and use that to connect to "its own server". This will obviously fail.

Try to set ROS_HOSTNAME to 192.168.1.225. Save .bashrc, open a new terminal and try again.

Note: using ROS_HOSTNAME like this is actually why things are failing for you. You can avoid this by configuring a static IP for your Odroid (either locally on the device itself, or by making a DHCP "reservation" in your router).

The better alternative would be to make sure you have a working DNS on your network.

That would allow you to use hostnames instead of IP addresses. The IP addresses can then change, but the hostnames stay the same.

A middleground could be to use /etc/hosts: you configure the mapping IP<->hostname there manually. You'd still be responsible for keeping that file up-to-date though.

A third alternative could be to use Avahi to do name resolution for you. See wiki/ROS/NetworkSetup: Name resolution - Using machinename.local on the ROS wiki for some more info on that.

And make sure to check the wiki/ROS/NetworkSetup page for more general info about how to configure your network correctly.

edit flag offensive delete link more

Comments

1

Edit: I should have closed this as a duplicate. There are quite a few older questions about this. Using Google I get these results fi.

gvdhoorn gravatar image gvdhoorn  ( 2018-08-24 09:36:32 -0600 )edit

I checked similar questions but couldn´t solve my problem from given answers.. thank you for not closing it

firuze gravatar image firuze  ( 2018-08-24 11:02:50 -0600 )edit
0

answered 2018-08-24 09:45:26 -0600

tuandl gravatar image
  1. It seems that your ordoid expects a $ROS_MASTER_URI=http://192.168.1.105:11311 which doesn't exist. Do a ifconfig and see what is a current IP for you ordroid. Use that IP address to set the value of $ROS_MASTER_URI and $ROS_IP and $ROS_HOSTNAME for you ordroid.
  2. On the remote computer, e.g you laptop, set $ROS_MASTER_URI to the IP address of the ordroid. The IP address of $ROS_HOSTNAME and $ROS_IP on your LAPTOP should be DIFFERENT than the IP address of the ordroid.
  3. When done, first try to ping your ordroid, then open an ssh connection to your ordroid and run roscore. On your laptop, when you run rostopic list, you should see /rosout.
edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2018-08-24 09:24:06 -0600

Seen: 11,103 times

Last updated: Aug 24 '18