rosjava nodes isolated and ros tools buggy behavior
I'm trying to connect the android pubsub tutorial of android_core with a master core in my server. https://github.com/rosjava/android_co...
I'm using ros indigo, which I installed in ubuntu using apt; and compiled rosjava and android_core from scratch.
Actually the example runs fine and I'm able to see the android subscriber getting the messages in the listener activity, which are sent from the talker node written in rosjava and runs also within the android emulator.
And when I run an additional listener node, it seems to subscribe fine:
rostopic info /chatter
Type: std_msgs/String
Publishers:
* /rosjava_tutorial_pubsub/talker (http://10.0.2.15:45508/)
Subscribers:
* /listener_6323_1412952506377 (http://laptop:37300/)
* /android_gingerbread/ros_text_view (http://10.0.2.15:47832/)
The problem is that even if it is subscribed, the python listener won't see anything, the messages sent by the talker in the emulator arrive fine to the listener in the emulator, but not to the outside listener.
Also I noticed several glitches in the tools when combined with the android example:
I tried to send messages from the console using rostopic, and they are received fine by the listener in the console, but the listener in the emulator won't see it.
rostopic sees the topic /chatter, but rostopic echo /chatter wont print anything either.
- When I run rqt_graph, it stops working right after I launch the android APP. And it wont work at all if I close and reopen, I have to restart the roscore in order to use it again.
I'm using the ROS_MASTER_URI set to my IP, in both console and emulator, so there shouldn't be mismatches in the namespace.
I checked the rosjava distribution to see if the git branches were correct and all of them seem to be the latest (indigo-devel most of them).
I saw this commit has to do with msg headers: https://github.com/ros/ros/commit/b9d... could it be related?
What could be happening here?, Namespace problem of the messages?, version incompatibility problem?. IDK.
Regards
EDIT: I couln't get it to work on the emulator, but the problem was getting to the net interface of the virtual device. In a real device, the exact same setup works fine. The bugs also dissapeared, I guess the problem is that when ros tools can't get to the devices for information they crash, that includes rqt_graph and some others.
You mention
ROS_MASTER_URI
, but have you checked whether you needROS_IP
as well? If there is no working DNS for your hosts, you probably need that. I've done the exact same thing you're trying to do (albeit with Hydro) and it definitely can work.Nice to hear it can work, I don't have a DNS, where should I set the ROS_IP variable? in my server or in my app?
I had setted the ROS_HOSTNAME var, to my IP, I forgot to mention, but now I also setted the ROS_IP var. No changes so far. :(
Easiest is probably to make sure you got your network setup correctly. See ROS/NetworkSetup and Tutorials/MultipleMachines on the ROS wiki.
I already followed that tutorial, and see the wiki several times, :/. If I'm doing something wrong I don't know what is (obviously). I guess it could be related to that but as I said, I'm running with ROS_MASTER_URI setted to my IP, and the example works fine, however subscribing from outside is not
when you did it, you had to setup a port forwarding for the emulator or something like that?
IIRC, without a working DNS, you need to make sure all your nodes use only their IP. A subscription needs comms to work both ways: in your example I see
10.0.2.15
, but alsolaptop
. Without DNS, that won't work. SetROS_IP
on all machines (virtual or not) to their own IP.