A Python and C framework for simulating spacecraft dynamics, guidance, navigation and control in astrodynamics missions.
StanfordASL/frax
A pure-Python library for robot kinematics and dynamics built on JAX, with JIT compilation and autodiff for fast controller design.
- Stars
- 710
- Forks
- 47
- Open issues
- 0
- Last commit
- 3 days ago
What is it?
frax is a robot kinematics and dynamics library written in Python on top of JAX. It computes terms such as the mass matrix, joint, link and frame transforms, Jacobians, gravity vector and Coriolis forces, which are the building blocks of inverse-kinematics and inverse-dynamics controllers.
Because the computations are JAX functions, they can be JIT-compiled, batched across GPU or TPU, and differentiated automatically. This means constraints or cost terms can be written as ordinary functions of the robot state, without deriving Jacobians by hand. The project includes a built-in set of robot models, including the Franka Panda, Kuka iiwa, Unitree G1 and Unitree A2, and loads custom robots from URDF files.
The library also provides an frax.ik module for inverse kinematics and retargeting, along with examples for differential IK, operational space control and control barrier function based safety constraints.
Key features
- 01Computes mass matrix, Jacobians, gravity and Coriolis terms for URDF robot models.
- 02JIT compilation and automatic differentiation through kinematics and dynamics via JAX.
- 03Batched computation on GPU and TPU, with optional double precision.
- 04Built-in models for Franka Panda, Kuka iiwa, Unitree G1 and A2.
- 05frax.ik module for inverse kinematics and humanoid retargeting.
Use cases
- Prototyping differential inverse kinematics or operational space controllers in Python.
- Writing control barrier function or other constraints that depend on robot kinematics.
- Running batched dynamics computations for sampling-based or learning-based control on accelerators.
- Retargeting human motion data onto humanoid robot models.
Quick start
- 1
Install frax with the IK extras from PyPI
pip install "frax[ik]" - 2
Compute the mass matrix of a built-in robot model in Python
Things to know
- Requires JAX; performance tips recommend a specific older JAX version for fast CPU dynamics.
- Collision methods need a spherized collision model of your robot.
In collections
Topics
FAQ
- What is frax?
- A pure-Python library for robot kinematics and dynamics built on JAX, with JIT compilation and autodiff for fast controller design. frax is a robot kinematics and dynamics library written in Python on top of JAX. It computes terms such as the mass matrix, joint, link and frame transforms, Jacobians, gravity vector and Coriolis forces, which are the building blocks of inverse-kinematics and inverse-dynamics controllers.
- Is frax free to use? What license does it have?
- frax is open source under the MIT license. Check the license terms before using it in commercial products.
- Is frax still maintained?
- Actively maintained. The last commit to frax was on Nov 4, 2026.
- What can I use frax for?
- Prototyping differential inverse kinematics or operational space controllers in Python. Writing control barrier function or other constraints that depend on robot kinematics. Running batched dynamics computations for sampling-based or learning-based control on accelerators. Retargeting human motion data onto humanoid robot models.
- How do I install frax?
- Install frax with the IK extras from PyPI: pip install "frax[ik]" Compute the mass matrix of a built-in robot model in Python
- Where can I get frax?
- The source code and installation instructions are on GitHub: https://github.com/StanfordASL/frax
Summary generated by AI from the project's README. GitHub stats refresh daily.
Related projects
A fast, header-only C++ library with Python bindings for rigid body dynamics, kinematics and their analytical derivatives, used in robotics.
C++17 physics library with Python bindings for kinematics, dynamics and contact simulation of articulated robots and animated characters.
Bullet Physics SDK, a C++ library for real-time collision detection and multi-physics simulation used in games, VR, robotics and machine learning.
PyBullet-based Gymnasium environments for training single and multi-agent reinforcement learning controllers for quadcopters.
A Python multirotor UAV simulator with lumped-parameter aerodynamics, built for teaching and research in estimation, planning, and control.