Skip to main content

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/

A controlled reach replayed with the side panel: the arm swings to the target while the sliders and readouts track every joint

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_ivp integration; 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.npz logs with an analysis player, headless .mp4/.gif export, 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

Dragging the arm away from its target; the controller pulls it back Teaching a trajectory by dragging the tip with the mouse
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

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.4.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for skelarm 0.4.1
File Size Uploaded
skelarm-0.4.1.tar.gz 125.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for skelarm 0.4.1
File Interpreter ABI Platform
skelarm-0.4.1-py3-none-any.whl Python 3 none any Details

Total release size: 217.6 kB

Release files / skelarm-0.4.1.tar.gz

Download URL skelarm-0.4.1.tar.gz
Size 125.5 kB
Tags Source
SHA-256 checksum
How to use checksums
967038b765952cbeda12bb40294ebf8948752b84214bf73b3a5c2c2b82140cc5
BLAKE2b-256 checksum
How to use checksums
0afc325e846bb59d117137544ba9554a053350f63913a2f5cc8bb4b57304e7c4
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 Aug 31, 2026.

Transparency log

Release files / skelarm-0.4.1-py3-none-any.whl

Download URL skelarm-0.4.1-py3-none-any.whl
Size 92.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9800bb5bf1dd6cdf4be97842cea0dc5ad5a408dd9dab3aa728b50feb7434291b
BLAKE2b-256 checksum
How to use checksums
5f9041a3adff4ba776497cac72d95e8344fb7add142c7439090d21b15e39f928
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 Aug 31, 2026.

Transparency log

Release history Release notifications | RSS feed

0.5.0

2 release files

This release

0.4.1 This release

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page