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.
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);
Is this out of date? There doesn't seem to be a GetConfiguration function within EZ_Builder.Config.Sub.PluginV1
Look at the tutorial step titled Code: Saving/Loading Configuration
The get and set configuration methods are overrides of the form. There’s a great video on the first step of this tutorial that demonstrates the step by step of building a plugin. I recommend watching that because it helps fill in any steps that were missed.
When you’ve done it once, it makes sense and voila, you can rinse and repeat
Excellent, thanks - I will do. I really must learn not to just jump ahead in the process
Hey no problem - I do it all the time, and end up frustrated because I dont know what it was that I missed. Excitement gets the best of me
Trying to follow the tutorials but can't find where the plugin page has gone. How do I add a new plugin to the ez-robot / Synthiam site to get the XML?
Never mind. Just found the "Create skill control" link
I am trying to follow the instructions for adding my own plugin but I cannot seem to find the place to register the plugin based on the instructions.
Any help is appreciated.
Thanks
The new button to create a plugin skill control is less than an inch below the button you pressed to create this question.