Canada
Asked — Edited
Resolved Resolved by CochranRobotics!

Learning Synthiam ARC Scripting

I received my new EZB v4 and my developers kit a couple of days ago. Nice stuff! I plan to convert my robot from it's current OS over the EZ-Robot. This will be challenging as it has 26 servos, a camera and a PIR sensor.

I have been working on a couple of EZB scripts and I have been successful in getting a robotic finger to move, using the "Auto position", Yahoo. I am having trouble programming in what is required for voice commands in the "Speech Recognition" window. Is there a video or explanation of how to do this somewhere?

Thanks


ARC Pro

Upgrade to ARC Pro

Subscribe to ARC Pro, and your robot will become a canvas for your imagination, limited only by your creativity.

#1  
  1. Have you done voice training on your PC (to respond to your voice)?

  2. Have you checked out the online learning section here on how to use voice rec and scripting?

  3. Each control has a ?... when you click on it, it will take you online here for info on that particular control...

It is very difficult to explain what you want to do... Kind of like asking how do you build a car... Where does one start?.... For one thing, start with simple commands in the speech rec control like "Robot how are you" then in the corresponding script type in ... Say("I am fine, how are you?").... This is a start..... and simple enough to get you started....

#2  

Hey Richard thanks for your help. Here's what I'm trying to do; I want to use a voice command to move a servo, ie. Robot close finger. My Microphone and speech recognition is configured and working properly. I don't understand what I have to enter in the "settings" for the Speech Recognition, or is that where I put that in?

United Kingdom
#3  

The "settings" for SR are EZ-Scripts.

The simplest method would be to create the frames in the auto-position control and use the ControlCommand() script command to control the auto-position control.

ControlCommand() and all other script commands are explained in the EZ-Script Manual

Also, it may pay to check through the example projects in ARC. There are example projects for every control and every script command. These should help show you what they do.

#4  

The first box (line) in the voice rec control is your command that you speak... By default I think it says Robot move forward or something like that.... You can delete that and try typing in (without the quotes) "Robot close fingers" .... After that, In the box next to it is the script you want to run when you speak that phrase... So you could write something like ... servo(D0,150)....

What this does is when you say Robot close fingers, servo D0 will move to position 150....

The 2nd line another voice command and the adjacent script..... and so on....

#5  

Thanks Rich and Richard R. @Richard R I did as you suggested and put in my Voice command and the desired servo movement and it worked!. When I put in an "Action" I have created It does not work, it tells me I haven't "passed 2 parameters". How do I get an Action to respond to a voice command?

Say Richard R, what part of Canada are you from?

#6  

You have typed something in wrong if you are getting the "passed 2 parameters" error... check your syntax....

I live near Kitchener, Ontario...

Glad your making progress, keep experimenting... you'll get it.... :)

#7  

Hi, still can get the voice command to work for an "Action", here's what I've tried;

In Settings for Speech Recognition, under the Phrase Tab I have put - Move finger - and under the Command Tab, I have put - Servo(D0,90) and that works when I say the command - Move Finger;

I have made an "Action" and named it - move - and when I put - move() - in the Command Tab it doesn't work. and I get "Error line1; unknown window Control Command; move"

What am I doing wrong?

#8  

ControlCommand("Auto Position 2", AutoPositionAction, "Move")

The first parameter is the name of the Auto Position control you have. The last is the name of the action.

#9  

Thanks d.cochran, that worked! Now to get the camera to track something, this will be fun! Standby I'll probably need help with this too!

#10  

Right on! This is going good, I've got the camera to track a color, a face and motion - very easy to set up. I've got it so it will do an action when it see's the color red. The "Revolution Overview" video is really helpful.

#11  

How do I link 2 "Actions" together?

Thanks

#12  

In a script, you can call one and then the other. You may have to use the sleep command to allow the first one to complete. Sleep (# of ms)

#13  

I am trying to link 2 Actions together, without success, here's what I have entered in the Event EZ Script Editor;

Say("this is a multi function test") Sleep(4000) ControlCommand("AutoPosition",AutoPositionAction,"move") Sleep(5000) ConrolCommand("AutoPosition",AutoPositionAction,"camera move")

The syntax is correct, however, it will not do it.

Any thoughts, thanks

#14  

Is there even an action associated with your command line ConrolCommand("AutoPosition",AutoPositionAction,"camera move")?

What do you have in your "camera move" action in order to make the camera move? The camera just won't "move" by itself... an action script has to be written to tell the servos (pan and tilt) to move the camera where you want it to go....

Perhaps I am misunderstanding what you're trying to do here....

#15  

A basic Camera tracking example would be (provided you have a camera control, x and y servos attached to the camera and servo tracking enabled)


# for face
ControlCommand("Camera", CameraFaceTrackingEnable)


# for colour
ControlCommand("Camera", CameraColorTrackingEnable)

Canada
#16  

Best way to manage multiple actions is to use EZ-scripting manager (you will find it under tab name scripting where you add control.

Each action will be individual script that you add to script manager and could be called later from a main script

in your main script ex: Start, you will use the control detail tab when you are in script edit mode and select the line under script manager you wish to use.

it will then become:

ControlCommand("Script Manager", ScriptStart, "camera move") sleep(4000) ControlCommand("Script Manager", ScriptStart, "AutoPositionservo move")

#17  

@Richard R, Yes I have a script associated with "camera move" (poor name for the action as it doesn't move a camera, it's just a name I gave it.)

I still can't get a couple of Actions to work under one script and now when I show the camera a red object, the whole ez buider program freezes up and nothing works.

I had it tracking a red object and running a script when it saw the red object, now nothing. Hmmmmmmm

#18  

Ok, I got things back to where I was. Got 2 Actions - with frames and scripts - and they work when executed, I also have the camera tracking a red object and activating an - Action - when it sees the red object. I am still unable to get a script to work that involves 2 Actions I have tried as suggested above but nothing I have tried is working. It shouldn't be this difficult!

Could someone please post a script that shows a script that runs a couple of Actions.

Thanks

#19  

Are you trying to fire one action and when it completes, follow with another action or two actions at the same time?

I just programmed a 65 step little dance thing with my wall-e. It was one frame after another buy ended up being one action. At the end of that, I have it do another action.

It was done by using the sleep command for 56 seconds after the music was started and the dance action was started. At the end of 56 seconds, the second action runs.

I am on my phone right now and can't get to my computer atm. I will post my script for you tomorrow morning.

#20  

I forgot that I could log into that PC remote.

Here is what I did


ControlCommand("Speech Recognition", PauseOn)
ControlCommand("Soundboard v4", Track_16)
Sleep(1150)
ControlCommand("Auto Position 2", AutoPositionAction, "Patriots")
Sleep(56500)
ControlCommand("Auto Position 2", AutoPositionAction, "Say Walle")
ControlCommand("Speech Recognition", PauseOff)

#21  

@d. cochran Thanks for getting back to me. Yes, I am trying to run one action and when it completes have another action run. I have tried a code similar to your example (see earlier post) in that one that script spoke the text but did nothing else. I'll try it again.

#22  

bhouston, Here is another example that shows multiple actions w/autoposition. It is used in the latest vid of my mini 6 song and dance. Sometimes you have to add or adjust timers to get the desired effect.

ControlCommand("Speech Recognition", PauseOn) sleep(1000) ControlCommand("Soundboard2", Track_8) sleep(700) ControlCommand("Soundboard2", Track_11) sleep(500) ControlCommand("Auto Position", AutoPositionAction, "Circle Dance") sleep(3500) ControlCommand("Auto Position", AutoPositionAction, "Stop")

ControlCommand("Auto Position", AutoPositionAction, "Wave") sleep(3000) ControlCommand("Auto Position", AutoPositionAction, "Stop")

ControlCommand("Auto Position", AutoPositionAction, "Circle Dance") sleep(3000) ControlCommand("Auto Position", AutoPositionAction, "Strafe Right") sleep(4500) #ControlCommand("Auto Position", AutoPositionAction, "Stop") ControlCommand("Auto Position", AutoPositionAction, "Circle Dance") sleep(2000) ControlCommand("Auto Position", AutoPositionAction, "Strafe Left") sleep(5100) ControlCommand("Auto Position", AutoPositionAction, "Circle Dance") sleep(2000) ControlCommand("Auto Position", AutoPositionAction, "Attack") ControlCommand("Auto Position", AutoPositionAction, "Circle Dance") sleep(7500) ControlCommand("Auto Position", AutoPositionAction, "Stop") ControlCommand("Soundboard2", Track_8) sleep(3000) ControlCommand("Speech Recognition", PauseOff)

PRO
Synthiam
#23  

Sounds like you could benefit from reading the ez script introduction here: https://synthiam.com/Tutorials/Help.aspx?id=1003

The introduction will explain how to use the ControlCommand() and how to access the short cuts for the controlcommand()

It'll sure save you a lot of grief :)

#24  

I got multi actions to work in a script. YA! However, for each servo I had to open an "Auto Position" control. When i tried to put mutliple servos in one Auto Position window it kept switching all the servos to the same port. I see, from the example above, that I should be able to program several servos in one Auto Position window. What's the trick?

Thanks again everyone

#25  

In the frame edit mode of this control...

Make sure servo edit check box is checked. Add a servo and set it to the correct digital port for one of your servos. Move this servo control to a location that would represent the location of that servo. Add another servo using the add servo button. Assign it to a correct digital port for the next servo. Move this servo control to a location that would represent the location of that servo. Keep doing this until all of your servos are added.

Turn on the option to have the servos move in real time as you make adjustments. It's a check box at the top right side of the list.

Adjust all of the servos to be what you want your first frame to be and save the frame.

Click the add frame button and give it a name. You will have to find the frame that you just created in the list of frames. Select it and make the adjustments necessary to the servos for the second frame. Save the frame and keep doing this until you have all of your frames you need.

After you have all of your frames, you will want to make these into an action. Add all of the frames in order to make the action adjusting the timing as they are added.

Now you can call this action from a script.

If you have a lot of servos moving at one time in a frame, you may be drawing too much current from your power source. You can reduce this issue by adjusting your frames a bit so that less servos run at one time, or get a stronger power source in terms of amps. It is possible that moving many servos at one time can draw many amps for a quick second.

Please let us know if this works for you. You might also upload your project to the public portion of the cloud so that others can look at it and see if we see anything.

Thanks

#26  

@d.cochran, This is a great explanation on how to use the Auto Position control. If you have time you should write up a tutorial on this. It would really help a lot of us out that are trying to learn this control (including myself).

One other thing I might add about Amp draw and servos. From what I've experienced a servo will also draw a lot of amps not only when it first moves but when it's holding position and/or holding a load. Not sure if this the case with analog servos but it's surly the case with digital servos.

#27  

Thanks everyone, THE LIGHT BULB IS GETTING BRIGHTER! I have some Actions with multiple servos working pretty good. Now I am trying to get a Sound Servo(EZB) to function properly. I need it to move the mouth of my robot. I have got some movement by adjusting the "Update Speed and the "Scaler" values in "Settings" but the mouth movement to the text is not very good. Are there other adjustments somewhere? Do I need to change the default "Variable Name" - $Soundv4Value , to something else? Thanks again.

#28  

I am getting this error message;

9/7/2014 9:36 PM - Sound servo Error: Object is currently in use elsewhere.

I don't understand where else it could be in use, I don't have the port the Sound servo is connected to assigned to anything else.

#29  

Hi, still trying to get a Sound servo to move the mouth servo of my robot correctly. Any help would be appreciated. Also, I need to extend the EZ-Robot camera wires by 12" or so, does anyone know where can I get a cable to do that?

#30  

I havent used the sound servo.

I cut the cable and extended it. It took less time to do this than to order the part. i did use solder and heat shrink It also was no big deal to me because I had to fit this cable through a very small hole which wasn't going to happen without modifying the cable anyway. It is a 6 pin JST cable connector.

#31  

@d.cochran, thanks. That's what I'll do, you are right, probably easier in the long run to modify the cable.

#32  

Thanks everyone for your help. I'll mark this as resolved .