0
$\begingroup$

Rosanswers logo

Hey Dear ROS Community, I'm currently building a custom App to control my robot. Therefore I'm testing the PubSub tutorial provided by the android_core package: https://github.com/rosjava/android_core

Now if I connect my Android device to the ROS Master running on my PC and listen to the /chatter topic on my PC I receive the incoming "Hello World" messages sent by the talker node on my android device. However, if I publish a String message on my PC to the same topic it gets only displayed on the terminal running "rostopic echo /chatter" while the RosTextView on the android device only displays the messages published by the talker node but not what is published by my PC.

Running "~ rostopic info /chatter" delivers

Type: std_msgs/String 

Publishers:  
* /rosjava_tutorial_pubsub/talker (http://192.168.1.102:57888/) 

Subscribers:  
* /android_gingerbread/ros_text_view (http://192.168.1.102:45315/)

Running ~ rosnode ping /android_gingerbread/ros_text_view  delivers

rosnode: node is [/android_gingerbread/ros_text_view] 
pinging /android_gingerbread/ros_text_view with a timeout of 3.0s 
xmlrpc reply from http://192.168.1.102:45315/   time=358.101130ms 
xmlrpc reply from http://192.168.1.102:45315/   time=124.948978ms 
xmlrpc reply from http://192.168.1.102:45315/   time=329.936981ms 

So everything seems to be setup fine however the the RosTextView node doesn't react to messages published by my PC. It seems like a network issue.

Related posts suggested to create a publicly accessible nodeConfiguration via

NodeConfiguration nodeConfiguration = NodeConfiguration.newPublic(InetAddressFactory.newNonLoopback().getHostAddress().toString(), masterUri);

which is already the case in the current pubsub tutorial.

Does somebody of you know how to fix this problem?

Thanks in advance!


Originally posted by aurora18 on ROS Answers with karma: 1 on 2017-10-20

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

I'm not sure, but try setting ROS_IP=ip.of.your.pc on your PC as an environment variable. It might be that the Android device is trying to resolve the hostname of your PC and is failing, hence cannot make a connection to the PC.

But it's just a guess/stab in the dark.


Originally posted by gvdhoorn with karma: 86574 on 2017-10-20

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by aurora18 on 2017-10-20:
Thank you so much!! Setting the ROS_IP solved my Problem! I tried that before but obviously changed to another terminal when publishing to /chatter where the environment variables weren't exported yet. Thanks!

Comment by gvdhoorn on 2017-10-20:
You could either make sure you have a properly working DNS setup for all involved hosts, or add the export ROS_IP=... to your .bashrc. Or use a tool such as ifdata from the moreutils Ubuntu package.

$\endgroup$

Your Answer

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