Skip to content

Epic: ADA Feeding Pipeline #19

Description

@siddhss5

Goal

Fully functioning feeding demo in MuJoCo that faithfully reproduces ada_feeding's capabilities using plain synchronous Python functions with structured `Outcome` returns. Same code runs on sim (SimContext) and real hardware (HardwareContext).

Architecture

React App (user)  ──┐     ┌── Viser Panel (developer)
                    │     │
              FastAPI/WS  event_loop
                    │     │
         ┌──────────▼─────▼──────────┐
         │   Feeding Logic (pure Py) │
         │   feed_bite(), behaviors  │
         │   No viser, ROS, MuJoCo   │
         └──────────┬────────────────┘
                    │ ExecutionContext
         ┌──────────▼────────────────┐
         │   mj_manipulator          │
         │   servo_to_pose,          │
         │   ft_guarded_move, Outcome│
         └──────┬──────────┬─────────┘
           SimContext   HardwareContext

Implementation Slices

Slice 1: Foundation (mj_manipulator)

  • `Outcome` + `FailureKind` structured return types
  • `ForceThresholds`, `SpeedProfile` dataclasses
  • `servo_to_pose()` — Cartesian servo with deceleration + F/T monitoring
  • `ft_guarded_move()` — move until F/T threshold exceeded

Slice 2: Domain + Behaviors (ada_mj)

  • `FoodItem`, `AcquisitionSchema`, `ForkState` domain types
  • Behaviors: `move_above`, `acquire_food`, `extract_food`, `level_fork`, `transfer_to_mouth`, `retract_from_mouth`
  • Each is a plain function returning `Outcome`

Slice 3: Task + Demo (ada_mj)

  • `feed_bite()` task — 30-line function composing behaviors
  • `feeding_demo()` loop — acquire + deliver each food item
  • Food objects + plate in MuJoCo scene

Slice 4: Viser Feeding Panel (ada_mj)

  • Developer-facing: food selection, action buttons, F/T plot, status

Slice 5: React App Rewrite (feeding_web_interface)

  • User-facing: preserves validated UX for patients with motor disabilities
  • Strips ROS/rosbridge, communicates via FastAPI + WebSocket
  • Same meal state machine: PreMeal → BiteSelection → RobotMotion → BiteDone

What we preserve from ada_feeding

  • F/T thresholds per phase (approach 20N, grasp 15N, extraction 50N, mouth 1N)
  • Speed profiles (0.15→0.06 m/s deceleration near mouth)
  • Acquisition schemas (tilt angles, twist directions, durations)
  • Mouth approach geometry (offset + orientation)
  • Safety abort on F/T exceedance
  • Accessible UX (large buttons, clear status, tested with real users)

What we eliminate

  • py_trees tree construction → plain function calls
  • Blackboard data passing → typed function arguments
  • `scoped_behavior` / `servo_until` idioms → Python control flow + internal loops
  • ROS action servers / rosbridge → direct calls + FastAPI
  • MoveIt2 action clients → `arm.plan_to_configuration`
  • GNU Screen orchestration → single process

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions