RSMedia CopyBot released

16 posts / 0 new
Last post
Helibot
Helibot's picture
RSMedia CopyBot released

   Hi all,

     I have uploaded a fun program called RSMEdia Copybot for you to try at your Christmas break.
    Sopme of you may remember and old video (somewhere on youtube?) where someone was standing in front of an RSMedia and as they raised each of their hands then RSMedia would copy them?.
   Well I have managed to make this work for RSMedia for you all to try Smile.
I called the program “Copybot”.
You can down load it from the Downloads area (when its approved).
You can also get iot from the RSMDevkit site on source forge. (See here)

See the README.HTML  file with the download for instructions how to install and run it.
**Make sure you are in control mode when you run it**

Once it is running you will see this screen:
         (The top icon is meant to be RSMedia Eyes, The second is a button and the third is the RSM remote -  sorry the pics dont look to good in the photo - they should look better in real life!!. )

  • The top row shows the data from the IR sensors
    It can show the letters “C R M L”
    When R is showing the robot is detecting something on his right side.
    When L is showing the robot is detecting something on his left side.
    When M is shown the robot is detecting something in the middle.
      (Usually it has to be quite close & low and the object has to be quite reflective)
    When C is shown the robot is detecting something very close.
      (Usually a hand or something right in front of his face)
  • The last line of the LCD will show “Copybot On” when he is in copying mode.
        Press the Select key on the remote to turn “Copybot” mode on and off.
  •  Press the ‘Z’ remote key to exit (and return to the normal Wowwee control mode)

 Other information shown on the screen:

  • The second row will show which button is pressed on the robot.
       (His hand buttons work, but the feet buttons don’t always work properly)
  • The third row will show what buttons are pressed on the remote.
       (Most buttons work OK, but combinations of the L and R button on the side and top buttons aren’t yet decoded. The right pad arrow buttons will still move his head.)

So once you have it setup and running I suggest to turn “Copybot” mode off by pressing Select then have a bit of a practice with your hands to find the best positions and movements.

I found the best way is to put him on a table, sit at the table, put both arms straight out.  Your arms should be just under his eye height. Put your hands up like making a stop signal. Both L& R letters should be shown. Now drop your left hand flat  and hopefully the L  will disappear. Repeat with your right.

You want to practice making the L & R symbols appear and disappear as you move your hands or arms.  After a litte experimenting you should find a strategy and position that lets you make the L & R appear at will.

Now press the Select key again (LCD should show “Copybot is On”) and you should now be able to make the robot copy your arm movement, put you arms/hands up and he will do the same!!  Have fun.

 See the README.HTML for more instructions/notes/hints.

  The source for the copybot program is in RSMediaDevkit sourceforge svn. (You will need to get the directory /src_robot/copybot directory to see the code. You will also need /src_robot/include and /src_robot/lib if you want to compile it.)

Background Info

It didnt seem possible todo this using Wowwee’s available bodycon or scripting capabilities.  So I pulled togther some smaller programs I wrote in the past to make one program that sits on top of the linux OS but replaces all of Wowwees ‘Robot specific’ programs.  My program listens to the raw data from the robot board, decodes the data (which includes InfaRed events, sound events, remote and robot keys), and draws to the LCD screen. The "copybot" part of the program is actually quite small - it simply monitors the IR data changes and sends linux commands to move the arms when needed.

   So by reusing the main parts of this program it should be possible to add bits of code todo all ALL sorts of other stuff.  Basically I hope this will become a whole new programmable brain for RSMedia.  I will post another thread about it soon that explains it more and the source code further (but maybe not until after Christmas now…..)

 Cheers

   Helibot

Helibot
Helibot's picture

Hi All,
TikaC found the original You tube video I saw a long time ago. You can see it here http://www.youtube.com/watch?v=X9qVK7br63s.
The copybot program can do the same thing as this.
I would have liked to done a new video but I was too short of time at the moment :-(.

FreddyA
FreddyA's picture

Wow Wee! What a great gift we got this christmas!
Cant wait to try it out it looks awesome!
Thanks helibot

gerber
gerber's picture

Fantastic Helibot (your the man)

I can't wait to try it either. As I haven't tried it yet is it also able to control the body movement or just the arms?

Cheers
Gerber

Helibot
Helibot's picture

Hi Gerber,
The 'copybot' program only moves the arms. But the source code (in 'C') can be fairly easily changed to move or play anything after any button, remote key is pressed or if an IR event received (I will add sound evenets at some time as well).
BTW I have started writing another program (actually its just the same copybot program just changing the code in one function) that will instead do IR tracking. When he detects something to the left he will twist his head and then body left until he detects both left and right - hopefully that means he has 'found' the object and will be looking directly at it. Not sure if it will work yet.... but either way it will be fun trying!!

Cheers
Helibot

gerber
gerber's picture

Ho Helibot

Will definitely look at this. it sound really good and maybe I could add something into the RS Media Control station. I haven't used C for many years as I write all my software in VB.net so I would need to swat up on C and see if I can convert the code if that's possible.

Cheers
Gareth

Jamie
Jamie's picture

Hello Helibot,

When you sent me the email to say you have made this program, I downloaded it straight away. I put it on my RS Media and tested it out. Works great! Good Christmas gift :)

Gerber:
You will need a client program running on the RS Media to receive all the IR events (Tricky) then you will need to send the data over the serial port to the PC. Then you will need to embed a program in your main program that uses the webcam to track hand movements (Basically using a normal webcam as a Kinect - Impossible) Might be possible but there is no point since it can be done all on the robot.

Have a Happy New Year!

Cheers,

Jamie Kugelmann

Helibot
Helibot's picture

Hi Gerber and Jamie,
Jamie said, "You will need a client program running on the RS Media to receive all the IR events (Tricky) then you will need to send the data over the serial port to the PC."
Actually getting the client program running on RSMedia is now a lot easier - as you could reuse the 'copybot' base software and change it to send all the events over the serial port to the PC, then your PC software could show (nearly) realtime states and events for buttons/keys and IR events. We would need to develop a protocol to pass the data across the serial port, but thats not too hard. (and maybe more reliable than sending linux commands and having to parse the console responses.)

I havent looked at getting my programs to access the video camera yet - but i will get there (hopefully soon). But I doubt it would be possible to pass a decent video stream back by serial connection - You just cant get enough data through :-(

BTW the IR tracking program I stated (see Dec 28 post above) is on hold - since I now need to pull the robot apart to free up the neck mechanism :-( (See new thread http://www.robocommunity.com/forum/thread/18221/Neck-Motor-stuck/)
But on the positive side I have instead started documenting more about the base software from copybot (which I have started calling 'HeliOS' :-) ). Actually I found that I also needed to document lots of other info about how the RSMedia Hw/Sw all work togehter , so it should be an interesteing read for anyone wanting to know about RSMedia internals!!

Cheers
Helibot

gerber
gerber's picture

Hi Helibot and a happy new year.

I’m working on a live streaming video in my RS Media control station, I am not too far into it as yet but as you say though it's no good doing it on a serial base, I need to update my RSM to V2 firmware first.

The other thing I had a play around with is making a 3d image (using the old fashioned red and blue glasses). I am doing this from 1 picture and below is the results from the experiments I have done

 Original picture

 3d picture (you need red and blue 3d glasses to see the effect)

I know it quite a crude effect but it sort of works. I have a lot more work to do to prefect the technique but its a start)

The reason I am only using only one image in stead of 2 slightly offset is because I am planning to add this 3d effect in the my software using live video feed from the robots camera. I don't know if the effect will work on a live video but I it's worth a shot. I got the Idea of doing this after speaking to freddya and he mentioned he was making stereoscopic vision for his robot with 2 webcams.

 

I hope you get your RSM neck working again I did the same sort of thing about a month or 2 ago but luckily it didn’t cause any problem as I managed to switch off the robot very quickly before any a serious damage was cause. To prevent this from ever happening again I added a safety feature in my software to prevent a limb movement command being entered beyond the limits of the robot limbs. It seems to be working well as I haven’t had a problem since.

 

Cheers

Gerber

ecap
ecap's picture

I just tried to compile the code, but it seems like the rs_input.h (expected in src_robot/include) is not checked into the svn.

Helibot
Helibot's picture

Hi ecap,
You're right, I missed to add rs_input.h into svn. I have added it now, so please tray again. BTW I also updated rsmedia.h (not sure if the changes were needed for copybot but I have added them anyway).
Let me know if you have any other problems.....
Cheers
Helibot

ecap
ecap's picture

Thank you Helibot,
everything is compiling.

I just tried to make the robot lift its arm, when I hit some key on the remote.
I noticed, that the system("/usr/bin/robot/scripts/MotorRel.sh XX XX XX") is not finished. Its rather a short move towards the position, I'd like it to have.
I first suspected some concurrency problem, but after studying your code I did not find any conclusion.
Is there something special, one should know about the /usr/bin/robot/scripts/MotorRel.sh ? I also had problems with the robot not finishing or even starting the movements sometimes, when I was playing around with the bodycons/bashscripts. If ... Else for example did not work. For me it seems the robot has a lot of quirks, or I have a lack of important information.
thanks!
ecap

Vader
Vader's picture

I noticed, that the system("/usr/bin/robot/scripts/MotorRel.sh XX XX XX") is not finished. Its rather a short move towards the position, I'd like it to have.

The movements executed via send_robot_cmd have finer control than the ones on the remote. Try moving in longer distances.

Is there something special, one should know about the /usr/bin/robot/scripts/MotorRel.sh ? I also had problems with the robot not finishing or even starting the movements sometimes, when I was playing around with the bodycons/bashscripts. If ... Else for example did not work. For me it seems the robot has a lot of quirks, or I have a lack of important information.

Is the robot IR tracking, etc. while you execute the commands? If so, the commands will not be processed by the robot board.

Helibot
Helibot's picture

Hi ecap,

   I think the Arms have a range of 0 to 22. So MotorRel.sh 04 00 08 is fully up and MotorRel.sh 04 22 08 is fully down. Does this help?
I didnt use the full extents in Copybot.

Have you seen Santa Matts page on RSMedia commands here.h It gives a good list of the commands and some explaination.

  If you have USB console working , you can issue the commands from the console to see how far you move the arms with the commands.  (I would advise experimenting with the arms , but not the neck/head - I think (from experience!!) its possible to strain/break linkages if you push command it too far. Arms are safe to play with.

>I also had problems with the robot not finishing or even starting the movements
>sometimes, when I was playing around with the bodycons/bashscripts.
Yes the bodycon scripting is fairly flaky. While the robot is doing or finishing some commands will ignore other commands. And as vader said if eyes or ears are on then reacting to these is first priority , so your commands will miss out. I always turn ears and eyes off when trying to control the robot via scripts/command line.

Playing around from CopyBot should givbe better response beacuse the normal Wowwee programs are disabled (its just the copybot program listening to all the commands from the remote/sensors.)

>If ... Else for example did not work.
If ... Else does work, but you need to ensure the syntax is correct.

Something like this should work:

if [ $(RSM_FOOT_R_F) -eq "1" ];
then
/usr/bin/robot/scripts/display_image.sh "image1.jpg" 3000
else
/usr/bin/robot/scripts/display_image.sh "image2.jpg" 3000
fi

Hope this helps....

Cheers
   Helibot

gerber
gerber's picture

Hi Ecap

I documented the commands and all the robot limb limits into a spreadsheet for myself. If it is of use to you I can email it to you. The one command in each movement that I found doesn't have any effect is the speed for example:

/usr/bin/robot/scripts/MotorRel.sh 03 00 08

This should make the left arm move up quickly

and

/usr/bin/robot/scripts/MotorRel.sh 03 00 00

This should make the left arm move up slowly.

Both commands seem to make the arm move at the same speed, where as I was under the impression the last value should change the speed of the limb movement. Maybe I am missing something?

Cheers
Gerber

ecap
ecap's picture

Thank you all for your help.

I am pretty sure about all the MotorRel.sh Parameters. (I look them up it that "BodyConEditor" not by woowee. Very handy! ;-)) MotorRel movements worked well when I triggered them from the root shell.
Within my modified copybot app I'd expect nothing to interfere with my MotorRel.sh calls. Does the board stop a running MotorRel movement in some cases? And within the copybot app, I did not alter Helibots MotorRel Parameters. Its not a parameter problem.

I do not have time to look into the code and play around theese days, but I'm very interested in understanding what's going on.

Thanks,
ecap