The Problem
Robotics research and education need a high-productivity framework for kinematics, dynamics, and trajectory generation without forcing practitioners to hand-roll transformation math or reimplement standard robot models. The Python ecosystem has NumPy and SciPy for linear algebra, but no unified, well-tested toolkit for the core operations a robotics engineer performs daily: forward/inverse kinematics, Jacobians, and dynamic simulation across varied robot architectures.
What This Does
This is a fork of Peter Corke's robotics-toolbox-python (3,431 upstream stars), a mature library for representing and simulating robots. The core lives in src/roboticstoolbox/ with key modules: ets/ETS.py and ets/ET.py for elementary transform sequences, robot/BaseRobot.py and robot/DHRobot.py for robot models, and robot/Link.py for joint definitions. A companion rtb-data/ package ships robot model data (URDF, meshes, xacro files) for arms like the xArm 6 and Franka Panda.
The repo includes 46 test files, 119 documentation files, and 12 Jupyter notebooks covering kinematics, dynamics, and IK benchmarking. A bin/rtbtool.py CLI provides interactive robot exploration. The codebase is predominantly Python (244 files) with a substantial C/C++ component (313 header files) for Eigen-based spatial math extensions.
How It Is Wired
Execution typically starts at main in src/roboticstoolbox/bin/rtbtool.py (reaches 217 functions) or start in src/roboticstoolbox/blocks/arm.py (reaches 194 functions). The heaviest traffic flows through the Panda robot model, called from 131 distinct places, followed by transform primitives Rx (101) and Rz (90). The __init__ methods dominate the call graph: addconfiguration is called 109 times, RevoluteDH 71 times, and Link 52 times—constructing robot models is where most work happens.
The central hub is src/roboticstoolbox/ets/ETS.py, called from 39 other files and routing 33 functions; it defines the __mul__ and __add__ operators that compose transform sequences. src/roboticstoolbox/tools/urdf/urdf.py is the largest single file (191 functions, 21 classes) and handles URDF parsing. The src/roboticstoolbox/robot/BaseRobot.py file (89 functions) is the only core module that touches external effects: it runs subprocesses and reads/writes files.
One traced path leaves the process: start -> plot -> launch uses subprocess.Popen to spawn a visualization window. The module graph shows no circular dependencies across its 244 internal modules, so refactoring a leaf module won't cascade unexpectedly.
How To Use It
# Clone and install
git clone https://github.com/moses-y/robotics-toolbox-python
cd robotics-toolbox-python
pip install -e . # or: pip install .
pip install -e rtb-data/ # for robot model data
# Run the interactive robot explorer
python src/roboticstoolbox/bin/rtbtool.py
# Run tests
pytest tests/
Configuration lives in pyproject.toml (both root and rtb-data/). No environment variables are required. Examples are in examples/—start with examples/puma_jtraj.py for a trajectory demo or examples/robots.py to enumerate available models.
Real-World Use
A typical workflow: load a Panda arm, compute forward kinematics, then solve inverse kinematics for a target pose.
from roboticstoolbox import models
panda = models.Panda()
T = panda.fkine(panda.qr) # forward kinematics
sol = panda.ikine_LM(T) # inverse kinematics
print(sol.q) # joint angles
Code Health & Issues
Static analysis found 307 findings (131 high, 139 medium, 37 low), all of one kind: deep nesting (max indentation depth 8) in src/roboticstoolbox/backends/Dynamixel/dynamixel_sdk/protocol1_packet_handler.py and protocol2_packet_handler.py. The Dynamixel SDK is vendored third-party code, so this is inherited complexity rather than a design flaw.
SDLC findings from the audit:
- High - GitHub Actions pinned to mutable tags (
codecov/codecov-action@v7,release-please-action@v5) in.github/workflows/—pin to commit SHAs to prevent supply-chain attacks. - High - No lockfile committed; builds are non-reproducible from
pyproject.toml. - High -
continue-on-erroron a correctness step in.github/workflows/release.yml(line 66) can mask failing tests. - Medium - No dependency vulnerability scan in CI; add
dependency-review-actionorosv-scanner. - Medium - Three blobs over 5MB in
rtb-data/(largest:omron.daeat 15.7MB); move to Git LFS. - Medium -
persist-credentials: falsenot set on checkout in.github/workflows/ci.yml. - Low - No
timeout-minuteson workflow jobs.
Tests and CI are present, a license is included, and no secrets were committed.
The Bottom Line
This is a solid, well-tested robotics toolkit with a clean module structure and no circular dependencies—a good foundation for kinematics and dynamics work. The main risks are supply-chain hygiene (unpinned CI actions, no lockfile) and the vendored Dynamixel SDK's deep nesting. Use it if you need a Python-native robotics framework with broad model support; harden the CI before relying on it for production builds.