rosjava / android_core

Android libraries for rosjava
145 stars 166 forks source link

Android device cant accept image from gazebo without host added #275

Closed dkati closed 7 years ago

dkati commented 7 years ago

Good evening.i am trying to view my gazebo robot's camera view to android device with a republish of the image.even though the republish produce no error,i get not camera at my device.

i ran an adb logcat to my device and it said "Unknown host name" blah blah...so i have to add my PC's IP and hostname to my android's hosts...BUT this process requires root access...any thoughts?

it works perfect on my rooted device

adamantivm commented 7 years ago

@dkati There are two other ways to solve this.

The easiest is, on your gazebo computer, before you start anything, make sure to set-up the environment variable ROS_IP to the IP address (not hostname) of the Gazebo computer.

The other (obvious) alternative is to configure your network router so that it is possible to resolve the hostname without changing the hosts file in the Android device.

HTH

dkati commented 7 years ago

thanks for that lightning speed reply!!

can u guide me more on that first solution ?

edit: i think u meant ROS_MASTER_URI

jubeira commented 7 years ago

@dkati take a look at this: http://wiki.ros.org/ROS/NetworkSetup.

This problem is very common. The nodes that are running in your computer are using the system's hostname when they register to the ROS master. The device that subscribes to them (your Android device) has to be able to resolve the hostname. A workaround for this issue is setting the ROS_IP variable in your desktop so that the IP address is used instead of the hostname. If you do that, the nodes will be registered using the IP address, and your Android device will be able to talk/ listen to them.

Try using rostopic info on the topics published by your desktop computer. That will tell you if the nodes are using the hostname or the IP address. After setting the ROS_IP variable you should see the IP address.

dkati commented 7 years ago

everything sorted out after exporting the IP.thanks for that people.

Marking it as solved!