ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Talker issue on Android pubsub tutorial

asked 2011-12-01 04:14:34 -0600

Imré gravatar image

Hello,

I have installed the pubsub android tutorial on an android device and have it connect to an external roscore in order to have a talker/listener system between the android device and the computer where roscore runs.

When a Talker on the computer publishes data on the "chatter" ros topic, this data is seen on the android device in the rosTextView node.

However, when a Talker on the android device publishes data on the "chatter" ros topic, this data is seen in the rosTextView node of the android device but it dos not appear using "rostopic echo /chatter" on the computer. However, the data published by the talker should be seen on the computer also.

Would you know how to fix this?

I thank you in advance.

Imré

P.S. Here is the main source code of the application if it can be of any help: https://code.google.com/p/rosjava/source/browse/android_tutorial_pubsub/src/org/ros/android/tutorial/pubsub/MainActivity.java?spec=svn.android.10e4ad9b5746bead9376295165247bec770bdbc2&repo=android&name=10e4ad9b57&r=10e4ad9b5746bead9376295165247bec770bdbc2

edit retag flag offensive close merge delete

6 Answers

Sort by » oldest newest most voted
2

answered 2011-12-04 16:42:47 -0600

damonkohler gravatar image

Line 76 of the example says:

NodeConfiguration nodeConfiguration = NodeConfiguration.newPrivate();

That node can only make use of the loopback interface. Try:

NodeConfiguration nodeConfiguration = NodeConfiguration.newPublic(InetAddressFactory.newNonLoopback().getHostAddress().toString(), masterUri);
edit flag offensive delete link more

Comments

With that I am able to see the "Hello world! #" but I am unable to see results for rostopic echo /chatter . May I ask why is that happening?

Elvish Champion gravatar image Elvish Champion  ( 2014-04-19 22:22:31 -0600 )edit

has anyone of you tried to change the thext in talker.java? What do i have to do to see that changes in the android app? e.g. changing "hello world" to "changed text"

stefan gravatar image stefan  ( 2014-08-05 06:23:51 -0600 )edit
0

answered 2011-12-06 05:14:07 -0600

Imré gravatar image

Thank you very much for your answer; it solved the issue.

I changed "NodeConfiguration nodeConfiguration = NodeConfiguration.newPrivate();"

to "NodeConfiguration nodeConfiguration = NodeConfiguration.newPublic(InetAddressFactory.newNonLoopback().getHostAddress().toString());"

I had to keep setting the masterUri seperately otherwise the app would crash on startup.

edit flag offensive delete link more
0

answered 2011-12-23 11:58:26 -0600

rimzahir gravatar image

Greetings Imré,

I have the same issue you had and I was wondering about how you did to set up the masterURI separately. Could you tell me how?

Thank you for your help

edit flag offensive delete link more
0

answered 2013-02-20 17:03:49 -0600

Thank you for the solution, it really helped. In my case, I changed "NodeConfiguration nodeConfiguration = NodeConfiguration.newPrivate();" to "NodeConfiguration nodeConfiguration = NodeConfiguration.newPublic(InetAddressFactory.newNonLoopback().getHostAddress().toString(), getMasterUri());"

and also add import org.ros.address.InetAddressFactory;

edit flag offensive delete link more
0

answered 2018-02-26 00:56:52 -0600

when you download any tutorial and open on your Android device whenever your tutorial not open on your phone because the need of the tutorial not fulfill, this is the main reason for the device. you can fulfill the desires requirement of the tutorial and then you can open this tutorial.if you want to extra knowledge so you can click on the opera customer service.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2011-12-01 04:14:34 -0600

Seen: 5,537 times

Last updated: Feb 20 '13