ARC Pro

Upgrade to ARC Pro

Experience early access to the latest features and updates. You'll have everything that is needed to unleash your robot's potential.

Thumbnail

Task Script

by Synthiam Inc.

Split complex tasks into several simple scripts. Each script is a stage of completing a task.

How to add the Task Script robot skill

  1. Load the most recent release of ARC (Get ARC).
  2. Press the Project tab from the top menu bar in ARC.
  3. Press Add Robot Skill from the button ribbon bar in ARC.
  4. Choose the Scripting category tab.
  5. Press the Task Script icon to add the robot skill to your project.

Don't have a robot yet?

Follow the Getting Started Guide to build a robot and use the Task Script robot skill.

How to use the Task Script robot skill

Split complex tasks into several simple scripts. Each script is a stage of completing a task, and they are executed one after another. For example, you can use this to have your robot navigate into a room, look for an item, move toward the object, pick up the article, and return to another point. Each step of the task is split into stages with a script for each stage.

A task contains multiple scripts, and when the script is completed, it waits until it receives the ControlCommand NEXT signal, which moves to the following script. You can also have the task canceled by sending the ControlCommand() CANCEL.

Example


Here is an example flow of a task "Go to the kitchen and get me a soda." The project will have a movement panel, lidar sensor, The Better Navigator, and this robot skill. The task will save the current location, navigate to the kitchen, announce to whoever is there that it needs a soda repeatedly until it hears the OK response, returns to the original location, and announce that it has returned with a soda.

Each step of the task waits for the ControlCommand NEXT to be sent. This can be sent by the script within the Task Script itself or by an external scriptwhen completed. You can see both used in this example. Some of the Task Scripts will call the ControlCommand NEXT to advance to the next item in the list. Otherwise, you can see The Better Navigator sending the ControlCommand NEXT when it has completed navigating.
User-inserted image



Main Window


User-inserted image

You can manually start tasks in the main window, choose a task, and view the log information. These tasks can also be executed by the ControlCommand programmatically.

Configuration


User-inserted image



Configuration - Tasks

1) Add a new task button
This button will add a new task tab below. You can add as many tasks as you like. Each task contains as many scripts as necessary.

2) Task Name
The task's name will be visible in the dropdown and ControlCommand() list.

3) Task Description
The description of the task is for your reference. This is not used anywhere other than displayed back to you. It allows you to keep detailed notes on what the task does.

4) Start Script
This script will execute when the task begins.

5) Cancelled Script
This script will execute when the task has been canceled. This will execute before the Completed Script if the task is canceled.

6) Completed Script
This script will execute when the task has been completed. This also runs when the script is canceled.

7) Script Controls 
These allow inserting and managing scripts. You can move scripts up and down, or insert, delete and append new scripts.

8) Scripts
Each script is executed from the top down. When a script is completed, it will wait for the ControlCommand NEXT to be sent. When it receives the signal, it will execute the following script in the list.


Variables


A few variables are set to make interacting with this robot skill easier.

$TaskScriptIsRunning
Holds true (1) or false (0) if a task is currently running

$TaskScriptTasks
An array of task names. 


Control Commands


You can interact with the robot skill through the ControlCommand from other robot skills.

ControlCommand("Task Script", "Start", "Task Name")
This starts a task from another robot skill programmatically

ControlCommand("Task Script", "Next")
Each script waits for a signal before executing the following script when a task is running. A script can call this command within the task or externally from another robot skill. 

ControlCommand("Task Script", "Cancel")
Cancels a task that is running.

ARC Pro

Upgrade to ARC Pro

ARC Early Access will give you immediate updates and new features needed to unleash your robot's potential!

#1  
Nice, I like this alot! This will clean up a lot of little scripts I have all over the place, one calling the other. 

Is this new or did I just miss it.
PRO
Synthiam
#2  
It was posted last night:)  was made for an enterprise customer that needs to perform many steps to achieve some tasks. It’s real awesome. Can’t believe I didn’t think of it before
PRO
Synthiam
#4  
Oh neat, but ugh what a lot of ugly code lol. I don't get why no one else makes things graphical.... it's like 1975 for the rest of the robot world *shrug*

User-inserted image
PRO
USA
#5   — Edited
Testing out the "Task Script control" this morning with a camera to track face and a car to move forward, reverse and stop

I am clicking "next" to proceed or cancel too end

PRO
Colombia
#6  
HI DJ, I am just trying this and is very useful.:(
PRO
Synthiam
#7  
Right on - it's an excellent utility for assigning a bunch of small tasks into one larger task. Thanks for sharing that video!
PRO
Colombia
#8  
Hi DJ, I made the  example and I received the following message:

Script Start
Script Error: ControlCommand Error for 'The Better Navigator' sending 'GoToLocation'. Input string was not in a correct format.
Script Done (00:00:00.4556473)

Thanks in advance for any suggestion.