What you can use in the REPL

The names the REPL defines for you: the skill API, skills, run_workflow, brief, snapshot, look, say and sim. All of them act on the simulation.

The REPL starts with these names already defined. You do not import them. All of them act on the simulation of your cell; none reaches real hardware.

The skill API

Every name a skill gets from from execution.skill_api import * is defined in the REPL: move_arm, move_arm_js, move_relative, set_gripper, attach, release, anchor, list_anchors, resolve, list_objects, get_object_pose, get_tcp_pose, get_joints, holding, get_articulation and the rest. They behave as they do in a skill: a move is planned and checked for collisions before the arm moves, and a move that cannot be made raises a SkillError and moves nothing. See Skill API.

The helpers that are not part of the star import are imported by name, as in a skill:

from execution.skill_api import FREE_YAW, Tolerance, deg, mm

Code that uses only the skill API can go into a skill's robotic_code.py unchanged. The names below exist only in the REPL.

Names the REPL adds

NameWhat it does
skillsThe project's skills. skills.<id>(name=value, ...) runs skill <id> in the simulation, as a workflow node would, and returns what the skill returns. skills.list() lists the skill ids; skills.source("<id>") returns a skill's code.
run_workflow(id, inputs=None)Starts workflow id in the simulation and returns at once. The reply's execution_id is the run id.
brief()The project, the setup the instance runs, the world and its objects, the arms (arms: each arm's side, what it is holding, at_start, joints), the project's active_workflow, the skills and workflows with their inputs, and recent runs, as a dict. zeon brief prints the same as text.
snapshot("sim")Takes a picture of the simulation viewer and saves it on the instance. To get the picture on your computer, use zeon snap.
look(target, seconds=6.0)Points the viewer camera at target and highlights it. target is an object id, <holder>.<anchor>, or a preset name from viewer.yaml.
gizmos(visible=None)With no argument, returns whether the viewer shows its gizmos (the object and arm handles, the grid and the workspace box). gizmos(False) hides them and gizmos(True) shows them, for every view of the simulation, including the app. Returns the new state.
say(text)Posts text to the viewer's Agent panel.
simThe simulated cell. sim.world is its world model. Read and change the world through the skill API.

help(name) and name? print a function's signature and docstring: help(move_arm).

Running a skill: skills.<id>

skills.shaker_lid(lid="open")
skills.move_plate(plate="wellplate", source="wellplate_stand_1",
                  destination="wellplate_stand_2", destination_anchor="top_center")
  • Pass inputs by name. An input you leave out takes the default of the skill's function.
  • An object input takes the object's instance id. (zeon run also accepts a display name or a type with one instance in the world, and maps it to the id.)
  • The skill runs the code the instance has loaded. After you edit it, zeon sync (it prints instance refreshed) before calling it again.
  • A call is not a run: it has no run id and no run log. For a run with a log, use zeon run <id>.
  • A failure raises an exception with the skill's error. The world stays as the skill left it.

Running a workflow: run_workflow

r = run_workflow("plate_through_shaker", {"shaker_slot": "slot_1"})
r["execution_id"]
  • id is the workflow id (the workflow_id in its file), not its display name. brief() lists both.
  • inputs is a dict of workflow inputs. Inputs you leave out take their declared defaults.
  • It returns once the run has started. Follow the run from the terminal: zeon wait ID, zeon logs ID -f.
  • To run a workflow you have just edited and synced, use zeon run NAME, which always runs the pushed file.

What is not available

  • Real hardware. The REPL drives the simulation only.
  • Zeon's own modules other than the skill API, environment variables and credentials. The guard refuses code that reaches for them; the refusal says what to use instead.

Did this page help you?