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, **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.
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) 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 \end{align*}\end{split}\]where \(\Delta q = v / dt\) is the vector of joint displacements.
- 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.
- Returns:
Quadratic program of the inverse kinematics problem.
- Return type:
Problem