ROS on Android Phone | Finaly done with ROS(Robotic Operating System) on android

Standard

From: http://www.technolabsz.com/2012/03/ros-on-android-phone.html


ROS on Android Phone

 

Finaly done with ROS(Robotic Operating System) on android 

It was my 1 day work for getting an output from android to ROS Server .I will explain the procedure that i have done
Prerequisites:
1)android-sdk for linux -Refer the following site for manually download android component .Othervice you have to setup eclipse for doing it
2)platform-tools-This is the most required thing in this installation operation

Procedure:
1)Download android stack from ROS website
2)There is a README file in this stack describing the installation procedure .But there will some error when you follow it
Note :The error i got the installation operation is with adb
Starting of adb is like follows
#./adb kill-server
#./adb start-server
#./adb devices
It will print if the device is connected
#./adb shell
Set the Link path of python from README file
Change the link path according to your android path .Othervice it will show error
It is better to install Pythonforandroid and sl4a manually .
Set the adb path in .bashrc file on home folder
eg :export ADB=~/android-sdk/platform-tools/adb
After installation using make install command
You have to enter
$make cv_module
$make ros_sample 

After that you have to take pythonforandroid and press importmodule option
It will show cv.egg ,select and install it
Connect android phone and computer though a wifi network ,preferably through a router .
Take ros.py from sl4a script folder .Run it
It will ask for ROS_MASTER_URI ,for URI you have to note the IP of computer which running roscore .For eg:My system IP was 192.168.1.2 So theURI is

eg : ROS_MASTER_URI=http://192.168.1.2:11311
URI=http://IP:11311
Note:i have some issues in importing cv .So i commented the cvsection and working only on accelerometer ,vibrate ,speak functions
Here is the edited ros.py
#
#  ROS on Android
#  Sample ROS node
#
#  Copyright (c) 2011 Technische Universitaet Muenchen,
#  Distributed Multimodal Information Processing Group
#  http://vmi.lmt.ei.tum.de
#
#
from ros_android import *
import time
# load needed ROS packages
import roslib
import rospy
from std_msgs.msg import String
from std_msgs.msg import Int16
from sensor_msgs.msg import Image
#from cv_bridge import CvBridge, CvBridgeError
#import cv
# callback for /mobile/say
def cb_say(data):
rospy.loginfo(“I should say: %s”, data.data)
droid.makeToast(data.data)
droid.ttsSpeak(data.data)
# callback for /mobile/vibrate
def cb_vibrate(data):
droid.vibrate(data.data)
def main():
print “main()”
cam = CamHandler()
pub = rospy.Publisher(‘/mobile/acceleration’, String)
rospy.init_node(‘android’)
rospy.Subscriber(‘/mobile/say’, String, cb_say)
rospy.Subscriber(‘/mobile/vibrate’, Int16, cb_vibrate)
# start sensor polling in background
droid.startSensing()
while not rospy.is_shutdown():
# read the accelerometer and store result
acc = droid.sensorsReadAccelerometer().result
# if new sensor values have arrived, output them
if isinstance(acc[0], float):
# acc_str = “%s – Acc: %f %f %f” % (rospy.get_time(), acc[0], acc[1], acc[2])
acc_str = “X:%f Y:%f Z:%f” % (acc[0], acc[1], acc[2])
else:
# acc_str = “Time: %s – No acc. values” % rospy.get_time()
acc_str = “No values.”
rospy.loginfo(acc_str)
pub.publish(String(acc_str))
rospy.sleep(1.0)
# start-up main
main()
Here is the output
Videos

668 total views, no views today

CES 2010: Best 3D HDTV, eBooks, Dell Tablet, Gaming Netbook, $40 Personal Cell Tower?!? – Tekzilla

Standard

CES 2010? We’re on it! From PC Gear to iPhone alarm clocks, HD set top boxes like the Boxee Box by D-Link and the PopBox, and the scoop on bringing 3D HDTV to your home, a 30FPS 4lb gaming netbook, your very own Femtocell, a robot that cleans corners and a stack of eReaders and more!

544 total views, no views today

Why Parents Drink

Standard

Why Parents Drink

A father passing by his son’s bedroom was astonished to see that his bed
was nicely made and everything was picked up. Then he saw an envelope,
propped up prominently on the pillow that was addressed to ‘Dad.’

With the worst premonition he opened the envelope with trembling hands
and read
the letter.

Dear Dad:

It is with great regret and sorrow that I’m writing you. I had to elope
with my new girlfriend because I wanted to avoid a scene with mom and
you.
I have been finding real passion with Karen and she is so nice. But I
knew you would not approve of her because of all her piercing, tattoos,
tight motorcycle clothes and the fact that she is much older than I am.
But it’s not only the passion…Dad she’s pregnant.
Karen said that we will be very happy.
She owns a trailer in the woods and has a stack of firewood for t he
whole winter.
We share a dream of having many more children. Karen has opened my eyes
to the fact that marijuana doesn’t really hurt anyone. We’ll be growing
it for ourselves and trading it with the other people that live nearby
for cocaine and ecstasy. In the meantime we will pray that science will
find a cure for AIDS so Karen can get better. She deserves it.

Don’t worry Dad. I’m 15 and I know how to take care of myself. Someday
I’m sure that we will be back to visit so that you can get to
know your grandchildren.

Love, Your Son John

PS. Dad, none of the above is true. I’m over at Tommy’s house. I just
wanted to remind you that there are worse things in life than a
report card that’s in my center desk drawer.

I love you.

Call me when it’s safe to come home.

552 total views, no views today