Skip to content
atikulmunnaPublic

About

Robotic manipulation by integrating a Large Language Model (LLM) as the central 'brain' for open-source Axon robotic arm.

Resources

Stars

3 stars

Watchers

1 watching

Forks

Repository files navigation

ArmCortex 🦾

A low-cost general-purpose humanoid robotic arm that understands natural language, sees the world through a depth camera, and learns from human demonstrations.

Demo


Overview

ArmCortex is an undergraduate capstone project that demonstrates how meaningful embodied intelligence can be achieved on constrained, affordable hardware. The system integrates:

  • 🎙️ Natural language command interface — speak to the robot and it understands
  • 👁️ On-device vision-language grounding — object detection and spatial reasoning via depth camera
  • 🧠 Hybrid IL + RL learning pipeline — imitation learning for safe initialization, PPO-based reinforcement learning for refinement

The entire system runs on a Raspberry Pi 5 (high-level compute) and an Arduino Mega 2560 (real-time motor control) — no cloud, no GPU cluster.


System Architecture

System Architecture

High-level computation: Raspberry Pi 5 (8GB)
Real-time control: Arduino Mega 2560
Communication: Serial interface between Pi and Arduino


Repository Structure

ArmCortex/
├── arduino_codes/          # Low-level motor control firmware (C++)
├── training_data/          # Teleoperation demonstration datasets (CSV)
├── Assets/                 # Demo GIFs and images
│
├── IL.py                   # Imitation learning (behavioral cloning)
├── RL.py                   # Reinforcement learning setup
├── rl_finetune.py          # RL fine-tuning on physical hardware
├── train_rl_physical.py    # Physical hardware RL training loop
│
├── arm_control.py          # Joint-level arm control interface
├── arm_dataset_env.py      # Dataset collection environment
├── agentic_flow.py         # LLM-based agentic task dispatch
├── check_controller.py     # Controller input validation
├── sanity.py               # System sanity checks
├── test16.py               # Testing scripts
│
└── rtdetr-l.pt             # RT-DETR object detection model weights

Hardware

Component Spec
High-Level Compute Raspberry Pi 5 (8GB RAM)
Microcontroller Arduino Mega 2560
Actuators 4× Worm Gear Motors (~35 kg-cm torque)
Perception Depth Camera (3D object detection)
Voice Input USB Microphone

Approximate total cost: BDT 17,200 ($155 USD)


Learning Pipeline

1. Demonstration Collection

A human operator teleoperates the arm via a handheld controller. Each timestep records:

  • Joint positions & velocities
  • Gripper state
  • End-effector pose
  • Target object 3D position (from depth camera)
  • Control actions issued

Data is saved in CSV format under training_data/.

2. Imitation Learning (IL.py)

Behavioral cloning trains a policy on the collected state-action pairs — giving the robot a safe, human-guided starting point without requiring random exploration.

3. RL Fine-tuning (rl_finetune.py, train_rl_physical.py)

Proximal Policy Optimization (PPO) refines the imitation-initialized policy on physical hardware, improving robustness to object placement variations and improving motion smoothness.


Getting Started

Prerequisites

# On Raspberry Pi 5
pip install torch torchvision
pip install stable-baselines3
pip install ultralytics        # for RT-DETR / YOLO
pip install pyserial
pip install speechrecognition pyaudio

Run the System

# 1. Flash Arduino firmware
#    Open arduino_codes/ in Arduino IDE and upload to Mega 2560

# 2. Sanity check hardware connections
python sanity.py

# 3. Collect teleoperation demonstrations
python arm_dataset_env.py

# 4. Train imitation learning policy
python IL.py

# 5. Fine-tune with reinforcement learning
python train_rl_physical.py

# 6. Run full agentic pipeline (voice → task → execution)
python agentic_flow.py

Evaluation

The system was evaluated using qualitative, task-oriented criteria:

Criterion Description
Task Success Did the robot complete the task without intervention?
Command Interpretation Was the spoken intent correctly understood?
Execution Reliability Was motion smooth and free of unsafe behavior?
End-to-End Responsiveness Was latency acceptable for interactive use?

Tasks demonstrated include object pickup, repositioning, and simple stacking under varied object positions and lighting conditions.


Key Design Choices

  • On-device only — no cloud inference, no external APIs. Ensures low latency and data privacy.
  • Hierarchical control — high-level reasoning (Pi) decoupled from real-time actuation (Arduino), so perception latency never disrupts motor control.
  • IL before RL — imitation learning initializes a safe policy, drastically reducing the dangerous random exploration that pure RL would require on physical hardware.

Limitations

  • Task range is bounded by the size and diversity of the demonstration dataset
  • No simulation environment — all training occurs on physical hardware, limiting iteration speed
  • Evaluation is qualitative; direct comparison with large-scale benchmarks is not the goal

Future Work

  • Expand the demonstration dataset for better generalization
  • Integrate simulation-based pretraining (sim-to-real transfer)
  • Upgrade to more advanced vision-language models for multi-step task grounding
  • Add degrees of freedom for more dexterous manipulation

About

Robotic manipulation by integrating a Large Language Model (LLM) as the central 'brain' for open-source Axon robotic arm.

Resources

Stars

3 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages