0
$\begingroup$

Rosanswers logo

I've got a new installation of ROS Indigo on OSX Yosemite. In a terminal when I enter: roscore I get the error message:

... 76, in is_local_address local_addresses = ['localhost'] + get_local_addresses() File "/opt/ros/indigo/lib/python2.7/site-packages/rosgraph/network.py", line 240, in get_local_addresses local_addrs = [host[4][0] for host in socket.getaddrinfo(socket.gethostname(), 0, socket.AF_INET, 0, socket.SOL_TCP)] gaierror: [Errno 8] nodename nor servname provided, or not known

printenv | grep ROS prints out:

ROS_ROOT=/opt/ros/indigo/share/ros
ROS_PACKAGE_PATH=/opt/ros/indigo/share:/opt/ros/indigo/stacks
ROS_MASTER_URI=http://localhost:11311
ROS_HOSTNAME=localhost
ROSLISP_PACKAGE_DIRECTORIES=
ROS_DISTRO=indigo
ROS_IP=0.0.0.0
ROS_ETC_DIR=/opt/ros/indigo/etc/ros

I have no /etc/hosts file. ping localhost works. I'm just trying to run ROS master and clients locally on my Mac. Thanks!


Originally posted by Fry on ROS Answers with karma: 126 on 2015-11-08

Post score: 0

$\endgroup$

2 Answers 2

0
$\begingroup$

Rosanswers logo

Your ROS_IP is 0.0.0.0, but I'm pretty sure that's not valid. Also you shouldn't have to set your ROS_HOSTNAME to anything by default. But neither of those cause the same problem on my mac.


Originally posted by William with karma: 17335 on 2015-11-08

This answer was ACCEPTED on the original site

Post score: 0

$\endgroup$
0
$\begingroup$

Rosanswers logo

William, thanks for you speedy reply. I took your suggestions and removed both ROS_IP and ROS_HOSTNAME from my .bashrc file to let them default. But that got me back to a previous error when entering roscore into a terminal, and my computer couldn't ping itself under its own name. So I added a line in /etc/hosts of 127.0.0.1 localhost macbook-pro-2.home and that did the trick. Now roscore works. The hard part is how to get at the /etc/hosts file on a mac. Apple makes this really difficult. One workaround is: http://www.tekrevue.com/tip/edit-hosts-file-mac-os-x/ One big victory for ROS answers!


Originally posted by Fry with karma: 126 on 2015-11-09

This answer was NOT ACCEPTED on the original site

Post score: 1

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.