
robotz12248
OK, so far I've gotten my omnibot, EZ-B, servos, and camera. I've accomplished speech control with the head servo, and arm movment. The camera was checked out and I have to set it up.( Pretty sure I got that covered.) Still waiting on my motor controller from Sparkfun. I feel I'm making slow, but positive progress. Now I'd like to learn how to set up servos (one to start with would be fine) for a series of movements; looped. Like when DJ tells Walle to dance!
I'm actually trying to do the "Dancing Android" project, which would be a series of movements (i.e. head turns, arms move, body turns) in what would appear to be in time to music. I have a VerBot and 4 HTX 900 servos I'd like to use. I'm thinking it would involve "scripting" ; but just not sure how to go about it. Could I talk one of you more advanced users out there to give me a tutorial on how to accomplish this?? I would be greatly in your debt!
Thanks,
Lloyd
PS: any help I get will definitely be "payed forward" once I become accomplished.
1 Servo(D8, 1)
2 Servo(D9, 1)
3 Sleep(1000)
4 Servo(D8, 18)
5 Servo(D9, 18)
6 Sleep(1000)
7 Servo(D8, 36)
8 Servo(D9, 36)
9 Sleep(1000)
10 Servo(D8, 18)
11 Servo(D9, 18)
12 Sleep(1000)
13 Servo(D8, 1)
14 Servo(D9, 1)
15 Sleep(500)
16 Servo(D8, 36)
17 Servo(D9, 36)
18 Servo(D8, 1)
19 Servo(D9, 1)
20 Servo(D8, 36)
21 Servo(D9, 36)
22 Sleep(500)
23 Servo(D8, 1)
24 Servo(D9, 1)
25 Servo(D8, 36)
26 Servo(D9, 36)
27 Servo(D8, 18)
28 Servo(D9, 18)
Then I checked "Repeat"
After I hit start both servos moved in unison. Did I do it correctly? Is there another way?
Now I want to add a servo for the head movement. Do I add it in after lines 1 and 2? And a servo for body movement. the same???? I just feel sooooooooooooooo accomplished!!!!LOL
You have a few options... One, you can indeed add the head movements in there. Or you can create another script window with the head movements. Then you can launch both at the same time from another script
But since it's music, and music is math... There is a pattern. So you might as well do it in a single script.
Do you think I should start a "free sample scripts" forum category?
I don't want to make the forum cluttered, but it would be nice to just copy paste samples, and choose from a list, like :
Servo scripts:
1. Left arm wave (with 1 dof slow)
2. Left arm wave (with 2 dof slow)
3. Left arm wave (with 3 dof slow)
4. Left arm wave (with 1 dof fast)
5. Left arm wave (with 2 dof fast)
6. Left arm wave (with 3 dof fast)
7. Head spin (1 time, clockwise)*
8. Head spin (2 times, clockwise)*
9. head movement ("no" answer, back and forth 3 times)***
10. Head movement ("yes" answer, up and down 3 times)***
*warning, must use 360 degree servo for this script or risk damage to
Servos, parts, ez-b, etc
** servo needs to be mounted appropriately to go up/down or left/right. (horizontal/vertical selection)
*** you may edit numbers in the script so servo moves arm/head/etc a certain number of times, such as you may want the "yes" answer to go up,down,up,down and that would need a "2" in that script.
I also want to make some for led flashing.
TJ
Http://www.TheGoodRobot.com