reflexes
Ready-made reactive behaviors over the reactive layer: intercept catches an object moving past with a visual-servo controller, without the model.
- Layer: reactive (optional: only where a configuration enables it)
- Needs: segmenter
- Requires: eef, reactive
- Conflicts with: –
- Never dropped: no
- Mixin:
skills.reflexes:Reflexes - Manifest:
skills/reflexes/skill.toml
Functions
Section titled “Functions”intercept
Section titled “intercept”def intercept(arm, object, max_seconds=20.0, camera='cam_head', lead_seconds=LEAD_S)Catch object (an id from the last locate) with arm while it moves past, as
on a conveyor, then lift it LIFT_M. A controller follows the object’s image patch
in the camera’s images every control tick, aims the open jaws at where it will be,
comes down when they are above it and closes while still following; the model is
not asked while it runs. Locate the object just before (its mask in camera
gives its look); the jaws must be open. The lift goes straight up, or, where that
is out of reach (the far side of a belt), partly back toward the arm’s base. Returns {“caught”: bool, “phase”,
“sightings”, “controller”: trace, “lift”: trace or None}; “caught” means the
jaws closed at the object, so check the grip (the scene after the program, or
holding) before relying on it.
What the model reads
Section titled “What the model reads”From the RoboDojo prompt pack (prompts/robodojo/), with every skill and feature on (reflexes in place of ):
intercept(arm, "o2", max_seconds=20) catch an object that moves past (on a conveyor): a controller follows its colour in the head camera every control tick, aims the open jaws where it will be, comes down when above it and closes while still following, then lifts it 10 cm; you are not asked while it runs. Locate the object just before (its outline gives the colour); the jaws must be open. Returns {"caught", "phase", "sightings", ...}; "caught" means the jaws closed at the object, so check the grip next turn before relying on it.