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

How to find my localhost IP address when I follow Turtlebot3 instruction.

asked 2018-03-16 21:52:07 -0500

Pujie gravatar image

updated 2018-03-17 01:55:36 -0500

gvdhoorn gravatar image

I try to follow Turtlebot3 instruction. I can not find my IP address which is mentioned in 6.4 Network Configuration. http://emanual.robotis.com/docs/en/pl... . When I check my IP address, I can not find them.

enp0s31f6 Link encap:Ethernet  HWaddr 50:9a:4c:31:19:40  
          inet addr:172.16.51.164  Bcast:172.16.51.255  Mask:255.255.255.0
          inet6 addr: fe80::9df1:70a0:ebd3:f7b6/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:44832 errors:0 dropped:0 overruns:0 frame:0
          TX packets:15524 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:20692421 (20.6 MB)  TX bytes:2117659 (2.1 MB)
          Interrupt:20 Memory:f7180000-f71a0000 

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:5715 errors:0 dropped:0 overruns:0 frame:0
          TX packets:5715 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:707160 (707.1 KB)  TX bytes:707160 (707.1 KB)

Which one is my IP address? It seems that there lacks one part of Network information when compared to the introduction.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2018-03-17 02:08:11 -0500

gvdhoorn gravatar image

updated 2018-03-17 02:10:20 -0500

note: the page you link uses ROS_HOSTNAME with IPs, which is (technically and officially) not correct. I'm using ROS_IP in my answer, but if you must, just use ROS_HOSTNAME everywhere I've used ROS_IP.


localhost (wikipedia) is a special hostname, and the lo entry in the output you post would be a virtual network interface. As to it's IP, that is shown on the second line:

inet addr:127.0.0.1  Mask:255.0.0.0

However, that is not the IP address you want to use for setting ROS_IP, as every host in your network uses it to communicate with itself. That won't help if you're trying to get two PCs to communicate using ROS, as they won't be able to find each other.

The text in the manual is a little confusing (and I would report that to Robotis), but the diagram shown at the top explains quite well what is needed to set this up: ROS_IP must be set to the IP address of each host respectivel, and ROS_MASTER_URI must point to the IP address of the host running the ROS master (ie: roscore).

If the ifconfig output you included in your question is from your "Remote PC", then ROS_IP would have to be set to 172.16.51.164, and ROS_MASTER_URI would be http://172.16.51.164:11311.

On your turtlebot, you'd use the same ROS_MASTER_URI, but set ROS_IP to the IP address of the turtlebot.

It seems that there lacks one part of Network information when compared to the introduction

Note: the names enp3s0 and wlp2s0 entries in the ifconfig output in the manual are just examples. Each network interface gets its own name, and they may be differently named on your system.

edit flag offensive delete link more

Comments

I would also like to add that your question is technically not a ROS question, but a system configuration one. ROS_HOSTNAME, ROS_IP and ROS_MASTER_URI are obviously ROS environment variables, but finding their values is not.

gvdhoorn gravatar image gvdhoorn  ( 2018-03-17 02:11:33 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2018-03-16 21:52:07 -0500

Seen: 3,109 times

Last updated: Mar 17 '18