This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
OCTv2 (Oreo Cookie Thrower v2) - A complete system for automated Oreo delivery targeting open mouths.
✅ COMPLETE - All components implemented and documented
freds_first_iphone_app/
├── OreoLauncher/
│ ├── ContentView.swift # Main SwiftUI interface
│ ├── NetworkService.swift # TCP networking
│ └── OreoLauncher.xcodeproj # Xcode project
├── raspberry_pi_server/
│ ├── octv2_server.py # Main Pi server
│ ├── requirements.txt # Python dependencies
│ ├── camera_aim_calibration.md # Targeting calibration guide
│ ├── wide_mouth_detection_guide.md # Detection tuning guide
│ └── setup_mouth_detection.md # Setup instructions
├── esp32_firmware/
│ ├── octv2_motor_controller.ino # ESP32 stepper control firmware
│ └── ESP32_COMMANDS.md # Complete command reference
└── CLAUDE.md # This file
# Build and run in simulator
xcodebuild -project OreoLauncher/OreoLauncher.xcodeproj -scheme OreoLauncher -destination 'platform=iOS Simulator,name=iPhone 15' build
# Open in Xcode for development
open OreoLauncher/OreoLauncher.xcodeproj
# Install dependencies
cd raspberry_pi_server
pip3 install -r requirements.txt
# Run server
python3 octv2_server.py
# Download facial landmark model (if using advanced detection)
wget http://dlib.net/files/shape_predictor_68_face_landmarks.dat.bz2
bunzip2 shape_predictor_68_face_landmarks.dat.bz2
# Upload via Arduino IDE or PlatformIO
# Configure board: ESP32 Dev Module
# Baud rate: 115200
# In octv2_server.py
self.target_deadzone_pixels = 30 # Targeting tolerance
pixels_per_degree_rotation = 15 # Movement sensitivity
# Wide-open mouth detection
inner_aspect_ratio > 0.6 # Mouth opening ratio
avg_lip_thickness > 8 # Lip separation pixels
# Mechanical compensation
self.rotation_offset_degrees = 0.0 # Camera/launcher alignment
self.pitch_offset_degrees = 0.0 # Gravity compensation
sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
# Test mouth detection
python3 -c "import cv2, dlib; print('CV2:', cv2.__version__, 'dlib:', dlib.DLIB_VERSION)"
# Test ESP32 serial
python3 -c "import serial; s=serial.Serial('/dev/ttyUSB0', 115200); print('Serial OK')"