Make an ARC Skill

Example: Move Servos

If you wish to move a servo, it can be done one of two ways. You can specify the servo to move directly, or take advantage of ARC built in servo helpers.

The servo helpers are what you find throughout the ARC interface, when prompting users to select a servo in configuration screens. The user can always select one or more servos that have a relationship to each other, including inverting. It also allows the user to specify a MIN and MAX for each servo.

User-inserted image

The servo Helper in ARC makes moving servos a breeze - and that will make your plugin interact with servos much easier, without having to perform all the relationship math and limits yourself.

Servo Movements (Raw) To move a servo with raw commands, not using the servo helper, here is path to the class:

ARC.EZBManager.EZBs[0].Servo

It is non recommended to set servo positions using this method, unless they are non user-configurable servos. If your plugin expects users to configure the servos, use the UCServoSelection object and the helper methods below.

Servo Movements (UCServoSelection) The ARC UI has the ability for users to specify multiple servos and have the positions relative to each other with invert options, etc This can be viewed in the sourcecode for the Click servo plugin here: https://synthiam.com/Software/Manual/16147

You can install that plugin to see how it works, and watch the video on how to set it up. The example in that source code demonstrates how to use the UCServoSelection user control for users to specify multiple servos, if you choose to go this route. You will notice that the array collection of servos is passed to helper commands in the ARC.EZBManager directly.

By using the UCServoSelection and ARC.EZBManager helper methods, the servo configuration can be easily stored in the project file and passed to helper methods for executing. For example, to extract and store the user's servo configuration from a UCServoSelection into the project file can be like so...


_cf.SERVOS.AddOrUpdate(ConfigurationDictionary._HORIZONTAL_SERVOS, ucServoSelectionX.Config);

_cf.SERVOS.AddOrUpdate(ConfigurationDictionary._VERTICAL_SERVOS, ucServoSelectionY.Config);

Now to move the servos from the configuration _cf.SERVOS file, simply do the following...


ARC.EZBManager.SetServoIncrement(_cf.SERVOS[ConfigurationDictionary._HORIZONTAL_SERVOS], -1);

ARC.EZBManager.SetServoIncrement(_cf.SERVOS[ConfigurationDictionary._VERTICAL_SERVOS], 1);


ARC Pro

Upgrade to ARC Pro

ARC Pro is your gateway to a community of like-minded robot enthusiasts and professionals, all united by a passion for advanced robot programming.

#9  

Thanks for the quick response.

This what happens when you are working on robotics when its way past your bed time.

You miss the obvious

PRO
Synthiam
#10  

No problem - i get it:D

#11  

User-inserted image

User-inserted image

User-inserted image

User-inserted image

Sorry but can I ask you something why I didn't see the ARC library when I added visual studio even though I set up the C ++. DLL library and there's another way to execute it and send / receive console in out but I don't know how to do it with EZ_builder?

PRO
Synthiam
#12   — Edited

Please follow the tutorial. It’s impossible to know why you’re plug-in isn’t showing up without asking you if you followed each step of the tutorial:). Reviewing your screenshots, it doesn’t appear as if any of the tutorial steps have been followed.

#13   — Edited

Hi i fixed it. thanks

Hello, I am trying the tutorial to get the robot to speak. I am using Visual studio. Currently, the sound is output from the pc instead of the robot. Is there a code I can attach so that the sound comes from the robot speakers instead of the pc?

PRO
Synthiam
#14   — Edited

Look in this tutorial for the step labeled "output audio from ezb". It’s lower down in the list. There’s instruction examples for either playing audio (ie mp3) or text to speech.

#15  

Error: the referenced component" EZ_builder,EZ_B" could not be found, DJ Sure i hope you can help me !

PRO
Synthiam
#16   — Edited

User-inserted image

Joinny, you have to add the referencing by following the instructions in this tutorial. They are outlined with step by step to easily follow. Click add references, and browse to the appropriate files as directed in the tutorial. I can’t write anything clearer in response. The step to add references is incredibly clear but you’re skipping it.