How skakim/arm works
Project Type and Purpose
• This is a scientific/simulation application written in Python.
• Purpose: simulate a robotic arm catching a launched ball, compute joint angles via inverse kinematics, guide the motion using a combination of AI (regression models) and analytic functions, generate datasets, run experiments, and produce graphical analyses.
Main Architectural Components
A. Domain Model
• Arm.py – encapsulates the robotic arm’s geometry, joint definitions, forward/inverse kinematics.
• Ball.py – represents the projectile, its trajectory under physics.
B. Simulation Engine
• Simulation.py – orchestrates a simulated “launch‐and‐catch” scenario, instantiates Arm and Ball, steps through time, applies control inputs.
C. AI Controller / Trajectory Planner
• The “combined AI + function” logic lives inside DatasetGenerator.py (for generating training examples) and within Simulation.py or a helper module—using regression weights to determine joint‐trajectory deviations.
D. Data Management
• DatasetGenerator.py – runs batches of simulated catches to emit CSV files under CSVs/Regression1 and CSVs/Regression2.
• CSV storage – raw training sets, trajectory deltas, friction variations, and final regression weights.
E. Experiment Runner
• ExamplesExperiment.py – consumes CSV data, fits regression models (e.g., Fourier series, w0–w6 weights), evaluates error metrics, writes result CSVs (allerrors_*.csv).
F. Visualization Module
• Graficos/ – folder of generated plots (boxplots, Fourier coefficient charts, weight variation graphs).
• Potentially scripts or notebook code (not shown) that read the result CSVs and render PNGs or interactive charts.
G. Configuration & Utilities
• TODO.txt – lists outstanding tasks.
• README.md – project overview and usage instructions.
Relationships and Data Flows
• The Simulation Engine pulls in the Domain Model and the AI Controller.
→ Simulation outputs raw trajectories & joint‐angle deltas to CSV.
• Dataset Generator may wrap Simulation Engine to produce large training datasets.
→ DatasetGenerator writes CSV files grouped by scenario (Regression1, Regression2).
• Experiment Runner reads those CSVs, applies regression algorithms (scikit-learn, NumPy/SciPy), computes weights and error statistics, then writes summary CSVs.
• Visualization Module reads experiment CSV outputs, generates charts under Graficos/.
Architectural Patterns & Principles
• Modular Separation: domain objects (Arm, Ball) are decoupled from control logic (AI) and from I/O (CSV read/write).
• Single Responsibility: each script/module owns a distinct concern (simulation, data gen, experiment, plotting).
f. Off to one side, show DatasetGenerator.py connecting to Simulation and Storage to emphasize bulk data creation.