Skills

What a skill is, the three files it is made of, and the rules that hold for every skill.

A skill is one robot action written as a Python function: move a plate from one seat to another, open a lid, read an instrument. Workflows chain skills together and pass them their inputs.

Each skill lives in its own folder, skills/<skill_id>/, with three files:

FileWhat it holds
metadata.yamlThe skill's id, version, description and tags. See The skill metadata file.
modules.pyOne line that imports the skill API: from execution.skill_api import *.
robotic_code.pyThe function def <skill_id>(...). It imports the names it uses from .modules.

zeon new skill <name> writes all three. The starter project ships two complete skills to read: move_plate (pick a plate up and set it on a seat) and shaker_lid (open or close a hinged lid).

Rules that hold for every skill

  • The folder name, the skill_id in metadata.yaml and the function name are the same. Use lowercase letters, digits and underscores.
  • The function signature is the skill's inputs. Each parameter becomes an input, with its type from the annotation and its default from the default value. metadata.yaml is not where parameters are defined.
  • A skill fails by raising an exception. The return value is recorded with the run but does not decide success. Returning {"success": False} does not fail the step.
  • Geometry comes from anchors on objects, not from numbers in code. A skill reads where to go from the object model (anchor(plate, "grasp_short")), so it keeps working when an object moves or an anchor is re-taught.
  • Every move is planned and collision-checked before the arm moves. When a move cannot be made, the call raises a SkillError that says why.

Read next


Did this page help you?