Skip to content

novaphy.ik.IKSolver

High-level IK driver that expands seeds, runs LM or L-BFGS, reports per-seed costs, and gathers the best seed for each problem.

IKSolver(
    model,
    n_problems,
    objectives,
    *,
    optimizer=IKOptimizer.LM,
    jacobian_mode=IKJacobianType.ANALYTIC,
    sampler=IKSampler.NONE,
    n_seeds=1,
    noise_std=0.1,
    rng_seed=12345,
    lambda_initial=0.1,
    lambda_factor=2.0,
    lambda_min=1e-5,
    lambda_max=1e10,
    rho_min=1e-3,
    history_len=10,
    h0_scale=1.0,
    line_search_alphas=None,
    wolfe_c1=1e-4,
    wolfe_c2=0.9,
)

model may be a finalized novaphy.Model or a JointBodyBundle. Objective target arrays have one row per n_problems; all problems share the same kinematic model.

Methods and properties

Member Description
step(joint_q_in, joint_q_out, iterations=50, step_size=1.0) Optimize (n_problems, n_coords) float32 arrays. The arrays may alias; returns None.
reset() Reset optimizer history/damping and best-seed indices.
joint_q All expanded seeds after the most recent step.
costs Squared residual norm for every expanded row.
best_indices Lowest-cost seed index per problem when n_seeds > 1.
jacobian_mode Active IKJacobianType.

Unknown attributes are forwarded to the selected optimizer, so LM state such as lambda_values is available through the solver.

Current limits

IK is serial CPU/NumPy code and currently requires joint_coord_count == joint_dof_count. A raw Model falls back to finite differences even when ANALYTIC is selected. True analytic Jacobians require JointBodyBundle, whose implemented columns are Revolute/Prismatic only. There is no autodiff backend.

The method runs a fixed number of iterations and has no convergence Boolean. Check task-space error or costs in the caller.

See also