rosjava / android_core

Android libraries for rosjava
145 stars 166 forks source link

Unable to run on Android emulator #296

Open breandan opened 5 years ago

breandan commented 5 years ago

Hi @jubeira! I am able to run the examples from rosjava/android_apps on physical android devices, but unable to run rosjava on an emulator/AVD. I have been trying to configure emulator networking by using telnet commands redir add tcp:11311:11311 as described in the Android developer docs. I also saw several older threads from 2011-2012 and was curious to know if usability has improved in this area? In particular, I am concerned by @damonkohler's comment about rosjava being unable to configure port ranges. Is this still an issue on more recent versions?

It appears that the virtual client contact a remote master node, but not vice versa. I have tried running the master on both the android virtual device and my local Ubuntu machine. However, I was hoping to set up a local AVD for development and integration testing. I was also wondering what is the status of rosjava on ros2? I saw @esteve's presentation on ros2_java at ROSCon last year, and was wondering what is the official status of ROS2 on rosjava? Is this project still active? Thank you for your help.

jubeira commented 5 years ago

Hi @breandan, sorry for the delay!

I have vague memories of using ROS Android apps in the emulator; I think it was possible to do so. One of the threads you posted claims that it's possible to make it work. I'd say that its more a networking problem than a rosjava problem itself; it's like running inside docker at some point. If you could find a way to bridge the networks, then that's probably the easiest way to make it work.

I was also wondering what is the status of rosjava on ros2? I saw @esteve's presentation on ros2_java at ROSCon last year, and was wondering what is the official status of ROS2 on rosjava? Is this project still active? Thank you for your help.

Maybe @esteve can answer that ;). I played a bit with it about an year ago when ros2 was at beta3 release and it worked back then, but I didn't do much follow-up on it since then.

gxshao commented 5 years ago

The JoyStickView doesn't work on Android emulator...but other publisher and subscriber seems good. emulator abi:x86 api:android-28

ielson commented 4 years ago

Hey @breandan have you ever find a way to make it work? I'm facing the same issue here

breandan commented 4 years ago

Never solved this issue but maybe @gxshao can provide further details? Earlier last year I spent several hours debugging with Wireshark, trying different TCP settings, but pub sub did not work properly. Maybe the emulator or ROS2 networking config has changed since then.

ielson commented 4 years ago

I'm tried many things since last week and nothing worked. I think the problem is caused because when the emulator connects to master it says it's ip is 10.0.2.16, but the computer can't see this ip, so it can't answer to the emulator, and even if we use redir, we know that 11311 port is used by ROS master, but each time a node is started, it is in a different port, so we cannot redir it. What made me confuse was @gdvhoorn in this question: https://answers.ros.org/question/223602/android_core-emulator-registers-topic-but-not-sending-events/ that says it can be correct with configuration of ROS_IP, ROS_MASTER_URI and ROS_HOSTNAME

gxshao commented 4 years ago

I'm tried many things since last week and nothing worked. I think the problem is caused because when the emulator connects to master it says it's ip is 10.0.2.16, but the computer can't see this ip, so it can't answer to the emulator, and even if we use redir, we know that 11311 port is used by ROS master, but each time a node is started, it is in a different port, so we cannot redir it. What made me confuse was @gdvhoorn in this question: https://answers.ros.org/question/223602/android_core-emulator-registers-topic-but-not-sending-events/ that says it can be correct with configuration of ROS_IP, ROS_MASTER_URI and ROS_HOSTNAME

that's right... the network problems.