Asked — Edited

Looping Scripting Recorder Question

I need a little input. I'm trying to use ControlCommand() in a script to loop a 60 second prerecorded animation that used the scripting recorder. I have the ability to play forward and reverse, but I'd like to be able to loop the animation indefinitely. Seems simple but i must be missing something.


ARC Pro

Upgrade to ARC Pro

Stay on the cutting edge of robotics with ARC Pro, guaranteeing that your robot is always ahead of the game.

#1  

If you have the pre-recorded script change a variable at the end, you can wait for the variable to change in the cue-ing script and then loop back to the start and wait.

Cueing script would be:


:loop
$variable = 0
Controlcommand()

 WaitFor($variable = 1)

Sleep(500)
Goto(loop)

Pre-recorded script should end with:


$variable = 1

PRO
Synthiam
#2  

:loop

ControlCommand("Recorder", PlayForward)

# Pause for 90 seconds
sleep(90 * 1000)

goto(loop)

PRO
USA
#3  

@dj, That's how I wrote the script the first time, but would only run the sprint recorder once with an error that the ControlCommand() line "is a background worker is currently busy and cannot run multiple tasks concurrently." Stops after playing once.

I have clean new project with nothing else but one script recorder.

PRO
Synthiam
#4  

Change the sleep time to give the recorder enough time to finish


:loop

ControlCommand("Recorder", PlayForward)

# Pause for 92 seconds
sleep(92 * 1000)

goto(loop)

PRO
USA
#5  

Ok I used 500 ms. Will try with longer sleep.

PRO
Synthiam
#6  

Yeah - I can add a variable that will keep the state in a future release for you if this is a control used often

PRO
USA
#7  

Yes that would be great! I use it script recorder often to blend and stack animations using the touch pad. Having a way to loop those animations indefinitely, would be so beneficial.

PRO
USA
#8  

@DJ, I'm trying to get some similar looping random type movements. I've tried the Personality generator for the first time. I like the idea, but it says" ControlCommand is not supported for this control" ( this was a script recorder animation). It would be nice to be able to call up various prerecorded script recorders for random animations as well. Is this possible now or something for the future, perhaps?

Edit: A "stop" added to the ControlCommand would be great as well.

PRO
USA
#9  

@DJ, I don't use the recorder in any of my projects yet but would the ScriptStartWait work?