newton.ik.IKSolver#
- class newton.ik.IKSolver(model, joint_q, objectives, *a, **kw)[source]#
Bases:
object
Modular inverse-kinematics solver.
The solver uses an adaptive Levenberg-Marquardt loop and supports three Jacobian back-ends:
AUTODIFF β Warpβs reverse-mode autodiff for every objective
ANALYTIC β objective-specific analytic Jacobians only
MIXED β analytic where available, autodiff fallback elsewhere
- Parameters:
model (newton.Model) β Singleton articulation shared by _all_ problems.
joint_q (What varies from problem to problem are (1) the corresponding row in) β Initial joint coordinates, one row per problem. Modified in place.
objectives ((2) any per-problem data stored internally by the) β Ordered list of objectives shared by _all_ problems. Each IKObjective instance can carry arrays of per-problem parameters (e.g. an array of target positions of length n_problems).
jacobian_mode (IKJacobianMode, default IKJacobianMode.AUTODIFF) β Backend used in compute_jacobian.
lambda_initial (float, default 0.1) β Initial LM damping per problem.
lambda_factor (float, default 2.0) β Multiplicative update factor for Ξ».
lambda_min (float, default 1e-5) β Lower clamp for Ξ».
lambda_max (float, default 1e10) β Upper clamp for Ξ».
rho_min (float, default 1e-3) β Acceptance threshold on predicted vs. actual reduction.
structure (Batch)
------
same (The solver handles a batch of independent IK problems that all reference the)
objects. (articulation (model) and the same list of objective)
joint_q
and
objectives
e.g.
array (an)
duplicated. (of target positions. Nothing else is)
problems (- Shared across)
data (- Per-problem)
- __init__(model, joint_q, objectives, lambda_initial=0.1, jacobian_mode=IKJacobianMode.AUTODIFF, lambda_factor=2.0, lambda_min=1e-5, lambda_max=1e10, rho_min=1e-3)#
Construct a batch IK solver.
See class doc-string for parameter semantics.
- solve(iterations=10, step_size=1.0)#
Run the Levenberg-Marquardt loop.