1. The IK Problem in One Sentence
- Forward Kinematics (FK): Given joint angles , compute the end-effector pose . This is always a function: one input yields one exact output.
- Inverse Kinematics (IK): Given a desired end-effector pose , find joint angles such that . This is not a function, as it may have zero, one, multiple, or infinite solutions.
2. Why IK Can Return No Solution
There are two primary cases where IK fails to find a solution:
- Out of reach (Geometric): The desired pose is outside the physical workspace. For example, the UR5e's reach is ~850 mm; if you ask for a Tool Center Point (TCP) at 1 m from the base, no joint configuration can achieve it. Note that the position alone might be reachable, but the specific orientation at that position might not be, because wrist orientation is also constrained.
- Reachable but joint-limit-violating: A valid configuration exists mathematically, but it requires an angle (e.g., rad) that exceeds the joint's mechanical limit.
Note: A "reachable-looking" pose that fails is usually due to one of these two reasons. Visually, it looks like the arm should be able to get there, but either the orientation is impossible or every solution requires exceeding a joint limit.
3. Why IK Can Return Multiple Solutions
For a 6R arm like the UR5e, a given end-effector pose typically has up to 8 distinct joint configurations that can achieve it. These arise from three binary choices:
-
Shoulder Left vs. Shoulder Right: Joint 1 can position the shoulder on either side of the base axis to reach the same spatial point.
-
Elbow Up vs. Elbow Down: For a given wrist position, the elbow can bend "up" (above) or "down" (below) the direct line from the shoulder to the wrist.
-
Wrist Not-Flipped vs. Wrist Flipped: At the spherical wrist, you can rotate joint 5 by 180° and counter-rotate joints 4 and 6 to land on the exact same TCP pose.
Since , there are 8 solutions in the general case. Some may violate joint limits and drop out, but you typically still have several valid ones.
Practical Consequence: The get_inverse_kin(x, qnear) function in URScript requires a qnear argument precisely because of this. You pass the current joint configuration as qnear, and the IK solver returns the solution closest to it. This ensures continuous motion rather than the robot suddenly flipping its wrist halfway through a path. If you forget qnear, the controller picks a default solution, which can result in violent, unexpected motion.
4. The Three UR5e Singularities
A singularity is a configuration where the manipulator's Jacobian becomes rank-deficient. Informally, the robot loses a degree of freedom (DoF) of instantaneous motion. At a singularity, IK becomes degenerate: it yields infinite solutions along certain directions, and numerical IK (which get_inverse_kin uses internally) often becomes unstable or fails.
The three named singularities you'll see on the UR5e:
-
Wrist Singularity: Joints 4 and 6 axes become parallel (typically when or ). Rotation about them becomes indistinguishable, so the arm "loses" one independent rotational DoF. Practically, at , you can't move the TCP smoothly in certain orientations without joint 4 or 6 spinning wildly.
-
Shoulder Singularity: The wrist center lies directly above (or coincident with) the base axis (joint 1's vertical line). Many different values will place the wrist at the exact same spot. The IK solver cannot decide which one to use.
-
Elbow Singularity: The arm is fully extended (elbow at 0° or 180°). The wrist cannot move further out radially. Some directions of TCP velocity become mathematically unreachable.
5. Why Singularities Make IK "Fail" or Return Infinite Solutions
At a singularity, the Jacobian matrix (which relates joint velocities to TCP velocity) loses rank. This has two major consequences:
-
For IK existence: The set of joint configurations that achieve a given pose can become a continuous family rather than a discrete set, leading to infinite solutions.
-
For numerical IK: The algorithm internally solves to iterate toward the target. When is singular, you cannot invert it cleanly. While some pseudoinverse methods can still produce a solution, it is often jumpy or extreme in some joints.