Interactive simulatorAdvanced

Robot Arm Simulator for Kinematics and ROS Planning

Explore joint limits, forward kinematics, inverse kinematics, and safe motion planning in a browser-based robot arm simulator preview.

Category
ROS
Time
3–6 hours
Platform
Browser · ROS 2
Robot Arm Simulator for Kinematics and ROS Planning technical schematicREACHABLE WORKSPACE

01 / Start here

Introduction

Robot arms turn joint commands into precise tool motion through geometry, feedback, and planning. This simulator introduces that chain without hiding the difficult parts. It exposes coordinate frames, reachable poses, joint limits, and singularities so ROS users and robotics students can understand why a requested motion succeeds or fails.

Live lab / Forward & inverse kinematics · pick-and-place

Robot arm simulator

Pose the joints, drag a target and watch inverse kinematics solve it live, or set a pick-and-place task and run it — with honest reach, singularity, and limit reporting on a full 360° workspace.

Browser native
A planar robot arm kinematics simulator. Use the controls below to move the joints, drag a target, or run a pick-and-place task, or read the full theory and algorithm after this lab.

The filled dot is the base at the centre; segments are links with round joints; the tool shows a small x/y frame. The shaded ring is the reachable workspace (between the two dashed circles). In inverse mode the cross-marker is the draggable target and the faint arm is the other elbow solution. In pick-and-place mode, drag the box (pick) and the dashed square (place), then press Run.

Run

Forward mode. Drag the joint sliders to pose the arm.

Joints
Geometry & target
Tool X
0 px
Tool Y
0 px
Tool angle
Status
Reachable
Reach
0 / 240 px

Keyboard: focus the workspace, then use Space to run a pick-and-place, R to reset, B to switch elbow, and F for full screen.

Controls

The simulator provides joint sliders, a draggable tool target, frame overlays, and link-dimension controls, with the base centred so the full 360° reachable workspace is visible. Forward mode calculates the tool pose from the joint angles you set. Inverse mode tracks a target you drag — solving for joint angles live and reporting unreachable or ambiguous targets rather than silently snapping to a result. A third pick-and-place mode lets you position a pickup point and a destination, then runs the arm through the whole task: it moves to the object, grabs it, carries it, and releases it in the dropzone — the canonical job every real manipulator is built to do.

Theory

Each joint contributes a transformation between coordinate frames. Multiplying those transformations from the base to the tool yields the forward kinematic pose. Inverse kinematics works backward and may have no solution, one solution, or several solutions.

Reachable workspace of a planar two-link arm. A shaded annulus between an inner and outer dashed circle shows every point the tool can reach. A single target inside the annulus is reached by two arm configurations: an elbow-up solution and an elbow-down solution drawn from the same base.
A target inside the reachable annulus usually has two solutions — elbow-up and elbow-down — while points outside the outer radius or inside the inner radius have none. Download SVG

Near a singularity, a small tool motion can demand a very large joint motion. A planner must also respect position, velocity, acceleration, torque, and collision limits. Geometric reach alone does not make a trajectory safe.

Algorithm

  1. Define link lengths, joint axes, home transforms, and joint limits.
  2. Compute forward kinematics for the current joint state.
  3. Compare the current tool pose with the requested target.
  4. Use an analytic or numerical solver to reduce pose error within limits.
  5. Reject colliding or singular candidates and select a continuous solution.
  6. Time-parameterize the path and send synchronized setpoints to joint controllers.

Source code

A planar two-link arm has a compact forward model:

from math import cos, sin

def forward_kinematics(theta_1, theta_2, link_1, link_2):
    elbow = (link_1 * cos(theta_1), link_1 * sin(theta_1))
    tool = (
        elbow[0] + link_2 * cos(theta_1 + theta_2),
        elbow[1] + link_2 * sin(theta_1 + theta_2),
    )
    return elbow, tool

For physical arms, validate every planned trajectory in a bounded, collision-aware environment before enabling actuator power.

Assumptions and hardware differences

The arm is planar with two or three revolute joints, perfectly rigid links, instant velocity response and no gravity, dynamics or collision — you can swing from elbow-up to elbow-down with no torque limit. Real servos have position and velocity limits, gear backlash, current-limited torque and payload-dependent sag, and a 6-axis arm must also manage orientation, singularities and work near joint limits. This lab is where you learn why a target inside the annulus can have two solutions and why a target on its edge is singular, before you add the dynamics that make those poses hard to hold.

Circuit diagram

Separate high-current actuator power from compute power while maintaining the reference and safety signals required by the selected hardware.

Block diagram of the robot arm control architecture. A planner or ROS 2 stack sends joint targets to a controller, which commands smart servos over a bus. Joint position feedback returns from the servos to the controller, and an emergency stop cuts servo power independently of the software path.
The controller closes a loop with joint feedback, while the emergency stop removes actuator power on its own path — independent of software. Download SVG

Hardware checklist

Components

  • Three-axis or greater robot arm
  • Controller capable of synchronized joint updates
  • Joint feedback or smart servos
  • Rigid base and defined tool center point
  • Emergency stop and current-limited supply

Explore the graph

Where this simulator is used

The projects, learning paths, and tutorials that build on this lab.

Continue building

Download resources

Use these on-page references while working through the project. Downloadable project bundles will be added only after their source and version are published.

Common questions

Frequently asked questions

What is the difference between forward and inverse kinematics?

Forward kinematics calculates the tool pose from known joint values. Inverse kinematics starts with a desired tool pose and searches for one or more joint configurations that can produce it.

Why does a 2-link arm have two solutions (elbow-up and elbow-down)?

For most reachable targets the elbow can bend either way and still place the tool on the same point, giving an elbow-up and an elbow-down configuration. The two solutions come from the plus-or-minus in the law-of-cosines angle for the second joint. They coincide only at a singularity, where the arm is fully stretched or fully folded.

How do I choose between elbow-up and elbow-down?

Pick the configuration that is safest and most efficient for the task: one that keeps joints away from their limits, minimizes movement from the current pose, or avoids obstacles. This simulator lets you toggle between branches and shows the alternate solution as a ghost so the trade-off is visible.

What is a singularity in a robot arm?

A singularity is a configuration where the arm loses the ability to move the tool in some direction—typically when it is fully extended or fully folded. Near a singularity a small tool motion can demand a very large joint motion, so planners slow down or route around these poses. It is also where the elbow-up and elbow-down solutions merge into one.

When does inverse kinematics have no solution?

A planar two-link target is reachable only inside the annular ring between the shortest reach (the difference of the link lengths) and the longest reach (their sum). A point outside that ring cannot be reached at any joint angle. A pose can also be unreachable because it needs a forbidden joint angle, an orientation the available joints cannot achieve, or would collide with the arm itself.

Why use analytic inverse kinematics instead of a numerical solver?

For a two- or three-link planar arm the geometry has a closed-form (analytic) solution, so you can compute the exact joint angles directly, deterministically, and fast—ideal for teaching and testing. Numerical solvers are needed for redundant or spatial arms where no closed form exists, but they iterate, can miss solutions, and are harder to reason about.

Further reading

References

Authoritative sources for going deeper than this simulator's bounded educational model.