# Revision history [back]

You can use the old way they used to do things. I was also in the situation where I absolutely could not use RosActivity (since I was already extending).

The method I currently use is:

nodeConfiguration = NodeConfiguration

String hostMaster = prefs.getString("ros_IP", "");
Integer port = Integer.parseInt(prefs.getString("ros_port",
""));
URI uri = URI.create("http://" + hostMaster + ":" + port);
nodeConfiguration.setMasterUri(uri);

nodeMainExecutor = DefaultNodeMainExecutor.newDefault();
nodeMainExecutor.execute(vehSub, nodeConfiguration);


You can use the old way they used to do things. I was also in the situation where I absolutely could not use RosActivity (since I was already extending). I dug in to their ROSActivity and a few of their tutorials to find the below. Hope it helps.

The method I currently use is:

nodeConfiguration = NodeConfiguration

String hostMaster = prefs.getString("ros_IP", "");
Integer port = Integer.parseInt(prefs.getString("ros_port",
""));
URI uri = URI.create("http://" + hostMaster + ":" + port);
nodeConfiguration.setMasterUri(uri);

nodeMainExecutor = DefaultNodeMainExecutor.newDefault();
nodeMainExecutor.execute(vehSub, nodeMainExecutor.execute(<NAMEOFNODECLASS>, nodeConfiguration);


I am using a preference menu to hold the hostMaster IP and port, but you can change those directly.

I have been working with ROSJava a lot lately and have been looking for some people who may be more involved in it to hit questions back and forth. I hope this helps you.