skelarm
A lightweight, physics-based dynamics simulator for a configurable planar robot
arm. skelarm treats the robot as a "skeleton" of N links and focuses on
kinematics and dynamics simulation — there is no collision detection or detailed
shape rendering, and the supported model is a horizontal, gravity-free plane.
Define a robot in TOML, pose it interactively, simulate it under torque control,
run controlled tasks from a single scenario file, and record every run to a
self-contained log that replays, plots, and exports to video.
Full documentation: https://hrshtst.github.io/skelarm/
Quick start
Requires Python 3.12+ and uv (plain
pip install . also works):
git clone https://github.com/hrshtst/skelarm.git
cd skelarm
uv sync
Three commands, from posing to a controlled reach:
# 1. Pose a 4-DOF arm: joint sliders (FK) or drag the tip (IK)
uv run python tools/kinematics_inspector.py examples/four_dof_robot.toml
# 2. Simulate its dynamics: press Space to run, drag the tip to apply a force
uv run python tools/dynamics_simulator.py examples/four_dof_robot.toml
# 3. Run a controlled reach: the controller drives the arm to the target
uv run python tools/reaching_simulator.py examples/reach.toml
Every simulator records its run — press Export… to save a *.sklog.npz log
and replay it with uv run python tools/player.py <log>. See
Getting Started for the guided version.
Capabilities
From basic to advanced:
- Configurable robot — arbitrary planar chains from TOML: link lengths, masses, inertias, centers of mass, joint limits, optional base offset (guide).
- Kinematics — recursive forward kinematics (positions, velocities, accelerations), endpoint Jacobian, and numerical inverse kinematics (Sugihara-style Levenberg-Marquardt and friends) (guide).
- Dynamics — Recursive Newton-Euler inverse dynamics and mass-matrix forward
dynamics; fixed-step semi-implicit Euler and adaptive
solve_ivpintegration; gravity is explicitly zero (horizontal plane) (guide). - Tasks & control — reaching, multi-target reaching, periodic curve tracing, and trajectory tracking, driven by trajectory-tracking laws, human-like reaching controllers, or joint-space MPC — all from one scenario TOML, extensible at runtime (guide).
- Trajectory tools — teach motions by dragging the tip, then smooth (zero-phase filters), resample (from-scratch interpolators), and track them (guide).
- Recording & replay — self-contained
*.sklog.npzlogs with an analysis player, headless.mp4/.gifexport, and reproducible headless re-simulation (guide).
Choose a workflow
| I want to… | Run | Guide |
|---|---|---|
| Pose or inspect an arm | tools/kinematics_inspector.py <robot.toml> |
Kinematics and Posing |
| Simulate free dynamics | tools/dynamics_simulator.py <robot.toml> |
Simulate Dynamics |
| Run a controlled task | tools/reaching_simulator.py <scenario.toml> |
Run Controlled Scenarios |
| Replay / export a run | tools/player.py <run.sklog.npz> |
Record, Replay, and Re-simulate |
| Teach and track a trajectory | tools/trajectory_recorder.py <robot.toml> |
Teach and Track Trajectories |
| Use the Python API | — | Python API Quick Start |
Demos
| Disturbing a controlled reach — the drag force is recorded and replayed | Teaching a trajectory by demonstration |
More demos — live target switching, curve tracing, MPC, and the tracked playback of the taught motion — are embedded as smaller MP4 videos throughout the documentation.
Minimal Python example
from skelarm import load_scenario, rerun_log, run_scenario
scenario = load_scenario("examples/reach.toml")
log = run_scenario(scenario) # headless controlled run
log.save("reach.sklog.npz") # replay with tools/player.py
again = rerun_log(log) # deterministic re-simulation from the embedded config
Lower-level building blocks (Skeleton, FK/IK, forward/inverse dynamics,
simulate_robot) are covered in the
Python API Quick Start.
Documentation
- Getting Started
- User Guides — configuration, simulation, scenarios, recording, joint limits, and the tool & CLI reference
- Theory Reference — the mathematics behind the implementation
- API Reference — generated from the source
- Developer Guides — extending tasks/controllers, architecture, development workflow
For developers
uv sync --all-extras && uv run pre-commit install
make all # format + type-check + test — run before declaring a change done
make docs-serve # preview the documentation site
Development is test-first (pytest + hypothesis property tests), fully typed
(basedpyright + mypy), and linted with ruff. See
Development and Testing for the workflow and
Architecture for how the modules fit together.
License
GPLv3
AI Assistance & Development Workflow
This project is developed with the assistance of AI coding agents: the maintainer (@hrshtst) writes the project guidance and theoretical reference material, the AI implements against them, and the maintainer reviews, tests, and revises every change. All responsibility for the code in this repository lies with the maintainer.
External contributors are welcome to use AI tools under the same standard: if you use AI to generate code for a pull request, disclose it in the PR description and ensure you have thoroughly reviewed and tested the code. If you identify problems, or find code that appears to be unoriginal or rights-protected, please notify the maintainer by filing an issue. The full workflow is described in Development and Testing.
Metadata
Release files for skelarm 0.5.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| skelarm-0.5.0.tar.gz | 138.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| skelarm-0.5.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 231.1 kB
Release files / skelarm-0.5.0.tar.gz
| Download URL | skelarm-0.5.0.tar.gz |
|---|---|
| Size | 138.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f5b00eeb636f254b0ccbf51bd775d41d1ba93a2ec4f77b6a6b7a181a6f079cee
|
|
BLAKE2b-256 checksum How to use checksums |
a1aff46522131e6db23bb926236c5b1491dea78ada97d53da892df9d75367c62
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 29, 2026.
Transparency logRelease files / skelarm-0.5.0-py3-none-any.whl
| Download URL | skelarm-0.5.0-py3-none-any.whl |
|---|---|
| Size | 93.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
943d4bee09bd759a103466a6cce14dd93e1f933af4198b939db6d9ffa46dc6e2
|
|
BLAKE2b-256 checksum How to use checksums |
56aece1ced34daa1e921592dc48b6ee2552a45d598e7e34d88e89780479202fd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 29, 2026.
Transparency log