Install
megantk and numpy. The core CLI and the hosted client need
neither, and nothing is imported until you touch Megan.
The whole loop
Instructions must parse
megan plans from a verb with an object, and a destination when something is being placed:Teach every entity, including the gripper
aligned, near and over are relations between the hand and an object.
With no prototype for the hand they cannot be evaluated, megan reports blind
on every frame, and you see no guidance at all.
rgb=True if your frame is already RGB. Exactly one of uv, xy, box.
teach writes both halves of the appearance model — a colour example and a
normalised-cross-correlation template in feature space — because the template
alone does not create the prototype, and colour alone cannot separate two
objects that share it. It also registers the bare noun phrase alongside the
article form (red block as well as the red block), so a lookup cannot miss
by an article.Stepping
Action width is handled for you, and this one bites hard otherwise. megan
reads the commanded gripper from
proposed[:, 6] — six pose degrees of freedom
then the gripper. A narrower action vector (a 5-joint arm plus a gripper, say)
raises IndexError from deep inside a risk evaluation, a long way from the
cause. step pads into the expected layout and mirrors your last column into
the gripper slot, so commanded_grip reads what you meant.Diagnosing a quiet megan
A megan that produces no guidance is either satisfied or blind, and they need opposite fixes.blind() is True on every step, you are missing a prototype — check
untaught() before concluding megan has nothing to offer.
The wake gate
megan can learn when intervening is worth it, from a run in which it did not intervene. Build features from its risk reports, label the frames where help was about to be needed, and fit:Reference
Megan(instruction, *, grounder=None, experience=None, warn=True, **governor_kwargs)
Errors
MeganUnavailable (a RuntimeError) when megantk is not importable, kept
distinct from a bare ImportError so you can tell “megan is not installed”
from a bug in your own imports. relational_available() checks without
raising.