0
$\begingroup$

Rosanswers logo

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).


Originally posted by smihael on ROS Answers with karma: 45 on 2015-08-17

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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.


Originally posted by smihael with karma: 45 on 2015-08-18

This answer was ACCEPTED on the original site

Post score: 0

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.