Hi! I am figuring out the mechanism in the roscpp package, and I found there's codes in the function determineHost() in network.cpp:
#ifdef HAVE_IFADDRS_H
...
#endif
There's a comment : fall back on interface search, which will yield an IP address
But I don't know what does it mean~
Can someone give me a brief explanation?
Thanks in advance, Ricky.
The HAVE_IFADDRS_H symbol is defined by the ros build system if your system has the ifaddrs.h header; you should never have to define it yourself.
It looks like that particular chunk of code is trying to find an outward-facing IP address to use to identify the computer it's running on.
If you want more information about it, I suggest reading the man page for getifaddrs.
Asked: 2012-01-01 05:37:28 -0500
Seen: 104 times
Last updated: Jan 01 '12
Subscriber and Publisher node at once in cpp
how does second term of advertise
How do I test the ROS version in C++ code?
Getting all parameter names using C++
Are there any other signal interrupts with roscpp besides the default ctrl+c sigint handler
Is it possible to avoid busy-waiting in a spinner?
Can I "overload" topic names in ROS? (Different versions by datatype)
ROS Answers is licensed under Creative Commons Attribution 3.0 Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.