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

ros android pubsub: Displaying Messages generated in ROS RQT Message Publisher/played of Rosbag - PublisherRunnable not working

asked 2014-08-08 06:02:54 -0500

stefan gravatar image

updated 2014-08-11 06:33:55 -0500

Hi,

has anyone of you ever tried to display a message genereated in RQT Message Publisher on your Android Device?

I managed to publish a message and to display this message.

But when i comment the code of my talker and have the message generated by RQT, i can see the TextView-Node in Node Graph, but there is no Text in my Android Device. I have the same problem when i am playing the messages from a rosbag.

Did someone display a message from a recorded rosbag?


Figured out, that the problem is that the Runnable in the subscriber cant register.

So inside the RosTextview

post(new Runnable() {
        @Override
        public void run() {
            //log.info("I heard: \"" + message.toString() + "\"");
            setText(callable.call(message));
        }

E/UpdatePublisherRunnable﹕ java.lang.RuntimeException: java.net.UnknownHostException: Unable to resolve host "Ubuntu-Test": No address associated with hostname

08-11 10:50:00.882    6403-6460/org.ros.android.android_tutorial_pubsub I/Registrar﹕ Response<Success, Subscribed to [/chatter], [http://Ubuntu-Test:41145/]>
08-11 10:50:00.897    6403-6498/org.ros.android.android_tutorial_pubsub I/DefaultPublisher﹕ Subscriber registered: Subscriber<Topic<TopicIdentifier</chatter>, TopicDescription<std_msgs/String, 992ce8a1687cec8c8bd883ec73ca41d1>>>
08-11 10:50:00.897    6403-6501/org.ros.android.android_tutorial_pubsub I/Registrar﹕ Response<Success, Subscribed to [/topic_lanes_available], [http://192.168.0.199:48304/]>
08-11 10:50:00.897    6403-6497/org.ros.android.android_tutorial_pubsub I/DefaultPublisher﹕ Subscriber registered: Subscriber<Topic<TopicIdentifier</topic_lanes_available>, TopicDescription<std_msgs/Int32, da5909fbe378aeaf85e547e830cc1bb7>>>
08-11 10:50:00.902    6403-6504/org.ros.android.android_tutorial_pubsub I/Registrar﹕ Response<Success, Subscribed to [/chatter], [http://Ubuntu-Test:41145/]>
08-11 10:50:00.902    6403-6426/org.ros.android.android_tutorial_pubsub I/DefaultPublisher﹕ Subscriber registered: Subscriber<Topic<TopicIdentifier</chatter>, TopicDescription<std_msgs/String, 992ce8a1687cec8c8bd883ec73ca41d1>>>
08-11 10:50:00.912    6403-6501/org.ros.android.android_tutorial_pubsub E/UpdatePublisherRunnable﹕ java.lang.RuntimeException: java.net.UnknownHostException: Unable to resolve host "Ubuntu-Test": No address associated with hostname
08-11 10:50:00.917    6403-6515/org.ros.android.android_tutorial_pubsub E/UpdatePublisherRunnable﹕java.lang.RuntimeException: java.net.UnknownHostException: Unable to resolve host "Ubuntu-Test": No address associated with hostname

i exported to 192.168.0.95:4711 and this is where the app is connecting


solved with help from gvdhoorn

export ROS_MASTER_URI=http://192.168.0.95:4711/

export ROS_IP=192.168.0.95

roscore -4711

connecting in the app to http://192.168.0.95

in a new window

doing same export

 rqt

publishing messages

Please clear out any cached data on the android device (app properties, clear all local data). Open new terminals on your desktop. Redo the steps. Your android device should not give you the same "unable to resolve" error if you're not using hostnames.
edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
1

answered 2014-08-11 04:12:19 -0500

gvdhoorn gravatar image

This looks like a networking issue:

Unable to resolve host "Ubuntu-Test": No address associated with hostname

Your android app is trying to resolve the hostname Ubuntu-Test and it fails.

Have you looked at the ROS network setup wiki page?

In your case, I think you need to at least export ROS_MASTER_URI=http://IP_OF_YOUR_MASTER:11311/. You probably also need to export ROS_IP=IP_OF_YOUR_MASTER. All on your desktop machine.

edit flag offensive delete link more

Comments

export ROS_MASTER_URI=http://IP_OF_YOUR_MASTER:11311/

this is what i did so far

i exported to 192.168.0.95:4711 and ran my roscore with roscrore -p 4711

i see all nodes on my pc and things are working fine, except for this problem

connection is via wlan

stefan gravatar image stefan  ( 2014-08-11 05:30:25 -0500 )edit

Try setting the ROS_IP env var as well.

gvdhoorn gravatar image gvdhoorn  ( 2014-08-11 05:37:39 -0500 )edit

i also tried ro export to http://Ubuntu-Test:11311/

same error

when i have the message generated by a talker in the app, i get the same warning in the log, but the textvie shows the string that is published by the talker

stefan gravatar image stefan  ( 2014-08-11 05:40:56 -0500 )edit

i am trying to connect a tablet device via wlan with my pc

IP PC 192.168.0.95

IP Tablet 192.168.0.199

stefan gravatar image stefan  ( 2014-08-11 05:51:52 -0500 )edit

Read the ROS networking wiki page: you need to work around the fact that Ubuntu-Test doesn't resolve to an IP. You can either setup a local DNS server, or export ROS_IP=IP_OF_YOUR_MASTER_PC before starting your master. If you've setup your ROS_MASTER_URI correctly, things should then work.

gvdhoorn gravatar image gvdhoorn  ( 2014-08-11 05:58:11 -0500 )edit

export ROS_MASTER_URI=http://192.168.0.95:4711/

export ROS_IP=192.168.0.95

roscore -4711

connecting in the app to http://192.168.0.95

in a new window

doing same export

rqt

publishing messages

still same error

stefan gravatar image stefan  ( 2014-08-11 06:02:52 -0500 )edit

Please clear out any cached data on the android device (app properties, clear all local data). Open new terminals on your desktop. Redo the steps. Your android device should not give you the same "unable to resolve" error if you're not using hostnames.

gvdhoorn gravatar image gvdhoorn  ( 2014-08-11 06:12:16 -0500 )edit

wooohoooo :) thank you very much

the thing with ROS_IP and clearing all data was the trick

stefan gravatar image stefan  ( 2014-08-11 06:28:25 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2014-08-08 06:02:54 -0500

Seen: 1,848 times

Last updated: Aug 11 '14