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

rosjava network setup

asked 2015-08-17 20:22:19 -0500

smihael gravatar image

I'm running roscore on a remote computer.

I created a modified RosRunClass to manually set master URI.

    final String master = argv[argv.length - 1]; // http://10.159.1.24:11311
    nodeConfiguration.setMasterUri(new URI(master));

I've also overridden Advertise URI as follows:

    AdvertiseAddressFactory adress = new AdvertiseAddressFactory() {
        String _master = master;
        @Override
        public AdvertiseAddress newDefault() {
            String IPADDRESS_PATTERN = "(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)";
            Pattern pattern = Pattern.compile(IPADDRESS_PATTERN);
            Matcher matcher = pattern.matcher(_master);
            if (matcher.find()) _master = matcher.group();
            else _master = "localhost";
            return new AdvertiseAddress(_master);
        }
    };

    nodeConfiguration.setXmlRpcAdvertiseAddressFactory(adress);
    nodeConfiguration.setTcpRosAdvertiseAddressFactory(adress);

However I still get following exception when I try to register a new Publisher.

org.ros.exception.RosRuntimeException: java.net.URISyntaxException: Illegal character in authority at index 7: http://10.159.1.24 192.168.56.1:60076/

I have no idea where "192.168.56.1" comes from as this is NOT my internal (nor external) IP.

I'm using newest rosjava available in Ubuntu repositories (for ros indigo).

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2015-08-18 05:29:46 -0500

smihael gravatar image

I found out what my problem was. Despite $ROS_MASTER_IP being set correctly, $ROS_IP was not set in bash session from where I launched my node.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2015-08-17 20:22:19 -0500

Seen: 225 times

Last updated: Aug 17 '15