Closed Timple closed 5 years ago
The last point (export ROS_HOSTNAME=`hostname`.local
) looks to me like a hack so you don't have to change a lot of code.
You realize we now do:
export ROS_IP=`hostname -I | sed 's/.*\(192\.168\.44\.[0-9]\+\).*/\1/'`
Talking about hacks :P
But seriously, why does setting the ROS_HOSTNAME look like a hack? You are simply telling the other ROS nodes on other PCs that this is the address where you can be found.
Yeah that's true, its way better then what we had before
Proposal Get rid of all the fixed ip's on dev-pcs etc and switch to local address resolving.
Examples
ping amigo1.local
ssh amigo@amigo2.local
export ROS_MASTER_URI=http://amigo1.local:11311
Rationale The custom /etc/hosts files are a hassle to maintain. Also every tournament our subnet changes which makes everything difficult.
How does it work If an avahi client and deamon is installed on every PC (simple apt-gettie) then every PC acts as a DNS resolver for only it's own hostname.local. So a ping amigo1.local results in the user PC broadcasting the question who amigo1.local is. ONLY amigo1 responds with the answer: I am here with this IP. Then the action ping starts. If a computer has multiple IP addresses this still works
Pros
Cons
Why now
Todo
export ROS_HOSTNAME=`hostname`.local
either always or when running amigo-coreNB: Of course for amigo you can read Sergio / HSR / Pico / Pepper / Whatever we buy next