Society of Robots - Robot Forum

Software => Software => Topic started by: Ro-Bot-X on March 10, 2009, 02:58:43 PM

Title: Storing arm positions for latter playback
Post by: Ro-Bot-X on March 10, 2009, 02:58:43 PM
Ok, so I'm building a robot that will have an arm capable of grabbing stuff. I was thinking of haveing some stored sequences of arm movements and play them at the proper time. Any ideas on how to do this? I mean write arrays for each servo, or for each specific movement or what? How would you do it?
Title: Re: Storing arm positions for latter playback
Post by: pomprocker on March 10, 2009, 06:13:23 PM
eeprom
Title: Re: Storing arm positions for latter playback
Post by: Ro-Bot-X on March 10, 2009, 06:44:12 PM
eeprom

Yeah, that tells me where to store not how to do it  :-\
I know how to work with the eeprom. The question is what is the best and economical way to store servo positions and play them at the apropriate time.

Come on, no one has built robots with arms before?
Title: Re: Storing arm positions for latter playback
Post by: householdutensils on March 10, 2009, 07:03:15 PM
I don't know if it's any help but for my initial design for my robotic arm, I was thinking of using a movement function and just passing it arguments stored in eeprom.

Basically, my idea was to pass the order, and angles of my servos to the function and get it to do the grunt work.

So you pull the movement you want out of eeprom and pass it to the function so that you end up with something like

arm_move('a', 'b', 'c', '30', '50', '20')

which moves servo A 30 degrees, servo B 50 degrees, and servo C 20 degrees in that order.

I wanted to be able to generate custom movements at runtime so that's why I set it up as a function that takes all those arguments as opposed to static functions like arm_move(1) and store the pattens in the function or eeprom and call them from within the function. It adds an extra step before you call the function, but it seemed the best option for me.

I never got around to actually prototyping or even writing it out in pseudocode, so the ideas probably full of faults and holes.
Title: Re: Storing arm positions for latter playback
Post by: airman00 on March 10, 2009, 08:44:34 PM
just write up subroutines a.k.a. macros.

Then just call them in your code when you need them.
Title: Re: Storing arm positions for latter playback
Post by: Ro-Bot-X on March 10, 2009, 09:53:10 PM
Thanks, I think I like the function idea better than the subroutines. I'll see what I can do, if I still cant get it to work, I'll ask for more help.
Title: Re: Storing arm positions for latter playback
Post by: airman00 on March 10, 2009, 10:01:36 PM
Thanks, I think I like the function idea better than the subroutines. I'll see what I can do, if I still cant get it to work, I'll ask for more help.
what I was referring to , is what you call functions.

I've been using VB6, but I dunno if the syntax stands for all languages. Functions involves returning a variable to the main code, subroutines take in variables(or no variables at all).

So Arm(30,50,60); is a subroutine
but variable = Add(4,5); is a function
Title: Re: Storing arm positions for latter playback
Post by: householdutensils on March 10, 2009, 10:08:54 PM
I think technically a function is a subroutine, since the term subroutine is used to describe a programming structure that spans multiple languages, that is, a method within a class is a subroutine, a function is a subroutine, a procedure is a subroutine etc. In the wider view of things, whether or not it returns a value is really irrelevant.

That being said, I believe your right about that terminology when applied to VB6.
Title: Re: Storing arm positions for latter playback
Post by: Admin on April 07, 2009, 11:02:45 PM
Just use my biped engine. This is what I use to control the arms on my ERP and a biped for a customer of mine. I'll be uploading video of my ERP doing arm stuff when I get more time.

http://www.societyofrobots.com/sor_biped_engine.shtml (http://www.societyofrobots.com/sor_biped_engine.shtml)