ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

How to publish Image and IMU data from Android device ?

asked 2016-12-29 05:00:32 -0600

Werewolf_86 gravatar image


First of all, i'm a newbie in ROS. I was going through the following tutorial:

I kind of understood what is going on in this program. But, i don't know how to run it. I would be grateful if someone lends me a hand to get through this problem.

Thanks in advance !

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2016-12-29 06:32:13 -0600

gvdhoorn gravatar image

It's not really "a program" (in the traditional sense), but a html page with an embedded javascript.

But, i don't know how to run it.

You'd need to set up the rosbridge_suite infrastructure on the ROS side and then load the web page into a browser on the Android device. The Android device should be able to reach the rosbridge node (ie: be able to network with the ROS PC).

edit flag offensive delete link more


Thanks for your reply. So, should i run "roscore" and "roslaunch rosbridge_server rosbridge_websocket.launch" command in my computer to receive the data from android device ?

Werewolf_86 gravatar image Werewolf_86  ( 2016-12-29 10:07:12 -0600 )edit

roscore will be run automatically for you by roslaunch if you don't do it yourself, but basically: yes.

gvdhoorn gravatar image gvdhoorn  ( 2016-12-29 10:23:32 -0600 )edit

i opened the html file in my Android Phone and opened the console in it. Then i ran "roscore" and "roslaunch rosbridge_server rosbridge_websocket.launch" in my laptop. But, nothing happens.

Werewolf_86 gravatar image Werewolf_86  ( 2016-12-29 10:26:38 -0600 )edit

First: I think the order should be the other way around: first roslaunchrosbridge, then open the web page. Second: the tutorial states:

make it accessible via a webserver running on the server that is running the rosbridge [..]

Did you do that?

gvdhoorn gravatar image gvdhoorn  ( 2016-12-29 10:43:45 -0600 )edit

Also: what did you expect to happen? The JS only causes the phone to publish IMU and sensor_msgs/Image msgs. If you don't subscribe to those, you won't see anything.

gvdhoorn gravatar image gvdhoorn  ( 2016-12-29 10:44:29 -0600 )edit

You can start a 'simple web server' on your ROS pc by running:

python -m SimpleHTTPServer

in the directory containing the html file.

gvdhoorn gravatar image gvdhoorn  ( 2016-12-29 10:45:41 -0600 )edit

Question Tools



Asked: 2016-12-29 05:00:32 -0600

Seen: 611 times

Last updated: Dec 29 '16