Section 5

API reference

Public functions and classes, by module. All array arguments are NumPy float64, and twists are shape (6,) in the paper's convention ξ = (ω, v).

Types · articulatearena.types

TwistImmutable shape-(6,) twist wrapper, raw array via .data.
EndpointPairUnordered pair {u, v} of endpoint twists.
JointUnit screw twist xi_hat, limits a, b (±inf for continuous), and joint_type.
LinkInertiaMass, center of mass, and 3×3 rotational inertia of a link.
InnerProductProtocol: callable from a shape-(6,) twist to its squared norm.

Representation · new_equation.representation

screw_twist(axis_dir, point, joint_type, pitch=0) Unit screw twist of a one-DOF joint from a world-frame axis and a point on it.
make_endpoint_pair(xi_hat, a, b) The unordered endpoint pair {a·ξ, b·ξ} (code names the limits a, b = paper's l⁻, l⁺).
joint_to_endpoint_pair(joint) Endpoint pair of a typed Joint.

Joint metric · new_equation.E

joint_metric(u1, v1, u2, v2, inner_product) The quotient metric E, the ℤ₂-swap minimum over endpoint pairings.
training_loss(u1, v1, u2, v2, inner_product, epsilon=1e-9) Smooth swap-invariant surrogate for E² (differentiable objective).

Norms · new_equation.inner_product

make_split_norm(alpha)Split norm ‖Δω‖² + α²‖Δv‖².
make_kinetic_energy_norm(inertia)Kinetic-energy norm from a LinkInertia.
make_riemannian_norm(metric)Norm from a user-supplied SPD 6×6 matrix.

Continuous joints · new_equation.continuous

radial_compactify(u, kappa, inner_product=None)Radial map ϕ into the open unit ball.
continuous_joint_repr(xi_hat, inner_product=None)Boundary endpoint pair of an unbounded joint.
compactified_joint_metric(u1, v1, u2, v2, inner_product, kappa)E∘ϕ, the compactified metric.
interval_term(a1, a2)Extended-real distance between limit values.

Tree metric · new_equation.tree

cost_to_fixed(pair, inner_product)Contraction/expansion cost E(J, J₀).
assignment_tree_distance(pairs1, pairs2, inner_product, unmatched_cost=None) Assignment relaxation over joint multisets (Hungarian, padded matrix).
contract_small_edges(edges, inner_product, tol=1e-12) Contract exactly-fixed (zero-motion) edges of a labeled tree.
assignment_matching(pairs1, pairs2, inner_product) Relaxation value together with its optimal matching.
matching_realizable(edges1, edges2, matching) Linear-time check that a matching extends to an isomorphism of the contracted trees.
exact_tree_distance(edges1, edges2, inner_product) Exact motion-aware tree edit distance. Returns (distance, certified).

Skeleton distance · new_equation.skeleton

topology_penalty(num_unmatched, num_relation_mismatches, lambda_topology, relation_weight=1) Constant-λ penalty for surplus joints and relation mismatches.
skeleton_distance(cost_matrix, lambda_topology, ...) Assigned E cost plus topology penalty. Returns (row_ind, col_ind, total).

Material motion · new_equation.material_motion

se3_exp(xi_hat, theta)Rigid transform exp(θ ξ̂).
config_discrepancy(...), finite_joint_discrepancy(...) RMS displacement discrepancy of material points swept along two joints (used to calibrate E against physical motion).

Background math · general_equation

exp_map.exp_map(xi_hat, q=1)se(3) exponential map.
assignment.assign(cost_matrix)Hungarian optimal assignment.
tree_edit.tree_edit_distance(...)Classical ordered tree edit distance (Zhang-Shasha) on TreeNodes.
configuration.configuration_difference(...)L² configuration difference (Park 1995).

I/O · read and write

read.config_loader.load_config(path=None) Flatten a grouped YAML config into the Config dataclass. Defaults to configs/default.yaml.
read.urdf_loader.load_joint(urdf_path, joint_name) Typed Joint from a URDF, with the axis resolved to the world frame by forward kinematics.
read.inertia_loader.load_link_inertia, load_joint_child_inertia LinkInertia of a link / of a joint's child link, for the kinetic-energy norm.
read.case_loader.load_case, load_case_joints Prediction/ground-truth evaluation case referencing two URDF joints.
write.report.Report_Generator JSON / Markdown evaluation reports.

Baselines · previous_metrics.component_scores

Component scores of prior evaluation templates (type, axis, origin, and limit errors with thresholded joint_success), kept for reproducing §3-style baseline numbers.