Write task scripts
A task script defines an EROBS sequence in JSON. Create one in a text editor or save a sequence from the Operator GUI.
Start with the ePick example
The repository’s src/cms/tasks/demo_epick_moveto.json moves between two named joint poses. Run your first task shows how to run it with the CMS drylab configuration and mock hardware.
{
"start_gripper": "epick",
"poses": {
"safe_sample_transport": [79.72, -69.5, -81.91, -117.92, -268.05, -157.15],
"safe_tool_exchange": [152.33, -110.63, -100.17, -59.12, -270.43, -207.7]
},
"tasks": [
{
"task_type": "moveto",
"target": "safe_sample_transport",
"planning_type": "joint"
},
{
"task_type": "moveto",
"target": "safe_tool_exchange",
"planning_type": "joint"
}
]
}
Field |
Purpose |
|---|---|
|
Required. Declares the tool already attached and selects its initial MoveIt model. |
|
Optional. Defines named poses as six joint angles in degrees. |
|
Required. A nonempty list of steps, each identified by |
The same three parts appear in every task script, as this annotated example shows:
Here, epick must exist in the active beamline’s grippers configuration. Declaring it does not attach a tool. Likewise, moving to safe_tool_exchange changes the arm position; it does not perform a tool exchange.
Poses defined in the script override shared poses with the same name. Omit them to use the deployment’s pose registry. These example coordinates belong to the CMS setup; use calibrated poses for another installation.
Choose one MoveTo target
For each moveto, specify exactly one of these forms:
Form |
Meaning |
|---|---|
|
A pose defined in the script, a shared pose, or a named robot state from the SRDF. |
|
A relative move in the flange frame, with distance in metres. |
|
Three values (XYZ in metres) or six (XYZ plus roll/pitch/yaw in degrees). |
Do not combine target forms in one step. Relative distance must be finite and greater than zero; Cartesian coordinates must also be finite.
For example, this script requests a 10 mm move along the flange’s positive X axis from the current position:
{
"start_gripper": "epick",
"tasks": [
{
"task_type": "moveto",
"direction": "forward",
"distance": 0.01,
"planning_type": "cartesian"
}
]
}
The direction rotates with the flange. Check the starting pose and preview the movement before executing it. See the MoveTo reference for direction aliases, orientation defaults, and planner options.
Compose a sequence
Add task objects to tasks in the required order. Use the task inventory to find gripper, vision, tool-exchange, and pipettor operations and their fields.
Insert {"task_type": "pause"} where the operator needs to inspect the result. It waits for Resume rather than a fixed duration. A sequence containing a pause cannot be previewed as a whole.
Consecutive moveto and end_effector steps can be planned together as a batch. Vision, tool-exchange, pipettor, and pause steps separate batches. See execution controls for how this affects pausing and cancellation.
Compare previews
Preview supports only moveto and end_effector. With batching enabled, eligible steps are planned as a connected sequence. Without batching, each preview starts from the live robot state, and the GUI replaces the displayed trajectory when the next preview arrives.
In this example, the robot stays at A while targets B and C are previewed. See preview limits for details.
Load and check the script
Save the document as a
.jsonfile and open it with File → Load JSON in the GUI.Check Start Gripper, the task order, and the pose values. Loading a file does not execute it.
For a supported sequence, select Dry Run, press Execute, and inspect the planned motion in 3D View or RViz.
Review the Activity Log for errors and the completed-step count. Follow Preview and execute when ready to run it.
Dry Run is a GUI execution setting, not a task JSON field. Mock hardware is selected at launch; see Run your first task.
The orchestrator validates the document structure, task types, and target formats when it receives the script. That does not verify every pose name, reachability, collision clearance, or device availability; planning and execution check those later. See task execution.