newton.ik.IKRotationObjective#
- class newton.ik.IKRotationObjective(link_index, link_offset_rotation, target_rotations, n_problems, total_residuals, residual_offset, canonicalize_quat_err=True, weight=1.0)[source]#
Bases:
IKObjective
End-effector rotational target for one link.
- Parameters:
link_index (int) – Body index whose frame defines the end-effector.
link_offset_rotation (wp.quat) – Rotation offset from the body frame (local coordinates).
target_rotations (wp.array(dtype=wp.vec4)) – One target quaternion per problem (stored as vec4).
n_problems (int) – Number of parallel IK problems.
total_residuals (int) – Global residual vector length (for autodiff bookkeeping).
residual_offset (int) – Starting index of this objective inside the residual vector.
canonicalize_quat_err (bool, default True) – If true, the error quaternion is flipped so its scalar part is non-negative, yielding the short-arc residual in SO(3). When false, the quaternion is used exactly as computed, preserving any sign convention from the forward kinematics.
weight (float, default 1.0) – Scalar weight multiplying both residual and Jacobian rows.
- __init__(link_index, link_offset_rotation, target_rotations, n_problems, total_residuals, residual_offset, canonicalize_quat_err=True, weight=1.0)#
- compute_jacobian_analytic(body_q, joint_q, model, jacobian, joint_S_s, start_idx)#
- compute_jacobian_autodiff(tape, model, jacobian, start_idx, dq_dof)#
- compute_residuals(body_q, joint_q, model, residuals, start_idx)#
- init_buffers(model, jacobian_mode)#
Precompute lookup tables for analytic jacobian computation.
- residual_dim()#
- supports_analytic()#