Skip to Content

Sorting recycling

A volunteer tosses two bottles from a counter into a basket, one with each hand.

Loading the take.

Each person is a chain of typed actions from @automovie/motions. This is what an agent writes for the scene; Composing motion explains the parts.

import type { IAutoMovieMotionHumanBody, IAutoMovieMotionHumanPerformance } from "@automovie/interface";
import { HumanChain, HumanObject, HumanPerformance, HumanSelfActionRows, HumanThrownWeapon } from "@automovie/motions";
import * as archetypes from "@automovie/archetypes";

const counter = archetypes.createTable({ kind: "counter" });
const counterAt = { at: { x: 0, y: 0, z: 0.53 }, yaw: 180 };
const bottle = archetypes.createDrinkware({ kind: "waterBottle" });
const bottleAt = { at: { x: -0.18, y: 0.914, z: 0.3 }, yaw: 0 };
const bottle2 = archetypes.createDrinkware({ kind: "waterBottle" });
const bottle2At = { at: { x: 0.18, y: 0.914, z: 0.3 }, yaw: 0 };
const basket = archetypes.createTray({ kind: "basket" });
const basketAt = { at: { x: 0, y: 0, z: 1 }, yaw: 0 };

// volunteer: body f1, at (0, 0) m, facing 0°, trained
const volunteer = HumanChain.subject("volunteer")
  .act("pickUp", { prop: "bottle", handle: "body" })
  .registered("hurlBottle", {
      prop: "bottle",
      at: { kind: "prop", subject: "basket", point: "inside" },
    })
  .act("pickUp", { prop: "bottle2", handle: "body", hand: "left" })
  .registered("hurlBottle", {
      prop: "bottle2",
      hand: "left",
      at: { kind: "prop", subject: "basket", point: "inside" },
    })
  .registered("selfFistPump", { count: 1 });

const scene = volunteer;

// The lexicon's laws this scene's rows perform, registered with the performance.
const laws = [HumanThrownWeapon.hurlBottle, HumanSelfActionRows.selfFistPump];

const props = [
  HumanObject.prop("counter", counter, counterAt),
  HumanObject.prop("bottle", bottle, bottleAt),
  HumanObject.prop("bottle2", bottle2, bottle2At),
  HumanObject.prop("basket", basket, basketAt),
];

// Each body id's motion body, prepared from the site's measures.
declare const bodies: Record<string, IAutoMovieMotionHumanBody>;

const input: IAutoMovieMotionHumanPerformance.IInput = {
  seed: "sorting-recycling",
  performers: [
    { subject: "volunteer", body: bodies["f1"]!, at: { x: 0, y: 0, z: 0 }, yaw: 0, proficiency: { level: "trained" } },
  ],
  composition: scene.node,
  props,
  laws,
};
const performance = new HumanPerformance(input);