Welcome to Synthiam!

Program robots using technologies created from industry experts. ARC is our free-to-use robot programming software that makes features like vision recognition, navigation and artificial intelligence easy.

Get Started
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

#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)

Code:


# for face
ControlCommand("Camera", CameraFaceTrackingEnable)



Code:


# 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

Code:


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.
PRO
USA
#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)
#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 .