Hostnames and ROS

less than 1 minute read

I figured out why I couldn’t remotely connect ROS to Abby. roswtf showed that the hostname abby-pc was invalid (because the router’s DNS wasn’t properly serving hostnames). There are two ways around this. The first way is to edit the /etc/hosts on every computer you intend to connect to the robot and add a line:

192.168.0.150 abby-pc

Obviously, that’s a pain because you have to do it on many machines. Instead, I added a line to abby’s bashrc:

export ROS_HOSTNAME=192.168.0.150

This fixes the problem by using the IP as the hostname.

 

Addendum: Eric recommends the use of ROS_IP for setting IPs over storing an IP in ROS_HOSTNAME. Not sure why I didn’t think of that…

Categories:

Updated: