02 · RBE 2001, WPI · TEAM PROJECT · OCTOBER 2026 · MY ROLE: ALL THE CODE

Shelf-pick robot

FIG. 1 · THE TEAM’S CAD, ANIMATED. THE ARM HERE IS POSED BY A TWO-JOINT INVERSE KINEMATICS SOLVE, THE SAME MATH THE ROBOT USES
Overview

A small robot that finds a colored cube on a shelf and picks it off. It’s a Pololu Romi base carrying a 3D-printed arm with two joints and a parallel gripper. A camera rides on the gripper and streams video over Wi-Fi to a laptop, and the laptop sends drive and arm commands back.

It runs two ways. I can drive it by hand from the laptop, looking through the gripper camera like a first-person video feed and moving the arm from the keyboard. Or it runs on its own: the laptop finds the cube in the video, works out where the arm has to go, and makes the pick with no driver.

Romi 32U4ESP32-S3 SenseWi-Fi video2-joint arminverse kinematics
My part

This was a team project for Unified Robotics I. I wrote all of the code, on the robot and on the laptop, built with AI coding tools: I wrote the spec, tested every piece on the real robot, and decided what to keep. I also drew the first draft of the arm. The CAD you see above is my teammates’ work, built out from that draft, and the arm and gripper parts were 3D printed.

How it talks

The heavy lifting happens on the laptop, because a laptop can run vision far faster than anything that fits on the robot. The XIAO ESP32-S3 Sense is a thumbnail-sized board with a camera and Wi-Fi, so it does two jobs: send the video out and pass commands in, as short plain-text lines over a serial link. The Romi 32U4 control board runs as a slave to it. It never decides anything, it just takes a command like “shoulder to this angle” or “drive this far” and runs its motors until it gets there.

Splitting it this way means the timing-critical motor control stays on the robot, where a dropped Wi-Fi packet can’t make a motor overshoot. The laptop only sends targets, and if the link drops, a watchdog on the Romi stops the motors on its own.

Inverse
kinematics
a b shoulder elbow jaw target L1 L2 d

Moving the arm by hand means nudging two joints and watching where the jaw ends up. Picking a cube needs the opposite: you know where the jaw has to be, and you need the two joint angles that put it there. That’s inverse kinematics.

With two joints it comes down to one triangle. Draw a straight line from the shoulder to the target. Now the upper arm (L1), the forearm (L2) and that line (d) are three sides of a triangle, and all three lengths are known, so the law of cosines gives every angle in it. The shoulder angle is the angle of the line, a, plus the triangle’s angle at the shoulder, b. The elbow angle falls out the same way. In this CAD the upper arm is about 147 mm and the forearm about 99 mm, so before joint limits the jaw can reach a band between about 48 and 246 mm from the shoulder.

The arm is a parallel linkage, the two extra bars you can see in the model. They keep the gripper level no matter how the joints move, so the solve only has to place a point, not aim the jaw.

The pick

On its own, the laptop finds the cube by its color in the camera image with OpenCV and drives up to the shelf. The laptop turns where the cube sits into a target point and solves for the joint angles. The shoulder is a brushless motor with a magnetic encoder, run by field-oriented control and a PID loop on the Romi’s own 8-bit chip. On power-up it homes itself against a hard stop so it always knows where zero is.

The last few centimeters use the camera instead of the math. The gripper closes in based on how the cube looks in the video: how big it is and where it sits in the frame. After the grab it checks whether it actually has the cube, and if it missed, it backs off and tries again.

← 01 TRADING SYSTEM03 SMART PEN →