RigidBodyKinematicsNumba

RigidBodyKinematicsNumba.py, a Numba nopython version of RigidBodyKinematics.py

Applies nb.njit(cache=True, inline='always') to every function so they can be called from other compiled Numba kernels (e.g. NumbaModel UpdateStateImpl).

Design

RigidBodyKinematics.py is loaded into a private, isolated module object via importlib - it is never registered under the original name in sys.modules. Functions defined in that private copy have __globals__ pointing to its own __dict__. Only that private copy is patched with jitted versions; the public RigidBodyKinematics module is never imported or modified here, so it retains full plain-Python behaviour (accepts lists, returns plain numpy objects, raises normal Python errors).

Requires scipy (for BLAS-backed np.dot / np.linalg.norm inside Numba nopython). A clear ImportError is raised at import time if missing.