public static NodeConfiguration createNodeConfiguration(URI master) { InetAddress listenAddress = getMyIP(master); NodeConfiguration nodeConfiguration = NodeConfiguration.newPublic(listenAddress.getHostAddress(), master); nodeConfiguration.setMasterUri(master); return nodeConfiguration; }
/** * Creates a new {@link NodeConfiguration} for a publicly accessible {@link Node}. * * @param host the host that the {@link Node} will run on * @param masterUri the {@link URI} for the master that the {@link Node} will register with * @return a new {@link NodeConfiguration} for a publicly accessible {@link Node} */ public static NodeConfiguration newPublic(String host, URI masterUri) { NodeConfiguration configuration = new NodeConfiguration(); configuration.setXmlRpcBindAddress(BindAddress.newPublic()); configuration.setXmlRpcAdvertiseAddressFactory(new PublicAdvertiseAddressFactory(host)); configuration.setTcpRosBindAddress(BindAddress.newPublic()); configuration.setTcpRosAdvertiseAddressFactory(new PublicAdvertiseAddressFactory(host)); configuration.setMasterUri(masterUri); return configuration; }
/** * Creates a new {@link NodeConfiguration} for a {@link Node} that is only accessible on the local * host. * * @param masterUri the {@link URI} for the master that the {@link Node} will register with * @return a new {@link NodeConfiguration} for a private {@link Node} */ public static NodeConfiguration newPrivate(URI masterUri) { NodeConfiguration configuration = new NodeConfiguration(); configuration.setXmlRpcBindAddress(BindAddress.newPrivate()); configuration.setXmlRpcAdvertiseAddressFactory(new PrivateAdvertiseAddressFactory()); configuration.setTcpRosBindAddress(BindAddress.newPrivate()); configuration.setTcpRosAdvertiseAddressFactory(new PrivateAdvertiseAddressFactory()); configuration.setMasterUri(masterUri); return configuration; }
@Override protected void init(NodeMainExecutor nodeMainExecutor) { // talker = new Talker("TALKING"); NodeConfiguration nodeConfiguration = NodeConfiguration.newPublic(InetAddressFactory.newNonLoopback().getHostAddress()); // At this point, the user has already been prompted to either enter the URI // of a master to use or to start a master locally. nodeConfiguration.setMasterUri(getMasterUri()); // nodeMainExecutor.execute(talker, nodeConfiguration); // The RosTextView is also a NodeMain that must be executed in order to // start displaying incoming messages. nodeMainExecutor.execute(rosTextView, nodeConfiguration); }