Asked — Edited

Stopping An Action


This is a basic scripting question. I figured out how to do QR code tracking. It's pretty straight forward. I entered a word into the QR code generator and then created a script to speak the word in the Camera config. Then I figured out that a QR code could also trigger an action:

Format Code 1: ControlCommand("Auto Position", AutoPositionAction, "3 Legs Dance")

Works great. The question is, what scripting do I enter to get Six to stop dancing after say, a few seconds? Follow up question - where do I enter the script - Format Code 2?




Upgrade to ARC Pro

ARC Pro is more than a tool; it's a creative playground for robot enthusiasts, where you can turn your wildest ideas into reality.


Hey Tom,

This code should work:

ControlCommand("Auto Position", AutoPositionAction, "3 Legs Dance")
ControlCommand("Auto Position", AutoPositionAction, "Stop")

Basically what's happening is

  1. Start the "3 Legs Dance" action
  2. Stop the script for 2000 milliseconds (2 seconds)
  3. Start the "Stop" action which puts the robot back into the neutral position, stopping the dance.

Hope this helps!


Assuming you want it in the same script, and stop on its own after some number of seconds (I'll use 5 in my sample), your script would look like this:

ControlCommand("Auto Position", AutoPositionAction, "3 Legs Dance")
ControlCommand("Auto Position", AutoPositionStop)

The Sleep command expects milliseconds.

You could also create a "stop" AutoPositionAction which returns everything to a resting position, in which case your last line would be:

ControlCommand("Auto Position", AutoPositionAction, "Stop")

You can also have other scripts issue the stop command, so for instance, it would keep dancing until you tell it to stop, or some other event occurs rather than just a simple timer.



Works! I also used voice recognition and said "robot stop." That worked too.

Thanks again.