Skip to content

Adithya191101/feeding_robot_ws

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

3 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Assistive Feeding Robot Simulation

ROS2 Jazzy Gazebo Harmonic Python 3.12 MoveIt2

A simulation-based assistive feeding robot with impedance-based safety monitoring for individuals with upper-limb impairments

Developed by Team 1 - MS Robotics, Northeastern University


๐ŸŽฌ Demo Video

Note: Demo video showcasing the feeding robot in action. Upload media/videos/feeding_demo.webm by editing this README on GitHub and dragging the file here


๐Ÿ“ธ Simulation Environment

Gazebo Simulation with UR5e Robot

Gazebo Simulation The UR5e manipulator performing feeding tasks in a realistic environment with table, plate, and human model

RViz Motion Planning Visualization

RViz Visualization MoveIt2 motion planning interface showing robot kinematics and collision avoidance


๐ŸŽฏ Project Overview

This project presents a comprehensive simulation framework for assistive feeding robotics, addressing a critical need for approximately 6.8 million Americans living with upper-limb impairments. The system employs a Universal Robots UR5e manipulator to execute safe, smooth spoon-to-mouth feeding trajectories while maintaining continuous safety monitoring.

Key Innovations

  1. Hybrid Motion Planning Strategy

    • Combines joint-space interpolation for singularity avoidance during large reconfigurations
    • Uses Cartesian linear interpolation for precise, orientation-preserving feeding motions
    • Intelligently switches between methods based on task phase requirements
  2. Sensorless Impedance-Based Safety Monitoring

    • Estimates contact forces from position tracking errors without expensive force/torque sensors
    • Implements phase-dependent adaptive stiffness scaling for context-aware safety
    • Provides emergency stop capability when estimated forces exceed 25 N threshold
  3. MoveIt2 Integration with Semantic IK Seeding

    • Phase-aware inverse kinematics seed selection for consistent, predictable trajectories
    • Collision-aware motion planning with full environmental modeling
    • Real-time trajectory execution via ros2_control

Problem Context

Commercial feeding devices like Obi and Meal Buddy rely on pre-programmed, open-loop trajectories without force feedback. This creates two significant limitations:

  • No adaptability: Robot continues on its path even if the user moves unexpectedly
  • No force detection: System cannot detect contact or modulate behavior for gentle interaction

Our solution addresses these limitations through intelligent motion planning and real-time safety monitoring.


๐Ÿ“Š Performance Results

Before and After Impedance Control

Before Force Control Before Analysis

After Impedance Control After Analysis

Comparison showing improved trajectory smoothness and force regulation with impedance-based monitoring

Latest Analysis Dashboard

Analysis Dashboard

Key Performance Metrics

Metric Value Threshold Status
Total Execution Time 82.51 s < 120 s โœ… Pass
Peak Joint Velocity 0.148 rad/s < 0.5 rad/s โœ… Pass
Peak Interaction Force 19.12 N < 25 N โœ… Pass (24% margin)
Average Tracking Force 5.72 N < 10 N โœ… Pass
Safety Violations 0 0 โœ… Pass
Orientation Deviation (Feeding) < 2ยฐ < 5ยฐ โœ… Pass
Motion Smoothness (Jerk) ยฑ0.015 rad/sยณ Low โœ… Excellent

๐Ÿ”ฌ Key Technical Findings

Hybrid Motion Planning Performance

The hybrid approach successfully resolves the fundamental trade-off between singularity avoidance and end-effector orientation preservation:

  • Transport Phase (Joint-Space): Robust, singularity-free motion for large reconfigurations
  • Feeding Phase (Cartesian-Space): Straight-line paths with < 2ยฐ orientation deviation
  • Pure Cartesian planning: Failed due to singularities near folded configurations
  • Pure joint-space planning: Succeeded but produced 15ยฐ orientation deviations

Safety System Validation

The impedance-based safety monitoring demonstrated:

  • Nominal operation: Peak force 19.12 N (24% below 25 N threshold)
  • Emergency stop test: Correctly triggered at 45.91 N during challenging conditions
  • Average tracking force: 5.72 N indicates accurate trajectory following
  • Zero false negatives: All unsafe conditions detected
  • Signal filtering: Rolling mean filter (window=8) essential for eliminating physics engine noise

Motion Quality Analysis

Trajectory execution achieved research-grade smoothness:

  • Joint velocities: Smooth sinusoidal profiles, peak 0.148 rad/s (well below UR5e limits)
  • Jerk magnitude: ยฑ0.015 rad/sยณ indicates smooth, comfortable motion
  • No discontinuities: Continuous trajectories throughout 8-waypoint sequence
  • Time parameterization: 8-10 seconds per segment with real-time factor 1.0

๐Ÿ—๏ธ System Architecture

Control Pipeline

Cartesian Waypoints โ†’ Inverse Kinematics (MoveIt2) โ†’ Hybrid Motion Planner
                                                              โ†“
                                                    Joint Trajectories
                                                              โ†“
                                            ros2_control Trajectory Controller
                                                              โ†“
                                                    Gazebo Simulation
                                                              โ†“
                                            Joint State Feedback (100 Hz)
                                                              โ†“
                                          Impedance Safety Monitor (10 Hz)
                                                              โ†“
                                              Emergency Stop (if force > 25 N)

Software Stack

  • Middleware: ROS2 Jazzy Jalisco
  • Simulation: Gazebo Harmonic
  • Motion Planning: MoveIt2 with KDL kinematics
  • Control: ros2_control with scaled joint trajectory controller
  • Robot Model: Universal Robots UR5e (6-DOF manipulator)
  • Languages: Python 3.12, YAML configuration

Core Components

  1. Inverse Kinematics with Semantic Seeding

    • Phase-aware seed configuration selection
    • Biases IK solver toward kinematically appropriate solutions
    • Prevents unnecessary joint rotations between waypoints
  2. Phase-Dependent Stiffness Scaling

    • Base stiffness: 100 N/m in each Cartesian direction
    • Adaptive gains: 0.15-1.0 based on task phase
    • Lower gains near user's face increase safety sensitivity
  3. Emergency Stop Mechanism

    • "Hold position" trajectory with zero velocities
    • Response time: 0.5 seconds
    • Prevents continued force application during collisions
  4. Collision Environment Setup

    • Human model: Torso (box), head (sphere), arms (cylinders)
    • Furniture: Table, chair primitives
    • Enables MoveIt collision checking during planning

๐Ÿš€ Installation & Setup

System Requirements

  • Operating System: Ubuntu 24.04 LTS (required)
  • ROS2: Jazzy Jalisco
  • Simulation: Gazebo Harmonic
  • Hardware: 8GB RAM minimum (16GB recommended), multi-core processor

Install Dependencies

# Install ROS2 Jazzy
sudo apt update
sudo apt install ros-jazzy-desktop

# Install Gazebo Harmonic
sudo add-apt-repository ppa:openrobotics/gazebo-harmonic
sudo apt update
sudo apt install gz-harmonic

# Install MoveIt2 and UR packages
sudo apt install -y \
    ros-jazzy-moveit \
    ros-jazzy-moveit-visual-tools \
    ros-jazzy-ur-simulation-gz \
    ros-jazzy-ur-robot-driver \
    ros-jazzy-ur-moveit-config \
    ros-jazzy-ros-gz-sim \
    ros-jazzy-ros-gz-bridge \
    ros-jazzy-plotjuggler-ros

# Install Python dependencies
pip3 install numpy matplotlib pandas scipy

Build the Workspace

# Clone and build
cd ~/feeding_robot_ws
colcon build --packages-select feeding_trajectory

# Source the workspace
source install/setup.bash

๐ŸŽฎ Running the Simulation

Method 1: Manual Launch (Recommended for Development)

Terminal 1 - Launch Gazebo:

source /opt/ros/jazzy/setup.bash
ros2 launch ur_simulation_gz ur_sim_control.launch.py ur_type:=ur5e

Terminal 2 - Launch MoveIt + RViz:

source /opt/ros/jazzy/setup.bash
ros2 launch ur_moveit_config ur_moveit.launch.py ur_type:=ur5e use_sim_time:=true

Terminal 3 - Run Feeding Motion:

source ~/feeding_robot_ws/install/setup.bash
ros2 run feeding_trajectory monitored_feeding

Method 2: Integrated Launch

source ~/feeding_robot_ws/install/setup.bash
ros2 launch feeding_trajectory visualized_feeding.launch.py

This automatically launches Gazebo, MoveIt, RViz, PlotJuggler, and the feeding node with coordinated timing.

Expected Behavior

The robot will:

  1. Move from home position to safe height
  2. Approach the plate with downward orientation
  3. Reach the plate position (food scooping)
  4. Lift and approach the user's mouth region
  5. Deliver food at mouth position
  6. Retract safely from face
  7. Return to home position

Duration: Approximately 80-85 seconds for complete sequence


๐Ÿ“ˆ Data Analysis

Log File Structure

After each run, comprehensive logs are saved to:

~/feeding_robot_ws/logs/run_YYYYMMDD_HHMMSS/
โ”œโ”€โ”€ joint_states.csv          # Joint positions, velocities, efforts
โ”œโ”€โ”€ ee_poses.csv              # End-effector poses (position + orientation)
โ”œโ”€โ”€ forces.csv                # Virtual force estimates
โ”œโ”€โ”€ tracking_errors.csv       # Position tracking errors
โ”œโ”€โ”€ metadata.json             # Run configuration and statistics
โ””โ”€โ”€ analysis_dashboard.png    # Auto-generated visualization

Generate Analysis Plots

# Navigate to visualization directory
cd ~/feeding_robot_ws/src/feeding_trajectory/feeding_trajectory/visualization

# Generate plots from latest run
python3 generate_plots.py

# Or specify a specific run
python3 generate_plots.py --log-dir ~/feeding_robot_ws/logs/run_20241210_171356

The analysis dashboard includes:

  • Joint position trajectories over time
  • Joint velocity profiles
  • Estimated interaction forces with safety threshold
  • Motion smoothness (jerk) analysis

โš™๏ธ Configuration

Main Configuration File

Configuration parameters are defined in:

src/feeding_trajectory/feeding_trajectory/config/robot_config.yaml

Key Parameters

Safety Thresholds:

safety:
  max_force: 25.0              # Emergency stop threshold (N)
  workspace_limits:            # Cartesian boundaries (m)
    x_min: 0.15, x_max: 0.80
    y_min: -0.20, y_max: 0.65
    z_min: 0.35, z_max: 0.95
  human_zone:
    center: [0.50, 0.0, 0.87]
    radius: 0.25
    max_velocity: 0.02
    max_force: 3.5

Impedance Control:

impedance_control:
  stiffness:
    translation: [100.0, 100.0, 100.0]  # N/m
    rotation: [10.0, 10.0, 10.0]         # Nm/rad
  adaptive_gains:
    home: 1.0
    at_plate: 0.3
    at_mouth: 0.15                       # Most compliant near face

Feeding Waypoints: Waypoints specified as [x, y, z] position (meters) and [roll, pitch, yaw] orientation (radians):

feeding_waypoints:
  home:
    position: [0.22, 0.0, 0.75]
    orientation: [3.14, 0.0, 0.0]
  at_plate:
    position: [0.35, 0.58, 0.52]
    orientation: [3.14, 0.3, 0.9]
  at_mouth:
    position: [0.43, 0.0, 0.78]
    orientation: [3.14, 0.0, 0.0]

๐Ÿ“š Technical Documentation

Full Technical Report

For detailed methodology, experimental validation, and theoretical foundations, see: AR Team 1 Final Report.pdf

The report includes:

  • Comprehensive literature review
  • Detailed system architecture
  • Mathematical foundations of impedance control
  • Safety system validation experiments
  • Comparative analysis of planning strategies
  • Future research directions

Additional Documentation

  • Detailed Setup Guide: src/feeding_trajectory/README.md
  • Code Documentation: See CLAUDE.md for architecture overview
  • Configuration Reference: robot_config.yaml with inline comments

๐Ÿ”ฎ Future Work

Based on experimental findings, three key development directions are planned:

  1. Camera-Based Head Tracking

    • Integrate depth camera (RealSense/Kinect)
    • Implement real-time head pose estimation
    • Enable dynamic waypoint adjustment as user moves
  2. Physical Hardware Deployment

    • Port to real UR5e manipulator
    • Integrate force/torque sensor for ground truth validation
    • Compare sensorless estimation with actual force measurements
    • Address sim-to-real transfer challenges
  3. True Impedance Control

    • Implement real-time trajectory modulation based on forces
    • Replace binary safe/unsafe logic with continuous compliance
    • Enable gentle, adaptive interaction during contact

๐Ÿ‘ฅ Team

Team 1 - Assistive Robotics, Fall 2024

Name Email University
Adithya Rajendran rajendran.ad@northeastern.edu Northeastern University
Ahilesh Rajaram rajaram.a@northeastern.edu Northeastern University
Kevin Jason jason.ke@northeastern.edu Northeastern University
Lokesh Chandrasekar chandrasekar.l@northeastern.edu Northeastern University
Pradeep Sivaa Aiyanar aiyanar.p@northeastern.edu Northeastern University

Program: MS Robotics Institution: Northeastern University, Boston, USA Date: December 2024


๐Ÿ™ Acknowledgments

  • ROS2 Jazzy and MoveIt2 communities
  • Universal Robots for UR5e simulation models
  • Gazebo simulation framework
  • Open Robotics for ros2_control infrastructure
  • Course instructors and teaching assistants

๐Ÿ“– References

  1. D. Park et al., "Active robot-assisted feeding with a general-purpose mobile manipulator in real homes," Robotics and Autonomous Systems, vol. 124, 2020.

  2. N. Hogan, "Impedance control: An approach to manipulation," Journal of Dynamic Systems, Measurement, and Control, vol. 107, no. 1, pp. 1โ€“24, 1985.

  3. ISO/TS 15066:2016, "Robots and robotic devicesโ€”Collaborative robots," International Organization for Standardization, 2016.

  4. T. Bhattacharjee et al., "Towards robotic feeding: Role of haptics in fork-based food manipulation," IEEE Robotics and Automation Letters, vol. 4, no. 2, pp. 1485โ€“1492, 2019.

  5. S. Haddadin et al., "Robot collisions: A survey on detection, isolation, and identification," IEEE Transactions on Robotics, vol. 33, no. 6, pp. 1292โ€“1312, 2017.


๐Ÿ“„ License

This project was developed as part of academic coursework at Northeastern University.


๐Ÿ”— Related Links


โญ Star this repository if you found it helpful!

Advancing assistive robotics for enhanced quality of life

# feeding_robot_ws

About

Assistive feeding robot with Impedance control

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages