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

roscore fails to start

asked 2015-01-18 15:58:22 -0500

updated 2015-03-12 09:50:19 -0500

I have just recently moved. My project worked before, but I cannot even run roscore now. This is the error I have received. Does anyone know a fix?

ecejames01@ECE521:~$ roscore
... logging to /home/ecejames01/.ros/log/314256dc-9f5b-11e4-96a8-000a9de008e4/roslaunch-ECE521-2982.log
Checkingt 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://ECE521:43402/}.
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 ece521

For more tips, please see

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

ping ece521 gives me: ping: unknown host ece521

Any help would be much appreciated. Thanks.


EDIT:

In a new terminal window, here are the results from commands:

ecejames01@ECE521:~$ hostname
ECE521
ecejames01@ECE521:~$ echo $ROS_HOSTNAME

ecejames01@ECE521:~$ echo $ROS_IP
68.55.84.72
ecejames01@ECE521:~$ echo $ROS_MASTER_URI
http://localhost:11311

Running ifconfig eth0 gives me inet addr: 10.0.0.9. My localhost is 127.0.0.1.

Forcing ROS using these methods allows roscore to run:

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

export ROS_IP=MY_IP_ADDRESS
export ROS_MASTER_URI=http://$ROS_IP:11311
roscore

Thanks gvdhoorn for all your help.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
4

answered 2015-01-19 02:31:06 -0500

gvdhoorn gravatar image

updated 2015-01-20 11:17:41 -0500

ping ece521 gives me: ping: unknown host ece521

Make sure your current hostname is actually ece521. If it isn't (which your ping output seems to suggest), make sure you aren't forcing ROS to set ROS_MASTER_URI (or ROS_HOSTNAME) to include that incorrect name (check your .bashrc).

My project worked before, but I cannot even run roscore now.

The ROS middleware needs a properly working network. If that is not available, roscore can't start.


Edit: before trying more complicated things, first try to force ROS to use bare IPs, instead of hostnames. In a fresh terminal:

export ROS_IP=YOUR_IP_ADDRESS
export ROS_MASTER_URI=http://$ROS_IP:11311/

Then try to start just roscore in that same terminal.

You can retrieve your IP either through the Network Manager, or by simply running ifconfig eth0 (provided you are using your (first) wired NIC).

edit flag offensive delete link more

Comments

This is what I got:

ecejames01@ECE521:~$ hostname
ECE521
ecejames01@ECE521:~$ hostname -i
hostname: Name or service not known
ecejames01@ECE521:~$ hostname -y
hostname: Local domain name not set

I checked .bashrc and didn't see anything changing the ROS_MASTER_URI/HOSTNAME.

sealguy77 gravatar image sealguy77  ( 2015-01-19 10:07:55 -0500 )edit

afaik, hostname will return whatever is configured locally. You might want to make sure your local hostname/dns/network configuration is consistent with what your network admin has configured for you in the DNS & DHCP. If ece521 does not resolve to an IP, you will get problems.

gvdhoorn gravatar image gvdhoorn  ( 2015-01-20 01:39:27 -0500 )edit

I am relatively new to this beast called Linux, so I probably need a walk-through, if you don't mind, since my Google search hasn't helped me much. I am on my home router.

Any help is appreciated. Thanks.

sealguy77 gravatar image sealguy77  ( 2015-01-20 10:56:15 -0500 )edit

Both of these worked:

export ROS_HOSTNAME=localhost
echo $ROS_MASTER_URI
http://localhost:11311
roscore

and

export ROS_IP=MY_IP_ADDRESS
export ROS_MASTER_URI=http://$ROS_IP:11311/
roscore

However, I have to run both sets of commands for each new terminal window. Thanks

sealguy77 gravatar image sealguy77  ( 2015-01-27 10:40:04 -0500 )edit

So that would seem to be a DNS issue then. Note that setting $ROS_HOSTNAME to localhost will prevent multi-pc setups to work properly.

However, I have to run both sets of commands for each new terminal window

You could add the two export statements to your ~/.bashrc.

gvdhoorn gravatar image gvdhoorn  ( 2015-01-27 11:02:46 -0500 )edit

Is there any way to correct the DNS issue?

sealguy77 gravatar image sealguy77  ( 2015-01-27 11:27:58 -0500 )edit

Also, something I have noticed since moving is that something is unusual with using sudo...for example:

ecejames01@ECE521:~$ sudo echo hello_world
sudo: unable to resolve host ECE521
[sudo] password for ecejames01: 
hello_world
ecejames01@ECE521:~$
sealguy77 gravatar image sealguy77  ( 2015-01-27 11:40:26 -0500 )edit

I would systematically check your hostname/dns setup on your local machine as well as on any routers/home gateways/what-have-you. Also check /etc/resolve.conf, NetworkManager, /etc/hosts etc. If all else fails it might pay to do a sudo grep -i ece521 -r / and see what comes up.

gvdhoorn gravatar image gvdhoorn  ( 2015-01-27 11:51:58 -0500 )edit

Question Tools

2 followers

Stats

Asked: 2015-01-18 15:58:22 -0500

Seen: 20,852 times

Last updated: Mar 12 '15