# Exp03 Closed-Loop Grasping

> Generated from repository source files. Do not edit this page directly; edit the source file listed below and rerun `vp run docs:generate`.

> Source: `experiments/exp03-closed-loop-grasping/protocol.md`

## Experiment 3: Closed-Loop Robotic Grasping

Status: `pre-data protocol draft`

## Goal

Evaluate the full EEG-vision-robot closed loop from scene object detection to grasp execution.

## Validation Ladder

1. Simulation closed loop.
2. Fake target or offline EEG replay loop.
3. Online human EEG with physical robot.

## Physical Robot Preconditions

* Complete `experiments/exp03-closed-loop-grasping/hand-eye-calibration.md`.
* Verify candidate-to-grasp transform consistency in a non-contact dry run.
* Confirm safety gates for target loss, low confidence, collision risk, pause, cancel, and emergency stop.
* Record hardware identifiers and calibration files before each physical session.
* Confirm `hardware_inventory_id`, `threshold_freeze_record_id`, and `calibration_record_id` match the session record and runtime log.

## Candidate Baselines

* Scene-aware command space vs fixed command space.
* SSVEP-only confirmation vs SSVEP+MI hybrid confirmation.
* Shared-autonomy high-level intent vs low-level discrete direction commands.

## Metrics

* Task success rate.
* Grasp success rate.
* Completion time.
* Correction count.
* False activation.
* Emergency stop frequency.
* Abort rate.
* Target lost rate.
* Planning failure rate.
* Unsafe command blocked count.
* NASA-TLX.
* User preference.

## Analysis Plan

See `../analysis-plan.md`. Complete `../pre-data-freeze-checklist.md`, `../hardware-inventory.md`, a threshold-freeze record, and a session record before collecting evidence-producing trials.

Required pre-session records:

* `session_id`;
* `hardware_inventory_id`;
* `threshold_freeze_record_id`;
* `calibration_record_id` for physical robot sessions;
* protocol version and software commit;
* runtime event log path;
* detector, decoder, fusion-policy, robot planner, and grasp-method IDs;
* randomization seed/file and block order;
* emergency-stop verification record for physical sessions.

Trial inclusion rule:

* Include completed, failed, aborted, target-lost, planning-failed, safety-blocked, and emergency-stop trials.
* Do not merge detector success, BCI selection success, planning success, and grasp success into one metric.
* Physical trials without a valid calibration record are not evidence-producing trials.

Primary endpoints:

* task success rate;
* grasp success rate.

Baseline interpretation:

* fixed command space vs scene-aware command space tests dynamic command-space generation;
* SSVEP-only vs SSVEP+MI tests the hybrid BCI contribution;
* low-level discrete commands vs shared-autonomy high-level intent tests autonomy delegation;
* simulation, offline replay, and physical robot stages separate software readiness from real-world execution risk.

Physical-robot rule:

* physical trials require a validated hand-eye calibration record, non-contact dry run, collision checks, pause/cancel controls, and emergency-stop verification. Numeric calibration thresholds are `needs confirmation`.
* physical progression decisions must cite calibration and threshold IDs from the session record.

***

> Source: `experiments/exp03-closed-loop-grasping/metrics.md`

## Metrics

| Metric | Definition | Status |
| --- | --- | --- |
| task success rate | trials completing the requested object grasp task / attempted trials | definition draft frozen; success criterion needs protocol binding |
| grasp success rate | successful grasp executions / grasp attempts | definition draft frozen; grasp-success criterion needs protocol binding |
| completion time | trial start to verification outcome, with component latencies reported separately | definition draft frozen |
| correction count | user/system correction actions per attempted trial | definition draft frozen |
| unsafe command blocked count | safety-blocked commands per attempted trial | definition draft frozen |
| planning failure rate | robot planning failures / planning attempts | definition draft frozen |
| workload | NASA-TLX or equivalent linked by questionnaire ID | protocol choice needs confirmation |
| calibration validation | reprojection, solve residual, heldout pose, repeatability, and dry-run errors | definition draft frozen; thresholds need hardware binding |

***

> Source: `experiments/exp03-closed-loop-grasping/variables.md`

## Variables

| Factor | Levels | Notes |
| --- | --- | --- |
| command-space mode | scene-aware / fixed command | central contribution test |
| confirmation mode | SSVEP-only / SSVEP+MI | hybrid BCI contribution test |
| robot environment | simulation / staged tabletop / physical robot | progress by risk |
| calibration state | simulated transform / previous calibration / fresh calibration | physical robot trials require a validated calibration record |
| object count | 2 / 4 / 6 | align with Exp1 |
| grasp difficulty | simple / moderate / cluttered | define after robot setup |

## Freeze Requirements

* Fixed and scene-aware command-space conditions must use pre-defined target sets and candidate-generation rules.
* Physical trials must reference `hardware_inventory_id`, `threshold_freeze_record_id`, and `calibration_record_id`.
* Object set, placement rule, grasp difficulty, and retry budget must be frozen before a session.
* Simulation, replay, and physical results must be reported separately.
