Why am I unable to use "rosinit" on a machine with a purely numeric name in MATLAB R2020a?

8 views (last 30 days)
I am working on an Ubuntu 16.04 machine. The machine has a purely numeric hostname, for example: 707406378. If I try to use "rosinit" on this machine in MATLAB R2020a, this throws a warning and error and fails to complete successfully:
Warning: The IP address 42.42.42.42 in the "NodeHost" setting is not associated with any network interface.
It is possible that MATLAB cannot be reached by other ROS nodes.
> In ros.internal/Net/generateNodeHost (line 368)
In ros/Node/parseArguments (line 313)
In rosinit (line 92) The ROS master is already running on port 11311. Try connecting to this master or creating a new ROS master
that uses a different port.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 15 Apr 2021
Edited: MathWorks Support Team on 15 Apr 2021
The problem here is that your hostname is in fact interpreted as IP-address by MATLAB. Actually, not only MATLAB will do this, ROS itself (used outside of MATLAB) would have the same behavior and other tools on the system can have issues with this as well. In that sense to resolve the issue and to prevent any further issues going forwards (not only with MATLAB) we would recommend you actually change the hostname of your machine to something which cannot accidentally be interpreted as IP-address.
Some further background on IPv4 addresses
IP4v addresses in the basis are simply 32-bit values, for example:
00101010001010100010101000101010
and it is then just for readability that these values are grouped in four 8-bit values:
00101010 00101010 00101010 00101010
of which the 8-bit unsigned integer decimal values are taken:
42 42 42 42
which are then concatenated into the familiar format which everyone is used to working with: 42.42.42.42.
You can however also just take the whole 32-bit integer value and directly translate it into its 32-bit unsigned integer decimal value, in this example: 707406378. And you can in fact use that value in places to refer to that exact same IP-address.

More Answers (0)

Categories

Find more on Publishers and Subscribers in Help Center and File Exchange

Tags

No tags entered yet.

Products


Release

R2020a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!