Android Robosapien

A toy that can be controlled by an Android phone could be turned into an interesting robot if we just tape the phone to the toy and do some interesting software.  Our idea is to use the phone's camera and OpenCV to get the robot to go to a red ball and then swing its arm to hit the ball.  Then go find the ball again and hit it again, etc.

This Robosapien toy sends commands out the audio-jack and then has a little thing that converts that signal into infra-red. Using the standard RoboRemote app we removed the IR adaptor and recorded the audio that came out for each command into a separate .mp3 file.  We put these files into our software. However, when we then put the IR thing back on and had our software play the .mp3 audio of the commands, it did not make the robot move.

As a second test we adjusted the audio tracks so that they were as loud as they could be without distortion. Still did not work. Our first recording was with headphones around a big podcast type microphone.

Update after the first comment below.

Third attempt was using audio cable to connect phone audio out to computer audio in.   This showed that it is a stereo sound, so the first two attempts could have failed because they were mono.   This time after maybe 16 attempts I got one where the robot made some noise but did not move.  If I zoom way in on the audio it is clear it is digital.  But it looks like very nice digital. 

With what seems to be a nice clean recording I am still a bit puzzled as to why it does not work

 


This is a companion discussion topic for the original entry at https://community.robotshop.com/robots/show/android-robosapien

Robosapien CIR codes

 

Sometimes the hardest part is learning enough to ask Google the right questions.  :slight_smile:

http://www.markcra.com/robot/ir_codes.php

 

Look what I stumbled upon today

I can’t remember how I got to the WowWee github page but I saw that they provide the audio files so you can create your own android/iOS apps to work with their IR dongle and Robosapien, pretty neat! https://github.com/WowWeeLabs/RoboRemote-IR-Dongle-SDK

While it’s nice to see my site linked full credit has to go to aibohack for documenting this info (I’m only mirroring it to ensure it is always available), his link is http://www.aibohack.com/robosap/ir_codes.htm.

Fantastic

 

That is just what I wanted!   Thanks very much!

So close yet so far

 

I can play the audio files on my Android phone from App Inventor code or from Java Code and in the earplugs it sounds just like it does when I play the files on my computer with Audacity.  So it seems like my code to play the official WowWee audio files works.  But when I replace earplugs with the dongle it does not light up and the robot does not move.  The volume is up.       It seems so simple that it really should work but it still does not work.  Will have to sleep on it.

Now it works!

 

Just turned the volume up again (without changing any code) and now it works!

I am sure I turned the volume up last night but it may reset when my app starts or something.

Anyway, playing the official WooWee audio files does work from App Inventor or from Java.  It is far easier from App Inventor.

Now to get vision working…

Thanks for the help people!

Have vision but phone weight an issue

 

I have vision working using OpenCV in a Java app written in Android Studior.  My 11 and 13 year old like App Inventor, and it really is far easier to use.    So we have a small App Inventor app that calls the Java app to see where a yellow tennis ball is, and then plays the different audio files for left, right, forward, based on where the ball is.  The code really seems to work.  If we just hold the phone and point it at a tennis ball we can make the robot do what it should do based on where the ball is relative to the phone.

However, the robot had a very hard time walking with the weight of my phone on it.  My son’s phone is not so heavy and if I just put it on the robot and control with my phone it can walk ok.   However, so far Android Studio won’t talk to my son’s phone and install our Java app on it.   But once we work out this problem I think we will be ok.

Keep up the great work!

Sounds like you’re making real progress. I too like MIT’s App Inventor 2, it beats learning how to write Android apps when all I want it for is a nice user interface to an Arduino project.

I can’t recall seeing anyone mount a phone or similar weight to the original Robosapien. As I understand it the balance/weight distribution is key to how Robosapien walks/turns and adding a significant weight might disrupt this. Can you sling the mobile phone low off the chest? There’s a fair bit of space behind the chest which can be put to good use, I shoe-horned some electronics in there for my Robosapien Alarm Clock project, perhaps you can trim off some material to fit a mobile phone close to the body.

rs-hack02.jpg

marking out the space which I filled with this:

rs-hack06.jpg

Tape near mid section joint

 

So a big part of my trouble was some tape over his mid section that is really a joint that needs to bend as he tips side to side.   So it was not really the weight but this tape that was getting me.

Our phone camera only goes like 15 degrees to each side.  It is maybe 25 degrees up and down.  It often does not see the ball, or turns too far.  Our vision update time is about 2 seconds.

We have been bouncing the IR signal off aluminum foil to get it from the IR adaptor to the robots chin.

I want to mound the phone sideways above his head but it is too hard to bounce a signal from this position (it is on the far side of his shoulder).  With a little audio cable we could have the phone there and the IR thing aimed at the robot’s chin.   We went to all 4 stores that carry audio cables on this island and none had a 3.5 mm male to female cable.   I ordered one from Amazon.   So this project may be on hold till it gets here, like 2 or 3 weeks.

Started a new version of my Solar Autonomous Android Phone Boat.  Will post about that after it is working.   Want to get it working well enough that it can make it to the next island over, 6 miles away, and back.  Or at least 3 miles over so it invades their territorial waters, and back.  :-)