Behavior Control
Created
Updated
Index

Servo Recorder

Control Thumbnail

How To Download and Use This Control

  1. Make sure you have the latest version of EZ-Builder installed.
  2. Select the Install button below to download the file.
  3. Double click the downloaded file to open installer.
  4. The installer will add this control to EZ-Builder.

This plugin allows recording and playing servo movements. Trigger the recordings using ControlCommand() from scripts.

Realistic Motions
For realistic motion recordings, we recommend creating the recordings with the servo Pad Control. Find more information about the servo Pad here: http://www.ez-robot.com/Tutorials/Help.aspx?id=150

Recording
You can store multiple recordings in this plugin. Each can be given a unique name that allows the recordings to be differentiated - click on the name to rename a recording. Pressing the Add button will append a new recording instance to the list. You may re-record over existing recordings as well. Press the Record button, which will set the instance to begin recording at the first servo movement.

Playback
Individual or multiple recordings can be played back manually by pressing the Play button. Programmatically, you can play recordings using ezscript or Blockly. In Blockly, select the recording from the ControlCommand() block located under Utility. With ezscript, the Cheat Sheet shows the ControlCommand() for starting and stopping the playback of each recording.

Variable
There is a variable that returns the status of the playback of recordings. If a recording is being played back, the variable $IsServoRecorderRunning will be true. You can wait for a playback to complete by using WaitFor(). See this example code below, which will run Test 1, Test 2 and Test 3 recordings one after another. The WaitFor() will wait to see when the recording has completed, and the Sleep(100) is merely to ensure the recording has started before checking the variable. The sleep(100) is most likely not required, and my tests without it worked - but I put it in for safe practice. Test in your application to see if it's required as well, it may not be.

Code:

print("Playing test 1")

ControlCommand("Servo Recorder", Play, "test 1")

# Wait a short while to ensure record is running
sleep(100)

# Wait for the recorder to stop running
waitfor($IsServoRecorderRunning = false)

print("Playing test 2")

ControlCommand("Servo Recorder", Play, "test 2")

# Wait a short while to ensure record is running
sleep(100)

# Wait for the recorder to stop running
waitfor($IsServoRecorderRunning = false)

print("Playing test 3")

ControlCommand("Servo Recorder", Play, "test 3")

# Wait a short while to ensure record is running
sleep(100)

# Wait for the recorder to stop running
waitfor($IsServoRecorderRunning = false)



User-inserted image

#11   — Edited
I did try both, 0 and false.  Neither worked for me. When I run the above script, all the other servo recorder play buttons are active at the same time (red). See Pic and you can see the variable watch throwing back a 1 as true its running and running all the servo recorders at once.

And yes, it was stupid to have the robot active during this stage of testing..that wont happen again.
User-inserted image
Synthiam
#12   — Edited
Ooops - I was distracted with family on new years eve and didn't pay attention to the example code syntax. Check the description now, it has the correct WaitFor() syntax. WaitFor() expects an expression.

Code:


ControlCommand("Servo Recorder", Play, "test 1")

# Wait a short while to ensure record is running
sleep(100)

# Wait for the recorder to stop running
waitfor($IsServoRecorderRunning = false)

print("Playing test 2")

ControlCommand("Servo Recorder", Play, "test 2")


This is a good example that you can proof my work in the future:). Next time check the EZ-Script manual to see if i presented the correct syntax, because I'm not perfect haha
#13  
Much better. Thank you, now works as advertised!
#14  
Is there a reason why this control does not have an option to move to other desktops using right click in the title bar? When i save and reload the servo recorder windows move from desktop to desktop but don't have the option to move them back ie F11,F12 etc
Synthiam
#15  
Plugins don't support that currently
#16  
Ok Thanks very much. And again thanks for this variable!!