0
$\begingroup$

Rosanswers logo

Hi, everyone. I am new to ROS Android and I'm playing with android_tutorial_pubsub. I run the program on AVD and run roscore on Ubuntu Desktop. As we know, the program on AVD creates a publisher as well as a subscriber, both on topic /chatter. The publisher publishes message "Helloworld n" per second and the subscriber recieves messages and show in TextView.
On my AVD,the TextView shows "Helloworld n" correctly. And on my Ubuntu Desktop, when I excute rostopic list, I can see a topic named /chatter. And the rqt_graph seems correct, too. But when I excute rostopic echo chatter (or /chatter), I can not get messages "Helloworld n". When I see rqt_graph, it shows that both android node and rostopic node subscribe to topic /chatter.
So here comes the problem. Why does rostopic echo get nothing but the android node can get messages while they're subscribing to exactly one same topic? I'd appriciate it if anyone can help.


Originally posted by SilverBullet on ROS Answers with karma: 74 on 2014-11-08

Post score: 0


Original comments

Comment by Gary Servin on 2014-11-08:
What values are you using for ROS_MASTER_URI and ROS_IP (or ROS_HOSTANAME) on Ubuntu? Can you set those env-vars to use the IP of your machine?

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

This is most likely a network configuration issue. The AVD does not expose a direct network connection to hosts on your LAN, it uses NAT. As the ros master is running on your Android device, you'll need to allow traffic to be routed to the proper IPs through the NAT. See an earlier answer about this: rosjava nodes isolated and ros tools buggy behavior.

Alternatively, you could try running your master on your host machine, and have your rosjava applications use that as a master. In that case you need to make sure you have working DNS (for both the AVD instance and hosts on your LAN), or just set ROS_IP and ROS_MASTER_URI appropriately (use plain IPs).


Originally posted by gvdhoorn with karma: 86574 on 2014-11-09

This answer was ACCEPTED on the original site

Post score: 0


Original comments

Comment by SilverBullet on 2014-11-09:
Thanks a lot. I think it's right that ROS on my ubuntu cannot connect to AVD nodes correctly. It seems that I really should buy a real android phone to continue my study. orz

Comment by gvdhoorn on 2014-11-10:
Well it's probably possible, you'd just have to figure out the correct configuration of the AVD network interfaces. A real device is slightly easier, but I'm not sure it's really needed.

$\endgroup$

Your Answer

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