VM-2 mill part change with a Franka Panda
harbor run -t reactive-labs/mill-part-changeharbor download reactive-labs/mill-part-changeHi,
Cell 4 has a Franka Panda next to the VM-2 mill, and we want it to do the part change between cycles without an operator. One change: pull the sliding guard door open past its open latch, unlock the cam-lever vise, take the finished part out and set it in the corner of the inspection plate against both stops, take the right blank from the tray (the traveller gives its size and stripe colour; there is a look-alike op 20 blank 4 mm longer with the same stripe, and a blank from another job), load it striped datum edge to the fixed jaw, press it onto the parallels in the force window, lock the lever to the clamp torque window, close the door onto its latch, press CYCLE START and wait for the green CYCLE COMPLETE lamp. Nothing reports where anything is: the arm has an overhead camera with depth, a wrist camera, its joint readings and a hand force estimate. Things go wrong in the cell (a chip left under the blank, the lever springing back off its lock, the door bouncing off its latch) and the controller has to notice and put it right. If the gripper stops responding it keeps hold of whatever it has and parks; if the wrist camera freezes it sets down what it holds and parks; either way it says which one failed.
Everything is in /app:
REQUEST.md), the traveller (TRAVELLER.md), the vise data sheet (VISE_SHEET.md, rev B: its clamp
torque is from the old cam) and the current cell rules with the revision note, order of the change, limits,
upsets, faults and acceptance groups (CELL_RULES.md);ATTEMPT_LOG.md);scene.xml, robot/) and the acceptance setup (task.py, gauntlet/);python3 /app/run_gauntlet.py --controller /app/controller.py --tiers T0,T1,T2,T3,T4 --episodes 2
(add --band in_between or --band outside for the other layouts).The motion-planning, vision and sim-to-real skills our integrator uses are in /app/skills/.
Please write /app/controller.py with a Controller class (__init__(model_info), reset(obs), act(obs)).
act returns the 8 position commands (7 joints in radians, then the opening of one finger in metres, 0 to 0.04)
or a status: {"status": "done"} or {"status": "abort", "fault": "dead_gripper"} / "wrist_cam_freeze".
Don't change scene.xml, task.py or robot/panda.xml.
Thanks, Cell 4 lead, Kestrel Works machining
/app/controller.py. It runs in its own process and receives only model_info (keys control_dt_s,
episode_s, timestep, joint_names, actuator_names, ctrl_low, ctrl_high, observed_bodies,
perception_hz, scene_xml, max_command_step_frac, arm_prefixes, cameras) and, every 20 ms, the
observation (keys time, qpos, qvel, ctrl, objects, objects_stamp, images, depth, camera_stamp,
camera_stamps, io). qpos and qvel follow joint_names; ctrl echoes the commands as accepted (a failed
gripper still echoes its command); images holds overhead (320x240, with depth) and robot/wrist_cam
(64x48), updated once a second; objects is empty; io holds ext_force_n (hand force estimate, base frame),
cycle_limit_s and traveller. The controller may use numpy, mujoco and the files in /app. Wall-time limits
per call and per run are in /app/gauntlet/harness.py.run_gauntlet.py runs them: 2 at T2, 6 at T3 (two per upset)
and 4 at T4 (two per fault), in the three layout bands of run_gauntlet.py --band. Every run has its own mill
place, tray and plate places, blank order and orientation, stripe colours, cam stiffness and force offset, drawn
by task.py.CELL_RULES.md, each counted only if it holds at the end
of the run and was met within the 265 s cycle limit: door latched open, vise unlocked, finished part in the
plate corner, job blank loaded, seated, clamped, door latched closed, cycle started, cycle complete.CELL_RULES.md) and never after the change is complete. A
run in which a fault started scores 0 unless the controller reports the right fault within 30 s of it, parked
as CELL_RULES.md says, with no stop, and scores 0 if no stage was met before the fault. Otherwise it scores
1.0 if the stages met at the fault are at least the stages due by then at cycle pace, and otherwise the share
of the stages met.