Port JacobianVerifier to solver/datagen/jacobian.py #3
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Move
JacobianVerifierclass fromdata/synthetic/pebble-game.py(L375-902) intosolver/datagen/jacobian.py.Class overview
Builds the constraint Jacobian matrix for numerical rank verification. The pebble game gives a combinatorial necessary condition for rigidity; the Jacobian provides the sufficient condition by detecting geometric degeneracies (e.g., parallel revolute axes creating hidden dependencies).
The generalized velocity vector for n bodies is
v = [v1_x, v1_y, v1_z, w1_x, w1_y, w1_z, ..., vn_x, ..., wn_z]. Each scalar constraint contributes one row to J such thatdC_i/dt = J_i @ v = 0.Methods to port
__init__(bodies)— sets up body index mapping, empty Jacobian_body_cols(body_id)— column range for a body in Jadd_joint_constraints(joint)— dispatches to per-type builder_make_row()— zero row of width 6*n_bodies_skew(v)— skew-symmetric matrix for cross product_build_ball(3 rows),_build_fixed(6),_build_revolute(5)_build_cylindrical(4),_build_slider(5),_build_planar(3)_build_distance(1),_build_parallel(3),_build_perpendicular(1)_build_universal(4),_build_screw(5)_perpendicular_pair(axis)— generates orthogonal basisget_jacobian()— returns full J matrixnumerical_rank(tol)— SVD-based rankfind_dependencies(tol)— incremental rank check to identify redundant rowsRequirements
solver.datagen.types(RigidBody, Joint, JointType)__all__ = ["JacobianVerifier"]Depends on