Driver for a centrifuge with a plate loader
harbor run -t valenlabs/workcell-c1harbor download valenlabs/workcell-c1Author a standalone PyLabRobot controller (/logs/artifacts/controller.py) for a centrifuge-and-loader workcell staging sample P01 (STAGE-01) and counterweight P02 (STAGE-02) so P01 completes a balanced spin (P01_spun_done) and reaches OUT-01 (P02 in OUT-02) within 90 ticks while satisfying all normative safety and timeout clauses (S1, S2, W1, W3, H1, T1, T2) across up to 2 faults per run.
Follow established laboratory automation best practices.
Time limit: you have 6 hours of wall-clock time in total; whatever you have submitted when it runs out is what gets graded.
/workspace/MANUAL.md: Instrument & robotic arm API documentation, nominal parameter/band tables, and normative clauses./workspace/LAB_HANDBOOK.md: Facility operator handbook covering time-lapse vs. scheduled calls, power modes, multimodal image captures, and spontaneous workcell incident classes./workspace/task_public.task: Machine-readable public specification (initial deck layout, plate metadata, budgets, and clauses)./workspace/reference_data/: Sanitized public reference files from this task's source dataset.pylabrobot==0.2.2, ortools==9.15.6755, and the workcell.plr_backends client (connect_workcell). Underlying simulator state-machine internals are isolated outside this container; infer behavior from the API reference and runtime observations./logs/artifacts/controller.py that connects via connect_workcell(), satisfies all normative clauses across fault scripts up to budget 2, and calls session.done().connect_workcell() reaches a live copy of this cell. It uses the published constants, never injects faults, and runs on it are not scored. session.restart_cell() returns it to the initial state in /workspace/task_public.task with fresh budgets (for example after your controller has called session.done() or control has otherwise ended), so you can run your controller again. Graded runs reject restart_cell(); do not call it from controller.py.session.submit_controller(path) (optional) stores a copy of your controller in the practice cell's log of the current session.wait(), status(), journal(), query_timer(), power calls and every other session call (session.restart_cell() on the practice cell is not a request). Only accepted device commands count toward the operation budget; power calls (standby(), wake(), session.set_power_mode()) do not. Besides done(), control ends when simulated time reaches the horizon (90000 ms, during a wait or a time-lapse call), when a device command is sent after the operation budget is used up (it is refused with ERR_OP_BUDGET_EXHAUSTED), or on the first request past the request budget (refused with ERR_REQUEST_BUDGET_EXHAUSTED). Simulated time then runs on to the horizon with no further commands, and every later request is refused with ERR_CONTROL_ENDED: every session call except done() and every backend command then raises WorkcellCommandRejectedError./logs/artifacts/controller.py as it is on disk at that moment and runs it once per graded fault script (no fault, one fault or two faults from the fault model in /workspace/MANUAL.md Section 5), each time against a fresh simulated cell with the live cell's constants and initial state plus that script's faults. If that file is missing, it uses the controller most recently stored with session.submit_controller(path) in the live cell's last session, if any; with neither, every run fails.workcell client SDK as this sandbox) that runs a copy of your controller from a fresh temporary directory in a separate grading container, where /workspace does not exist. connect_workcell() finds that run's cell through the WORKCELL_SOCKET environment variable and the public task data through WORKCELL_PUBLIC_TASK (a copy of the PUBLIC section of /workspace/task_public.task, with no clause lines). A run still going 15 seconds after its process started (wall-clock time, including imports and the time the cell takes to answer requests) is stopped. A stopped run, a non-zero exit status (for example from an unhandled WorkcellCommandRejectedError) or more requests than the request budget fails the Runs gate, which scores the whole task 0.Runs (on every graded fault script your controller exits with status 0 within the 15-second per-run wall-clock limit and within the request budget), Nominal (the fault-free run breaks no guarantee in /workspace/MANUAL.md Section 6), Safe (no run breaks a guarantee that "fails the Safety gate" or causes a safety breach such as a collision).(V - B) / (R - B) (R = 1000), weighted 20% zero-fault, 40% single-fault, 40% two-fault.