Correct ROS_MASTER_URI format for IPV6?

asked 2017-08-20 19:23:33 -0500

rmck gravatar image

updated 2017-08-21 18:03:51 -0500

According to an answer to a previous question, IPV6 networking has been integrated into the core ROS networking stack. I'm using Kinetic on Ubuntu 16 on PC and Kinetic on Ubuntu Mate 16 on a Raspberry Pi.

When I try to use an IPV6 address for my master URI it fails to work. What would be the correct format for the IPV6 address? I've tried with a conventional IPV4 network and been able to communicate between my two devices but when I switch to my IPV6 adhoc network I have no success.

As far as I can tell my adhoc network is working as expected. For example, I can SSH into my Raspberry Pi using ssh pi@IPV6address%wlan0, does %wlan0 need to be included in the master URI somehow?

At present I have tried the following:

ROS_MASTER_URI=http://[xxxx::xxxx:xxxx:xxxx:xxxx]:11311
ROS_MASTER_URI=http://xxxx::xxxx:xxxx:xxxx:xxxx:11311
ROS_MASTER_URI=http://[xxxx::xxxx:xxxx:xxxx:xxxx]%wlan0:11311
ROS_MASTER_URI=http://[xxxx::xxxx:xxxx:xxxx:xxxx%wlan0]:11311

When I run rostopic list I get the following result:

    Traceback (most recent call last):
  File "/opt/ros/kinetic/bin/rostopic", line 35, in <module>
    rostopic.rostopicmain()
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/rostopic/__init__.py", line 2101, in rostopicmain
    _rostopic_cmd_list(argv)
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/rostopic/__init__.py", line 2041, in _rostopic_cmd_list
    exitval = _rostopic_list(topic, verbose=options.verbose, subscribers_only=options.subscribers, publishers_only=options.publishers, group_by_host=options.hostname) or 0
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/rostopic/__init__.py", line 1197, in _rostopic_list
    master = rosgraph.Master('/rostopic')
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/rosgraph/masterapi.py", line 100, in __init__
    self._reinit(master_uri)
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/rosgraph/masterapi.py", line 118, in _reinit
    raise ValueError("invalid master URI: %s"%(master_uri))
ValueError: invalid master URI:http://[xxxx::xxxx:xxxx:xxxx:xxxx]%wlan0:11311

Any suggestions appreciated! Thanks

This PR looks related, https://github.com/ros/ros_comm/issue...

Edit:

I should note that I can ping both ways using the using the following commands

On the PC: ping6 raspberryPiIPV6%wlan0

On the Pi ping6 PCIPV6%wlan0

roswtf outputs the following on the PC:

    Loaded plugin tf.tfwtf
No package or stack in context
Traceback (most recent call last):
  File "/opt/ros/kinetic/bin/roswtf", line 35, in <module>
    roswtf.roswtf_main()
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/roswtf/__init__.py", line 89, in roswtf_main
    _roswtf_main()
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/roswtf/__init__.py", line 172, in _roswtf_main
    wtf_check_environment(ctx)
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/roswtf/environment.py", line 219, in wtf_check_environment
    error_rule(r, r[0](ctx), ctx)
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/roswtf/rules.py", line 100, in error_rule
    _check_rule(rule, ret, ctx, ctx.errors, WtfError)
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/roswtf/rules.py", line 71, in _check_rule
    ctx_list.append(level(f_msg%d + ret%d, f_msg, ret))
ValueError: unsupported format character ...
(more)
edit retag flag offensive close merge delete

Comments

I did a little testing, and I believe this is a bug. I suggest you report it on the issue tracker for ros_comm.

Ed Venator gravatar imageEd Venator ( 2017-08-20 22:48:26 -0500 )edit

Thanks! I've raised an issue

rmck gravatar imagermck ( 2017-08-20 23:15:07 -0500 )edit

I haven't solved this problem but worked around it by creating an additional wlan0 interface on the Raspberry Pi that uses avahi-autoipd to automatically assign itself an IPv4 address for link-local usage

rmck gravatar imagermck ( 2017-08-22 19:07:32 -0500 )edit

For anyone else in the rare situation of using an ad-hoc network for this, here's the extra interface I added to /etc/network/interfaces;

auto wlan0:0
iface wlan0:0 inet manual
  up avahi-autoipd -D --force-bind wlan0:0
  down avahi-autoipd -k wlan0:0
rmck gravatar imagermck ( 2017-08-22 19:08:42 -0500 )edit