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

How can I publish messages from pc to android phone (android_tutorial_pubsub)

asked 2012-04-06 11:59:33 -0500

alexbeta20 gravatar image

updated 2014-01-28 17:11:53 -0500

ngrennan gravatar image

I have modified the android_tutorial_pubsub using the Lorenz's patch (http://ias.in.tum.de/~moesenle/android_tutorial_pubsub.patch). I connect the pc and phone to the same router and set the masterURI to the ip of the pc which is http://192.168.0.2:11311/. Then I start to see the familiar "Hello world! n". On pc, I can see the android node and the talker using $rosnode list, like: /android_gingerbread/ros_text_view /rosjava_tutorial_pubsub/talker /rosout. However, in the rxgraph mode, the 3 nodes are not connected to each other. Why? Then, I tried to publish a message using $rostopic pub /chatter std_msgs/String -r 1 "abc". But the Textview in the phone didn't show any message like "abc" but still "Hello world!n". The rxgraph show the 4 nodes separately (not connected to each other). I got really confused. Can anybody help me on this? I am new to the Rosjava, and any help will really be appreciated. Thank you.

edit retag flag offensive close merge delete

Comments

when I tick on the ALL Topics option on the rxgraph. The 4 nodes are connected correctly. But the Text view is still not showing the "abc". This is really difficult to understand for me. Anyone can help me??

alexbeta20 gravatar image alexbeta20  ( 2012-04-06 14:00:44 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2012-04-06 15:46:11 -0500

jbohren gravatar image

updated 2012-04-06 15:47:25 -0500

You probably just need to define ROS_IP in the environment you're running the publisher:

$> export ROS_IP=192.168.0.2

Without it set I saw a similar behavior, and things weren't connected.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2012-04-06 11:59:33 -0500

Seen: 483 times

Last updated: Apr 06 '12