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

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.6.0
File Size Uploaded Provenance Actions
skelarm-0.6.0.tar.gz 161.2 kB With provenance Details for skelarm-0.6.0.tar.gz

Built distribution (wheel)

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

Total release size: 263.7 kB

Release files / skelarm-0.6.0.tar.gz

Download URL skelarm-0.6.0.tar.gz
Size 161.2 kB
Tags Source
SHA-256 checksum
How to use checksums
2342d8245858393f41a0ae47a6c581469a08428d6283fbb810402dd52f4a9d3f
BLAKE2b-256 checksum
How to use checksums
3811abdbdfc3244dca57134b860ce6841c47f068d02161fdc48f9c9a3014fbb2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 20, 2026.

Transparency log

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

Download URL skelarm-0.6.0-py3-none-any.whl
Size 102.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f81ded6d593915c424b3983ca081bb4664e4a614df4f9e296a2316535d8f725e
BLAKE2b-256 checksum
How to use checksums
471c767351efb9778891b062e3f783509c5fdf21acafdc4429df10e520534ec7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 20, 2026.

Transparency log

Security for skelarm 0.6.0

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for skelarm-0.6.0.tar.gz

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 Nov 20, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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