Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

I don't know if this helps, but we run our roscore on a separate machine on the network. The issue was that nodes generated were trying to refer to localhost, which is obviously not defined for an external node trying to connect to the roscore.

To accomplish this, in the main activity class file edit the following code

rosCore = RosCore.createPublic(11311); nodeConfiguration.setMasterUri(rosCore.getUri());

to be

rosCore = RosCore.createPublic("* . * . * . * ",11311); nodeConfiguration.setMasterUri(new URI("http://*.edu:11311"));

where * . * . * . * is the IP address of the android device on the network (e.g. WiFi?). This can be replaced by a request for the current IP, eliminating the need for a static IP address. Instead of a static IP address you could also use InetAddressFactory.createNonLoopback().getHostAddress() to generate a non loopback address, which does a better job.

What the first line does is that it assigns the nodes to run on the local Android IP address which can be resolved by a rostopic command running on the network rather than the default localhost which cannot be resolved by an external rostopic, giving XML-RPC errors in the process.

Hope that helps someone.