{"id":8317,"library":"mink","title":"mink - MuJoCo Inverse Kinematics","description":"mink is a Python library for inverse kinematics (IK) based on MuJoCo, designed for robotics applications. It provides a flexible framework for defining kinematic tasks, joint limits, and collision avoidance, then solving for joint configurations. Currently at version 1.1.0, mink maintains an active development pace with recent releases focusing on performance improvements and stability.","status":"active","version":"1.1.0","language":"en","source_language":"en","source_url":"https://github.com/kevinzakka/mink","tags":["robotics","inverse kinematics","mujoco","manipulator","motion planning"],"install":[{"cmd":"pip install mink","lang":"bash","label":"Install latest version"}],"dependencies":[{"reason":"Core physics and robotics simulator used by mink. Requires native MuJoCo libraries.","package":"mujoco","optional":false},{"reason":"Fundamental package for numerical operations.","package":"numpy","optional":false},{"reason":"Scientific computing library, potentially used for optimization or spatial transformations.","package":"scipy","optional":false},{"reason":"Quadratic Programming (QP) solver used internally for IK optimization.","package":"daqp","optional":false},{"reason":"Optional progress bar for iterations.","package":"tqdm","optional":true}],"imports":[{"symbol":"Configuration","correct":"from mink import Configuration"},{"symbol":"KinematicTask","correct":"from mink import KinematicTask"},{"symbol":"JointLimitTask","correct":"from mink import JointLimitTask"},{"symbol":"solve_ik","correct":"from mink import solve_ik"},{"symbol":"build_ik","correct":"from mink import build_ik"}],"quickstart":{"code":"import mujoco\nfrom mink import Configuration, KinematicTask, solve_ik\nimport numpy as np\n\n# Create a very simple MuJoCo model for demonstration\nmodel_xml = \"\"\"\n<mujoco>\n  <worldbody>\n    <body name=\"link0\" pos=\"0 0 0.1\">\n      <joint name=\"joint0\" type=\"hinge\" axis=\"0 0 1\" pos=\"0 0 0\" />\n      <geom type=\"capsule\" size=\"0.05 0.1\" fromto=\"0 0 0 0 0 0.1\" />\n      <body name=\"link1\" pos=\"0 0 0.1\">\n        <joint name=\"joint1\" type=\"hinge\" axis=\"0 1 0\" pos=\"0 0 0\" />\n        <geom type=\"capsule\" size=\"0.05 0.1\" fromto=\"0 0 0 0 0 0.1\" />\n        <body name=\"tip\" pos=\"0 0 0.1\">\n            <geom type=\"sphere\" size=\"0.02\" rgba=\"1 0 0 1\"/>\n        </body>\n      </body>\n    </body>\n  </worldbody>\n</mujoco>\n\"\"\"\nmodel = mujoco.MjModel.from_xml_string(model_xml)\ndata = mujoco.MjData(model)\n\n# Instantiate the configuration wrapper\nconfig = Configuration(model, data)\n\n# Define a kinematic task to reach a target position for the 'tip' body\ntarget_position = np.array([0.0, 0.1, 0.3]) # Target in world coordinates\n\ntasks = [\n    KinematicTask(\n        config=config,\n        body=\"tip\", # Target the 'tip' body defined in the XML\n        target_pos=target_position,\n        weight=1.0,\n    )\n]\n\n# Solve Inverse Kinematics\nq_sol, sol = solve_ik(tasks, config)\n\nprint(f\"IK Solution (joint angles): {q_sol}\")\n\n# Update MuJoCo data with the solution to get the final tip position\nconfig.set_joint_positions(q_sol)\nmujoco.mj_fwdKin(model, data)\nprint(f\"Final end-effector position: {config.get_body_position('tip')}\")","lang":"python","description":"This quickstart demonstrates how to set up a minimal MuJoCo model, define a `Configuration` object, create a `KinematicTask` to reach a target position for a specified body, and use `solve_ik` to find the joint angles. It then updates the MuJoCo data and prints the resulting end-effector position."},"warnings":[{"fix":"Ensure your Python environment is version 3.9 or higher when using mink v1.0.0 or newer.","message":"mink v1.0.0 dropped support for Python 3.8.","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Install the `mujoco` Python package (`pip install mujoco`) and follow the official MuJoCo documentation for setting up the native libraries and environment variables (e.g., `LD_LIBRARY_PATH` on Linux).","message":"mink relies on MuJoCo, which requires both the Python `mujoco` package and the native MuJoCo library to be installed and properly configured.","severity":"gotcha","affected_versions":"All versions"},{"fix":"For projects requiring a permissive license, ensure you are using mink version 0.0.8 or newer. Be aware that versions prior to 0.0.8 inherited the GPL license from `quadprog`.","message":"The license of mink changed from GPL to MIT due to a dependency switch from `quadprog` to `DAQP`.","severity":"gotcha","affected_versions":"<0.0.8 (GPL), >=0.0.8 (MIT)"},{"fix":"Catch `mink.exceptions.NoSolutionFound` and handle scenarios where the target might be unreachable, joint limits are too restrictive, or other constraints prevent a solution. Review your task weights and robot's workspace.","message":"The `solve_ik` function can now raise a `mink.exceptions.NoSolutionFound` error if the QP solver fails to find a solution.","severity":"gotcha","affected_versions":">=0.0.12"},{"fix":"If you are using MuJoCo 3.3.4 or newer and encounter issues with inertia matrix calculations, upgrade `mink` to version 0.0.12 or later.","message":"Issues with `Configuration.get_inertia_matrix()` were fixed for MuJoCo versions 3.3.4 and above.","severity":"gotcha","affected_versions":"<0.0.12 (with MuJoCo >= 3.3.4)"}],"env_vars":null,"last_verified":"2026-04-16T00:00:00.000Z","next_check":"2026-07-15T00:00:00.000Z","problems":[{"fix":"Run `pip install mujoco` and ensure your system's MuJoCo native libraries are set up according to the official MuJoCo documentation (e.g., environment variables like `LD_LIBRARY_PATH` on Linux).","cause":"The `mujoco` Python package or its native libraries are not installed or configured correctly.","error":"ModuleNotFoundError: No module named 'mujoco'"},{"fix":"Upgrade your Python environment to version 3.9 or higher. For example, use `conda create -n myenv python=3.9` or similar.","cause":"You are attempting to use `mink` version 1.0.0 or newer with an unsupported Python 3.8 environment.","error":"RuntimeError: Python 3.8 is no longer supported by mink."},{"fix":"Review your target position/orientation, task weights, and robot's joint limits. Ensure the target is within the robot's reachable workspace. Consider adjusting weights or adding other tasks like `JointLimitTask` or `CollisionAvoidanceTask`.","cause":"The inverse kinematics solver could not find a valid set of joint angles to satisfy all target tasks, often due to an unreachable target, conflicting constraints, or joint limits.","error":"mink.exceptions.NoSolutionFound: No solution found for the given tasks."},{"fix":"Ensure you are using the correct import statement as shown in the quickstart: `from mink import Configuration, KinematicTask, solve_ik`. Most commonly used classes are exposed directly in the top-level `mink` package.","cause":"You are trying to import a class or function from `mink` using an incorrect path or the symbol might have been renamed/moved in an older version.","error":"AttributeError: module 'mink' has no attribute 'KinematicTask'"}]}