0
$\begingroup$

Rosanswers logo

Hello eveyone!

We installed rosjava and we want to publish and subscribe messages between a PC and an android-phone.

  • roscore is running on the PC
  • there is a publisher and a subscriber on the phone and/or pc
  • ROS_MASTER_URI is set on the phone to the PC's IP

This works:

  • subscribe messages on the phone, which were published on the phone
  • subscribe messages on the phone, which were published on the PC
  • subscribe messages on the PC, which were published on the PC

This does not work:

  • subscribe messages on the PC, which were published on the phone

Our guess: We think that the phone sends a wrong name ("127.0.0.1") of itself to the core:

  • rxgraph shows for the phone-publisher: "ERROR: Communication with node[http://127.0.0.1:55124] failed!
  • rxgraph shows for the phone-subscriber: "ERROR: Communication with node[http://127.0.0.1:40919] failed!

-> We already tried to change the phone's name via setprop net.hostname (which changes net.hostname, but does not change the situation at all) -> We tried to define the name in the phones /etc/hosts file; with no result

What are we doing wrong?


Originally posted by gimili on ROS Answers with karma: 3 on 2011-10-27

Post score: 0

$\endgroup$

2 Answers 2

0
$\begingroup$

Rosanswers logo

This is probably not your answer but is similiar in that sometimes communication will fail if you're not tethering with USB because of the line

NodeConfiguration.newPublic(InetAddressFactory.newNonLoopback().getHostName());

You need to change it to get an IP address, not a host name. Otherwise, external devices will have a difficult time resolving the Android hostname if the Android device is not doing the DNS lookups for it.


Originally posted by Chad Rockey with karma: 4541 on 2011-10-27

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by gimili on 2011-10-27:
Thank you; this works! We were so blinded by getting the IP responding to the hostname and dns settings that we did not see the "newPrivate" in our code we used from the pubsubtutorial, where everything runs on the phone!

$\endgroup$
0
$\begingroup$

Rosanswers logo

Use a NonLoopback server address when you create one. You could use something like

Roscore _core = RosCore.newPublic(11411);

Originally posted by ICodeRaven with karma: 76 on 2011-10-27

This answer was NOT ACCEPTED on the original site

Post score: 1

$\endgroup$

Your Answer

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