Find joint angles for a target

Inverse kinematics finds joint angles that put the gripper at a chosen point. One target can have two arm configurations, while another may be out of reach.

Browser walkthrough·Beginner·About 10 min

Planar arm lab

Choose a target and an elbow branch, then solve for the joint angles. Click the workbench to select a target, or use the coordinate controls below.

Robot arm workbench

Click the bench to choose a target.

Gripper (1.16, -0.15) m

More controls

Shoulder -50.0° · Elbow 100.0°

Gripper (1.16, -0.15) m. Pose clear. Click the workbench to choose a target, then solve or plan the motion below. The links remain in one horizontal plane.

2D reference and fallback
Two-link arm viewed from aboveThe gripper is at x 1.16, y -0.15 meters. No collision at this pose.+x+y
Optional reasoning check
Predict before you try

Can this arm reach a target 0.10 m from its base?

Model limits

Two ideal links, 1.00 m and 0.80 m. Free joints in one horizontal plane, no gravity, torque, joint limits, self-collision, or grasp physics. The planner tests direct motions and a finite set of waypoints at at most 2° joint increments. This sampling can miss collisions between poses; it is not a hardware motion planner.

Requirements and learning goals

Before you start

  • The joint-angle lesson in this track
  • A browser with JavaScript

You will be able to

  • Distinguish forward and inverse kinematics
  • Identify inner and outer reach limits
  • Compare two poses for one target

Reverse the question

starts with joint angles and calculates a gripper position. starts with a position and searches for joint angles. A task such as picking a cup usually begins with this second question. Allow about 10 minutes for this exercise.

Our ideal links can reach positions at distances between |1.00 - 0.80| = 0.20 m and 1.00 + 0.80 = 1.80 m from the base. The outer limit occurs when they straighten. The inner limit occurs when they fold back on each other. A target can be too close as well as too far away.

One target can have two answers

The target (1.00, 0.80) has a positive-elbow solution with shoulder 0° and elbow 90°. Select the negative-elbow branch and the same gripper position has shoulder about 77.3° and elbow -90°. The gripper agrees, but the links occupy different parts of the room.

The solver uses the triangle formed by the two links and the line to the target. It computes the elbow angle first, then rotates the shoulder to align that triangle. The two possible elbow signs produce the two branches. Near the straight or fully folded boundary, those branches meet and small target changes can cause large joint changes.

Checkpoint 1 of 2

Is the target (1.20, 1.60) reachable by this arm?

Commit to an answer. Every choice explains itself.

Try it

  1. Click the workbench to select a target. For the exact example, open More controls, set target x to 1.00 and y to 0.80, and select Positive elbow. Press Show solved pose.
  2. Switch to Negative elbow and solve again. Check the endpoint and the occupied space.
  3. Predict whether (1.80, 0.80) is reachable. Set the sliders and solve.
  4. Try (0.10, 0.00). Predict the result before solving. The reasoning check is optional.

Check the expected result

Both branches reach (1.00, 0.80). The distance to (1.80, 0.80) is about 1.97 m, beyond the 1.80 m outer radius. The point (0.10, 0.00) is inside the 0.20 m inner radius. The solver rejects both unreachable targets and leaves the arm at its current pose.

Checkpoint 2 of 2

The positive-elbow pose for (1.00, 0.80) is unusable because something occupies the space where its links would sit. What does the negative-elbow branch give you?

Commit to an answer. Every choice explains itself.

You are done when you can find a different target with two valid branches and explain why a point near the base can still be unreachable.

Troubleshooting

Changing a target clears the previous motion. Press Show solved pose after editing a target or branch. The target marker can be different from the current gripper position until you solve. A rejection is an expected result, not a broken control.

Showing a solved pose jumps directly to that configuration. It does not establish a collision-free route from the previous pose. Real inverse kinematics must also consider joint limits and tool orientation, which this two-dimensional example omits. The following lesson checks the motion between poses.

Can you do each of these?

  • Distinguish forward and inverse kinematics
  • Identify inner and outer reach limits
  • Compare two poses for one target

0 of 2 checkpoints solved. Try checkpoint 1

Previous: Turn joint angles into a gripper position
All lessons in this topic
  1. 1. Turn joint angles into a gripper position
  2. 2. Find joint angles for a target
  3. 3. Check the motion between two poses
  4. 4. Complete a simulated pick-and-place task

Ask Wendy

Answers about Wendy and WendyOS

What would you like to know?

Ask about devices, development, and deployment.

Check linked docs for technical details.