Skip to content
BoKSA

Vision-Guided Robotics

Vision-Guided Robotics

Introduction

A fixed robot program always moves to the same points: pick at A, place at B. That works when the part is fixtured. It fails when the part sits somewhere new in the camera view. Vision-guided robotics closes that gap. A camera observes the scene, vision finds the part, and the robot moves to the pose vision just measured.

The image steps are edge detection, blob detection, and object detection. The motion limits live in Degrees of freedom. This article is how those pieces sit in one cell: camera, light, calibration, and a pick-and-place motion you can explain.


Fixed points and seen points

1
2
3
4
5
6
7
Without vision                         With vision
Move to A                              Grab a frame
Close gripper                          Find the part
Move to B                              Convert pixels to robot coordinates
Open gripper                           Move to that pose
                                       Close gripper
                                       Move to B

Vision pays off when the part is not fixtured: a belt, a bin, a table where people set objects down. It also adds failure modes a fixed program does not have. A missed detection must not become a move to (0, 0).


What is in the cell

Part Role
Camera Captures the frame. Resolution and mounting (above the table, or on the arm) decide what "a pixel" means.
Lighting Makes the part stand out. A stable lamp beats a clever threshold.
Vision computer Runs the processing: an MCU with a small buffer, a Pi, or a PC.
Robot and controller Executes the joint motion.
End effector Gripper, suction cup, or other tool. The pose you solve is the tool pose, not the camera pose.
Calibration The stored relationship between image pixels and robot coordinates.
Safety Stops, workspace limits, and a rule for "vision is not sure". See Safety & constraints.
1
2
3
4
5
6
7
camera + light
      →  frame
      →  find part (blob, edges, or detector)
      →  pixel position (and angle, if you have it)
      →  calibration
      →  robot pose
      →  joint move and grasp

If the project uses ROS 2, this pipeline is a graph of nodes. The practice side is ROS development. The concepts here stay the same whether the messages are ROS topics or a UART packet to an MCU.


Camera and lighting

Mount the camera so the working area fills the frame and the part does not leave the image at the edges of the workspace. A camera on the arm (eye-in-hand) sees the grasp up close and moves with the tool. A camera fixed over the table (eye-to-hand) sees the whole area and stays still while the arm moves. Write down which one you have, because calibration is different.

Lighting is part of the sensor, not decoration.

Problem What the image does
Shadow across the part Fake edges, a blob split in two
Specular highlight A bright blob that is not the part
Dim ambient light A threshold that used to work now misses
Part and table the same colour Nothing to segment

Diffuse light from a known direction, a contrasting background, and a fixed exposure make blob detection and edge detection repeatable. Change the lamp and you re-tune the vision, even when the robot program is untouched.


From pixels to a pose

A detection gives you pixels: a centre, a box, sometimes an angle in the image. The robot wants a pose in its own frame: x, y, z, and often roll, pitch, yaw. Degrees of freedom is that pose, and the joint limits that may reject it.

Calibration is the measured link between the two frames. A simple lab version, with the camera fixed above a flat table:

  1. Place a known target (a marker, or the gripper itself) at several robot positions you can read from the controller.
  2. Record the pixel location of that target in the image.
  3. Fit the mapping from pixels to table coordinates, including the scale (millimetres per pixel) and the rotation between image axes and robot axes.

That mapping is only valid for the camera mount, the lens, and the plane you measured. Move the camera, change the focus, or pick above a different height and the old numbers drift. Eye-in-hand needs a hand-eye calibration: where the camera sits relative to the tool flange.

Check calibration with a point you did not use to fit it. Command the tool there and see the error in millimetres. If the error is larger than the gripper can tolerate, fix the calibration before you tune the grasp.

Inverse kinematics then turns the robot pose into joint angles. If the solver returns no solution, or a solution outside a joint limit, the part is in view and still unreachable. Report that. Do not drive to the nearest illegal angle.


A pick-and-place motion

One cycle, for a single part on a table and a blob or a detector that returns a centre:

  1. Settle. Arm clear of the camera view if the camera is fixed. Light on, exposure stable.
  2. Acquire one frame (or a short average if the image flickers).
  3. Find the part. Drop results under the confidence or area limit.
  4. Transform the chosen pixel centre through calibration to a robot x, y on the table. z comes from the table height you already measured, unless you have a 3D sensor.
  5. Approach above the part, then down to the grasp height. Closing in two steps keeps a bad z from driving the tool into the table at full speed.
  6. Grasp, lift, move to the place pose, release.
  7. Check. If the find step was empty, stay in a known hover pose and retry or stop. If the grasp sensor (vacuum, finger switch) says you missed, do not continue the place motion as if you were holding the part.

Object detection replaces step 3 when you must pick one class out of several. A blob is enough when there is one kind of part on a plain background. Orientation matters for a rectangular part: a box centre without an angle grasps at a random twist. Add the angle from the blob's long axis or from the detector, and check that your wrist joint can reach it.


When vision should refuse to move

Condition Safe behaviour
No part above the threshold Hold position, retry a limited number of times, then stop and report
Two parts overlapping Ask for a clearer view, or take the one rule you wrote down (largest, leftmost)
Target outside workspace or joint limits Do not move; log the pose
Camera timeout or black frame Treat as a fault, not as "part at 0,0"
Calibration older than the last time the camera was touched Re-check before a graded demo

Vision is a measurement. A measurement with no freshness check is how an arm moves to last minute's part. Timestamp the frame, and ignore a pose that is older than your cycle allows.


Relevant topics


Starting points

  1. Draw your cell: camera fixed or on the arm, lamp, robot base, and the table region that must stay in frame.
  2. Write the pixel-to-robot check: one known robot point, the pixel you expect, and the millimetre error you will accept.
  3. List the find step you will use (blob, edges, or detector) and the rule that picks one result from several.
  4. Define the no-detection pose and the message you show when the part is seen but outside the workspace.

Focus points

  • Light and mount are part of the measurement. Move either one and calibration and thresholds need another look.
  • Pixels are not millimetres. A calibration check on a fresh point belongs in the demo, not only in a slide.
  • Approach from above so a bad height does not crash the tool.
  • Empty vision is a fault. A missing detection must not become a move to the origin.
  • The pose you command has to be reachable: workspace, joint limits, and tool orientation together. See Degrees of freedom.

Key points

  • Vision-guided motion measures the part, then moves. A fixed waypoint program cannot follow a part that moves in the frame.
  • The cell is camera, lighting, processing, robot, end effector, calibration, and a safety rule for a bad frame.
  • Calibration converts a pixel result into a robot pose. Inverse kinematics and joint limits decide whether that pose can be executed.
  • Pick-and-place is acquire, find, transform, approach, grasp, place, and an explicit stop when vision or the workspace says no.