GRiM is a GPU library for robot motion generation. It solves inverse kinematics, optimizes trajectories, and checks collisions on CUDA, with analytical derivatives throughout.
GRiM is built on GRiD, which generates robot-specific rigid-body dynamics kernels. GRiD is included unmodified as a submodule. If you only need dynamics, kinematics, or their derivatives, use GRiD directly.
Kernels are compiled for your robot the first time you use them, then cached on disk. Because each build is specialized to one robot, there is no limit on the number of joints.
| module | what it does |
|---|---|
grim.motion.ik |
Inverse kinematics: Levenberg-Marquardt, SQP with joint limits and collision constraints, coordinate descent, MPPI + L-BFGS, and redundancy-resolved IK |
grim.motion.analytic_ik |
Closed-form IK for the Franka Panda and FR3 |
grim.motion.region_ik |
Sampling joint configurations whose end effector lies in a target region |
grim.motion.trajopt |
Trajectory optimization: SCO, STOMP, CHOMP, and least squares |
grim.motion.collision |
Self- and world-collision distances and their Jacobians |
grim.motion.costs |
Compiled least-squares solvers and contact (C3+) numerics, used by problem compilers such as pyroffi |
grim.motion.dynamics |
Inverse and forward dynamics, mass matrix, and dynamics derivatives, compiled by crocket |
grim.motion.kinematics |
Batched forward kinematics, pose errors, and Jacobians |
Each kernel is tested against a float64 NumPy reference implementation, which is itself tested against Pinocchio. See test/motion/TESTING.md.
You need an NVIDIA GPU, the CUDA toolkit (nvcc), and a conda environment. Pinocchio from
conda-forge is needed for some tests.
git clone --recursive https://github.com/commalab/GRiM.git
conda activate <env>
bash install/motion_install.sh # installs crocket, GRiM, and jax[cuda13]
python -m pytest test/motion -q