RovioWrap

56 posts / 0 new
Last post
Sidekick
Sidekick's picture
RovioWrap

Hello Everyone!

 I've been reading a lot of informative forum messages over the last month about interfacing with Rovio.  I created a VB.NET RovioWrap class that encapsulates much of the Rovio Ver 1.2 API as well as implementing various forum message replies from people like "RoboSapienPet", "mt", and "Nocturnal".

 You can check out the open source code at: http://www.codeplex.com/RovioWrap .  Go to the "Source Code" tab and then "Browse" in the recent check ins.  Feel free to use as you wish, just give credit where credit is due, like I did in the code to various members from this forum.

See videos at YouTube (search RovioWrap):

Currently the RovioWrap class can do the following:

  • Standard movement operations, head movement, light control
  • Get all status information, like head position, x, y coords, etc.
  • Get current camera image, change resolution
  • Play WAV files out your Rovio Speaker
  • Play TTS (Text to Speech) out of the Rovio Speaker
  • Speech Recognition for blocks of 2 second captured Rovio microphone (working with the 'TrainedRovio.vb' window)
  • Record WAV file from Rovio microphone (working, you can set the # of seconds to record)
  • Turn blue lights on/off (for 5.00b10 patch - thx 'Nocturnal') (I'm doing something wrong, commented it out for now)
  • 'Dog' application - window you can launch to exhibit "dog" like behavior (see 'TrainedRovio.vb' description below)

 Some things RovioWrap will do soon:

  • Adding capability to call ACL LISP code (for use in established AI programs, like SNePS)
  • Adding Goto(x,y) even if you haven't pre-saved the path

A test program called RovioController is available to show you how to use it:

  • Provides some code to interface with Matlab to process images (like edge detection). This works, but I disabled it.  Feel free to install Matlab and reenable it, but you will need a Matlab script as well as a directory structure similar to mine.
  • Provides code on how to move, get status, get images

A test program called TrainedRovio is available to show you how to use the Speech Recognition (be sure to unzip 'c-rovio.zip' to 'c:\rovio\' as it is used as a working directory):

It can recognize the following phrases and act appropriately:

  • "Rovio", "Bark", "Hello", "Run forward", "Good dog"
  • "Move left", "Move right", "Go back", "Go backwards", "Move back"
  • "Go forward", "Move forward", "Slide left", "Slide right"
  • "Turn around", "Turn left", "Turn right", "Spin", "Spin around"
  • "Wander", "Speak", "Move backwards", "Move up"
  • "Good bye", "Exit", "Sit up", "Down boy", "Down girl"
  • "Attack of the show" - (I initially made it just 'attack' but it would mis-recognize that word for me, maybe they'll feature my YouTube video Cool after I put it up!)

 Some of the VB.NET code was adapted from C++ or C code from various sources, so I've made some modifications from the original code to fit into the VB.NET framework.  Feel free to modify, post, criticize, or give props.  And if you have any good code you want in the object, feel free to post or send it to me and I'll give the appropriate credit for it.

Enjoy, my fellow Rovioians!

 ---Sidekick [Go to http://www.codeplex.com/RovioWrap]

 

Join RoboSapienPet's cause, cause it takes to long to do anything without the source!

http://www.robocommunity.com/forum/thread/14178/Rovio-uses-eCos-WowWee-owes-us-some-open-source-code/

amodedoma
amodedoma's picture

Ohhhhhh Yeaaaahhhh, You're the Man! Thank you very much, been working on my own program in powerbasic, while most of it's straight forward stuff the audio and video parts aren't. Thanks for posting source, if I see anything that can be improved or discover some functionality you've over looked you'll be the first to know. I'm trying to write a program that'll use NS, camera, and IR to map out it's environment. Got some ideas I'd like to try, an optical navigation system - based on landmark recognition and orientation. The rovio is an excellent little surrogate to the PC, and perfect for prototyping these ideas.

flowersrj
flowersrj's picture

Effort appreciated but it would be nice if they were O/S neutral

Nocturnal
Nocturnal's picture

Turn blue lights on/off (tips didn't work for me, but I implemented the code)

Umm... you are aware that this is firmware version dependant.

Sidekick
Sidekick's picture

amodedoma: Thank you, amodedoma!  I greatly appreciate your comments.  I hope this helps in what you are working on.  I know I benefitted immensely from the selfless posters like "mt" and "robosapienpet" who share their knowledge and hard work, so I hope I could return the favor and contribute as they would.  I think you will like the next update I put out there that allows you to capture mic input and run it through a speech recognition engine.  It's still a little buggy at the moment, but I will be finishing it up this weekend (hopefully) and post it.  Good luck and let me know how your project comes out!

 --------------------------------------

Nocturnal: Yup, Nocturnal, that tip for the blue lights was from back in Oct 2008, but I was hoping it would work for my firmware version.  I tried both variations, but they didn't work for my firmware version.  So I commented out the code in the hopes that someone would let me know what locations need to be written to for the current version of the firmware as well as the beta.

 If anyone does know the proper locations, let me know please! :)

 --------------------------------------

flowersrj: Sorry flowersrj, but there may be good news for you if you are using linux.  There are some layers out there (see: http://www.smashingapps.com/2008/11/05/6-free-tools-to-help-you-run-windows-applications-on-linux.html)  that you can install that will allow you to run .NET objects/windows programs.  If you are using Mac (or Linux for that matter), I have some classmates that are running this on a virtual machine quite nicely.  However, ultimately, the way Wowwee did it was quite nice and OS neutral and they even provided us with the API!  The wrapper only helps .NET people immediately, but a friend of mine is translating RovioWrap into Java so you should be able to use that after he is done.  He is estimating by mid January he'll have something to release.  You won't be able to use the Speech Recognition stuff (since that uses Microsoft Speech Recognition) that I am releasing this weekend, but everything else should work.

 

 Happy Roving!

---Sidekick

kpsux
kpsux's picture

---{cut 'opinion' out by request :P }---
redirect flowersrj to WINE

Good job there sidekick. I ran it on Wine on my linux box and it works great. I'm calling your object through COM in my Java. Post your SR code and I'll get it to work with Dragon SR and maybe I'll post it for Windows-haters out there like flowersrj. Can't all OS's out there just get along...oh wait, they sort of do. God, nothing satisfies everyone, not even free stuff!

Sidekick
Sidekick's picture

Comon guys, don't hijack this thread with namecalling and flaming.  I'd appreciate it if you could take remove or edit your posts and take it to messaging each other or emails or take it to another thread.

 kpsux, thank you for your information on WINE, I did not know that would work with this wrapper.  That's good information.  No need to call flowersrj a slacker, he's just expressing his opinion.  And flowersrj, just delete your second post if you could please, it has no information important to this topic.

 Thank you guys for your time.  This, after all is all about robots!

Robots! Robots! Robots!

 ---Sidekick

Nocturnal
Nocturnal's picture

:-) Perhaps revisiting the original thread may provide the details that you need.

Sidekick
Sidekick's picture

Sweet!  Thanks, Nocturnal!  I'll be crediting you appropriately, thanks for your hard work!

 ---Sidekick

Nocturnal
Nocturnal's picture

robosapienpet did the hard work, I just did the easy bit.

Peter Redmer
Peter Redmer's picture

Sidekick said:
Comon guys, don't hijack this thread with namecalling and flaming.  I'd appreciate it if you could take remove or edit your posts and take it to messaging each other or emails or take it to another thread.
 kpsux, thank you for your information on WINE, I did not know that would work with this wrapper.  That's good information.  No need to call flowersrj a slacker, he's just expressing his opinion.  And flowersrj, just delete your second post if you could please, it has no information important to this topic.
 Thank you guys for your time.  This, after all is all about robots!
Robots! Robots! Robots!
 ---Sidekick

 Agreed on all counts.  No need to get into any "my OS is better than yours" battles.  This comes from someone who's running two Mac OS machines, CrunchBang Linux, and WinXP all at once ;)

RoboCommunity is a fun place to be... let's keep it that way.  I deleted flowersrj's second comment and expect that any other offending posts will be edited.

Have fun!

E-Jungman
E-Jungman's picture

Wow great stuff, you plan there.

But i am sorry to say I am new to VB.net. And the things mentioned in the feat list are just what everyone would love to see in his rovio.

But I dont know how i can use it ?

Would it be possible to learn the rest of us, just a little ?
Tutorial maybe ??

Sidekick
Sidekick's picture

Hi E-Jungman,

Good idea, E-Jungman, I will put a Readme file in the project to help get people started.

Most of the features that are in RovioWrap were things that other forum members had put on the forum over the last 4 months, I only uniquely implemented things like connecting with Matlab image processing (using COM), capturing audio for use with Speech Recognition (to be released this weekend), and hooking up to many of the commands in the Rovio API v1.2 (easy to do, good job, Wowwee).  So there are many examples in C and C++ on the forums you can use.

One of my friends is translating the stuff I did in .NET to Java, so you may see a release of a Java based wrapper in the near future, and I'll put it up as well.

VB.NET is pretty readable so feel free to take the code and implement it in the language of your choice, the only difficulty will be dealing with the COM objects if your language of choice doesn't let you access them.  I know that Java, ACL-LISP, C# definately does, so the translations 'should' be straightforward if you are in Windows.  Another forum member claims to have run it on Linux in WINE.

However, good news if you have a language that can interface with COM.  This next week I will be releasing the DLL (as well as the code for the DLL) which will allow you to use RovioWrap directly without having to translate anything, all you will need to do is create a COM object and call the methods and properties in your code.

 I currenlty have the full code of the object and the test program I used to test it on http://www.codeplex.com/RovioWrap so feel free to download the code into Visual Studio (I used 2005, but it should work in 2008) and just run it.

I've spent today working with different firmware updates, since I had problems with 5.00b7 and b9 in Ad Hoc mode and on Vista 64x Internet Explorer.  I finally found that 5.00b10 beta made all my issues go away, but I wasted a day doing it, so I won't have the next update until later tomorrow night.

---Sidekick

E-Jungman
E-Jungman's picture

Thank you for your hard work !!!
And for this explanation.

I already downloaded it, installing Visual studio A.T.M.

great work m8 !!

E-Jungman
E-Jungman's picture

Hi all.

So im back installed the VB studio. and opened the "solution"
Once i clickedy click. I get overloaded with errors.
It has to Convert this solution (im using VB studio 2008)
And the sollution is a 2k5 one.

ther errors
Cant find Mlapp and unable to load
And during the conversation the folder My Project is created and should be filled with converted files. It doesnt (cry) The thing looks in that particular folder. for the files. and duh ,.,. tells me he cant find em.

(please dont hate me for being ignorant)

Sidekick
Sidekick's picture

Hi E-Jungman,

 I used VS 2005 so I was unsure what would VS 2008 do.  This is what I recommend:

1. create a new project

2. add the two .vb files

3. In your project, select the project name and right click to properties.  On the first tab, for application, make sure that the startup form is RovioController.  (It may already be set properly)

4. Press play

You may have to do Project - Add References and add for .NET add  System.Speech though you may not need to do this.

You can probably just change your existing project.  Do not worry about the MLapp, since you do not have Matlab installed.

I'll be putting up a more streamlined project today, removing all the uneeded stuff (like MLapp) so perhaps you'll want to work off a more up to date copy.

E-Jungman
E-Jungman's picture

Sidekick,
Thanks for helping out.

Using VB studio and made a new project. Added the files.
But still gives me some errors.

When i press the "play" button I got the message (some errors are found) using the last successful build instead then it start generating errors about the missing executable. (what would be obvious)

So there has to be something im not doing right.

greetings E Jungman

Sidekick
Sidekick's picture

Hi E-Jungman,

Unfortunately, those errors are just related to the project not being set up completely correct, it tries to compile, there are errors (you need to look at the errors and correct them, but you'd need to know how - as its probably that your startup form is not set or something simple like that), and then it tries to run the last build - which of course would not work.

The solution for this is to wait a bit and I will try to put up a full project on Codeplex with everything you need already set up (first time managing open source so I'm not sure what I had to include). I haven't made a release of the project yet, since this was just a working copy that people could use to tkae the .vb files and make their own projects. I hope to do so tonight and that should solve it for you.

I'll post here when its up there.

E-Jungman
E-Jungman's picture

You are a GOD among us mere mortals !!!!

I bow before you my master.

ghehe

(thanking you)

Oh and all of this playing around with visual studio. Got me really interested in VB.
In fact I got my first application !!
the (hello world) thing.

greets E

Sidekick
Sidekick's picture

Thank you, E-Jungman!  But I am merely riding on the backs of giants.  This forum has a lot of contributers that have made my "consolidation" operation both fun and doable.

Today I ran a demo of the RovioWrap to two groups of fellow students.  I got my Rovio to move when I asked it to, wander around on command, speak, sit up, and do a bunch of other commands.  I even have it go 'crazy' when I say "Attack of the Show" to it.  I'm going to stick up a YouTube presentation of the demo and maybe they'll put clips of it on the show! :) This next week I'm going to work on some simple object recognition or try to get it to connect to LISP so that I can use our university's AI software.

Anyway, I'm putting up the project on CodePlex now.  I'm going to put up the entire directory, so I hope that helps VS2008 build it from my VS2005 project.  In addition, there is a smaller directory that needs to sit on your C: drive (or change the hardcoded paths) in order to access the .wav/.pcm files for the audio.

Have fun!

E-Jungman
E-Jungman's picture

WOW.

Ive tested it And it works !!

The test calls to the rovio succeeded.
Edited the basic credentials in the code and run it.

Works as a charm.

Here on Vista x64.
The only thing that doesnt work yet is the "Mlab" thing.
Trying to get that running over here.

-The roam and turn.
Is a really nice way to show off the object detection.
The rovio dives really fast !!
And I love it when he talks shit.

Made him say things at work, like..
- my bro went to mars
- step here please
- catch me retards
- all of your base are belong to us
- take me to your,, manager

I too have been working on some basic object detection using a 3rd party program
called Roborealm. Its really eazy to get the variables out with doing motioon detection, or basic object detection.

I have it set up over here to test. and it will follow a red laser if in sight of the camera.

Dang man,, you get me all exited about this thing. And its good to know that im not alone wheb it comes to "loving"the rovio.

Edwin

Sidekick
Sidekick's picture

Hi Edwin,

 Excellent!  You have made my day!  I'm glad it worked for you, I was hoping to figure out what minimum set of files of the project were needed to get it to work for you so you wouldn't need to download everything, but in the end I just put up everything I had.  (I'm running on Vista x64 as well, though I set the project to run in x86 mode)

There is so much we can do with the Rovio platform, they made it so hacker friendly!  I am happy to have your feedback and I look forward seeing if I can figure out how to make the Matlab/obstacle and edge detection thing more usable for others.  At the moment I'm running the student version of Matlab and using some .m matlab functions from the full version from a class at the university.  I'll see if I can write up a little FAQ on that to help out setting it up soon.

 Nice to hear from you and thanks again for your complements!  Your enthusiasm is very invigorating! :)

Sidekick
Sidekick's picture

Here's some video links. Enjoy! ---Sidekick

RovioWrap and sample programs - Speech Recognition in action

RovioWrap - Introduction/Explanation

RovioWrap - Wander routine computer controlled


or just do a search in YouTube for RovioWrap.

Tomasito
Tomasito's picture

Hello Sidekick,

Firstly, I think you created something awesome.

But, I don't anything about programing. I am interested in using what you created.
I know that there are many of us out there with rovio's that doesn't know much about programing.
Can you give us a step by step instruction, so that we too can have fun with your creation.
Thanks in advance,

E-Jungman
E-Jungman's picture

Hi m8.

Really nice work.
I ve been into it. And it is really good.

But i have to send my rovio to its maker. its dead.

Btw,.,. What a sweet daughter !! our future roboteer!!

denodan
denodan's picture

Is there going to be a download for everyone to use? A setup file so it installs on your computer?

Sidekick
Sidekick's picture

denodan said: Is there going to be a download for everyone to use? A setup file so it installs on your computer?

Yes, sorry about the delay, I'll be making a setup for others to install the .NET object and the 2 sample programs.  I'm swamped with work atm, but I'll guarantee it by the end of Feb 12th EST. Laughing

Sidekick
Sidekick's picture

E-Jungman said: Hi m8. Really nice work. I ve been into it. And it is really good. But i have to send my rovio to its maker. its dead. Btw,.,. What a sweet daughter !! our future roboteer!!

Hey, E-Jungman.  Sorry to hear about your Rovio.  By the time you get it back from waranty, I'll have a bunch of new stuff for you to try!  I'm writing something right now that will let it race after a laser pointer just like a cat.  So I'll have both a cat and dog mode for Rovio!

Sidekick
Sidekick's picture

Tomasito said: Hello Sidekick, Firstly, I think you created something awesome. But, I don't anything about programing. I am interested in using what you created. I know that there are many of us out there with rovio's that doesn't know much about programing. Can you give us a step by step instruction, so that we too can have fun with your creation. Thanks in advance,

Hi Tomasito,

I definately will try and assemble something in a readme file for you to be able to download, change, and run the code yourself.  At the moment, I'm a bit swamped with work, but I am going to get an install out by Thursday of this week (Feb 12th).

I'll put the install under the Distributions tab on Codeplex's RovioWrap.  That will at least let you install and run the 2 sample programs I wrote to test RovioWarp.  Look for it later this week.

Thank you for your interest!  I was waiting for someone to ask for it before I spent the time to do it! :)

---Sidekick

denodan
denodan's picture

Is it possible in the program there is an adjustment for object avoidance?

I know it seems to detect object quite away ahead. Think the range is around 1 foot will detect objects and avoid them? Would I be correct? So a small place like mine will go in circles more than going straight?

have had Rovio go in a few straight lines,so nothing wrong with my IR on Rovio?

Just think detection seems to detect a long way off the keeps avoiding objects, so something within a foot will detect it as an object.?

If this was adjustable then maybe more fitting for smaller spaces?

Seems IR has a great weakness, cannot detect table legs or chair legs, so if not careful will get stuck.

Sidekick
Sidekick's picture

Hi denodan,

I have been a bit frustrated by the way the IR sensor works. I have a few other friends that have similar problems: obstacles being detected when there are none, and thin or non-shiney objects not being detected. It is usually due to the "type" of flooring we are on and the "type" of chair legs we are bumping into.

The RovioWrap object merely calls the API code directly from the Rovio to get the obstacle detected value, so it is either ON or OFF already. There is no "intensity" value that I can get it seems, otherwise we could do as you suggested.

There is a value for "motion detection", but I am not sure if that is hooked up to the IR sensor or not. If it is, perhaps that is what I can use to acheive this, at it gives a range of values, not just on or off.

Good comment, though, and I will put it on the Codeplex feature enhancement list to look into soon.

Pages