Inverse kinematics

mink.solve_ik.solve_ik(configuration: Configuration, tasks: Sequence[BaseTask], dt: float, solver: str, damping: float = 1e-12, safety_break: bool = False, limits: Sequence[Limit] | None = None, constraints: Sequence[Task] | None = None, **kwargs) ndarray

Solve the differential inverse kinematics problem.

Computes a velocity tangent to the current robot configuration. The computed velocity satisfies at (weighted) best the set of provided kinematic tasks.

Parameters:
  • configuration (Configuration) – Robot configuration.

  • tasks (Sequence[BaseTask]) – List of kinematic tasks.

  • dt (float) – Integration timestep in [s].

  • solver (str) – Backend quadratic programming (QP) solver.

  • damping (float) – Levenberg-Marquardt damping applied to all tasks. Higher values improve numerical stability but slow down task convergence. This value applies to all dofs, including floating-base coordinates.

  • safety_break (bool) – If True, stop execution and raise an exception if the current configuration is outside limits. If False, print a warning and continue execution.

  • limits (Sequence[Limit] | None) – List of limits to enforce. Set to empty list to disable. If None, defaults to a configuration limit.

  • constraints (Sequence[Task] | None) – List of tasks to enforce as equality constraints. These tasks will be satisfied exactly rather than in a least-squares sense.

  • kwargs – Keyword arguments to forward to the backend QP solver.

Raises:
  • NotWithinConfigurationLimits – If the current configuration is outside the joint limits and safety_break is True.

  • NoSolutionFound – If the QP solver fails to find a solution.

Returns:

Velocity \(v\) in tangent space.

Return type:

ndarray

mink.solve_ik.build_ik(configuration: Configuration, tasks: Sequence[BaseTask], dt: float, damping: float = 1e-12, limits: Sequence[Limit] | None = None, constraints: Sequence[Task] | None = None) Problem

Build the quadratic program given the current configuration and tasks.

The quadratic program is defined as:

\[\begin{split}\begin{align*} \min_{\Delta q} & \frac{1}{2} \Delta q^T H \Delta q + c^T \Delta q \\ \text{s.t.} \quad & G \Delta q \leq h \\ & A \Delta q = b \end{align*}\end{split}\]

where \(v = \Delta q / dt\) is the velocity in tangent space.

Parameters:
  • configuration (Configuration) – Robot configuration.

  • tasks (Sequence[BaseTask]) – List of kinematic tasks.

  • dt (float) – Integration timestep in [s].

  • damping (float) – Levenberg-Marquardt damping. Higher values improve numerical stability but slow down task convergence. This value applies to all dofs, including floating-base coordinates.

  • limits (Sequence[Limit] | None) – List of limits to enforce. Set to empty list to disable. If None, defaults to a configuration limit.

  • constraints (Sequence[Task] | None) – List of tasks to enforce as equality constraints. These tasks will be satisfied exactly rather than in a least-squares sense.

Returns:

Quadratic program of the inverse kinematics problem.

Return type:

Problem