Camera-Based Joint Angle Measurement
Overview
A robot arm's encoders report where its motors think the joints are, but that isn't always where the joints actually end up. I built a desktop tool that uses a camera to measure the arm's real joint angles, drives the arm to a set of commanded angles, and writes a report comparing the commanded, encoder, and camera-measured angles side by side. It measures joint angles to an accuracy of about 0.1°.
Problem
- The encoders can't tell you how far the real joint is from where it was commanded to go.
- Measuring joint angles by hand is slow, and it isn't precise enough to trust.
Goals
- Measure the arm's real joint angles without touching it.
- Compare commanded, encoder, and measured angles in one place.
- Be simple enough for other engineers to set up and run on their own.
How It Works
A printed fiducial target is fixed to the base and to each link of the arm. After a one-time camera calibration, the tool finds each target in the image, works out its position and orientation, and computes the angle between neighboring links from how the targets are rotated relative to each other.
The same window also drives the arm. It steps the arm through a list of commanded angles, waits for each joint to settle, takes a measurement, and saves everything to a report at the end of the run.
Key Features
- One application: camera, calibration, arm control, and reporting all live in one window, instead of separate scripts and copy-pasting between them.
- Guided camera calibration: the calibration is locked to the camera's focus and resolution, so it can't be silently invalidated by a refocus.
- Automated test runs: the arm is driven through every test point and measured automatically, then a commanded vs. encoder vs. measured report is written out.
- Safe by design: stopping, timeouts, and faults all return the arm to a safe state, and those failure cases are covered by automated tests that run without any hardware.
- Easy to share: packaged as a standalone executable with a full user guide, so anyone can run it without installing Python.
Results
The tool measures the arm's joint angles to an accuracy of about 0.1°, giving the team a quick, repeatable way to see how closely the arm follows its commands.
