Ask Your Question
0

How to publish Image and IMU data from Android device ?

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

Werewolf_86 gravatar image

Hi,

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

http://wiki.ros.org/roslibjs/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
1

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

Comments

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 imageWerewolf_86 ( 2016-12-29 10:07:12 -0600 )edit
1

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

gvdhoorn gravatar imagegvdhoorn ( 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 imageWerewolf_86 ( 2016-12-29 10:26:38 -0600 )edit
1

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 imagegvdhoorn ( 2016-12-29 10:43:45 -0600 )edit
1

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 imagegvdhoorn ( 2016-12-29 10:44:29 -0600 )edit
1

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 imagegvdhoorn ( 2016-12-29 10:45:41 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

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

Seen: 334 times

Last updated: Dec 29 '16