Context
Part of #19 (ADA Feeding Pipeline). Thin API server that the React app talks to. Replaces rosbridge.
Endpoints
```
GET /api/plate → camera image + food detection overlays
POST /api/select_food → {food_id} → select food for acquisition
POST /api/feed → start full bite cycle (returns immediately, status via WS)
POST /api/stop → abort current motion
GET /api/status → {state, behavior, ft_force, fork_state, bite_count}
WS /api/events → live status updates (state changes, F/T readings)
```
Architecture
- FastAPI app that holds a reference to the ADA robot + SimContext
- Runs alongside viser in the same process
- Calls the same `feed_bite()` function as the viser panel
- WebSocket pushes state changes to the React app
- Camera endpoint renders from D415 (ada_mj#5) or returns placeholder
Files
- New: `src/ada_mj/api.py`
- Modify: `src/ada_mj/console.py` or `main.py` (start API server)
Depends on: #22 (task), #24 (viser panel for shared state)
Context
Part of #19 (ADA Feeding Pipeline). Thin API server that the React app talks to. Replaces rosbridge.
Endpoints
```
GET /api/plate → camera image + food detection overlays
POST /api/select_food → {food_id} → select food for acquisition
POST /api/feed → start full bite cycle (returns immediately, status via WS)
POST /api/stop → abort current motion
GET /api/status → {state, behavior, ft_force, fork_state, bite_count}
WS /api/events → live status updates (state changes, F/T readings)
```
Architecture
Files
Depends on: #22 (task), #24 (viser panel for shared state)