The challenge

For ENGR 7B, our rover needed to follow a black-tape course, detect a colored can, and use a mechanism to grasp it. The design had to fit within a 12 × 16 inch envelope and a $300 budget, with accessible power controls and insulated wiring.

The resulting Polarity rover used two driven wheels, a rear caster, front IR sensors, and a Pixy camera aligned with a servo-operated rack-and-pinion claw.

My work: software and fabrication

I contributed to the autonomous code, focusing on the claw and camera-tracking controls while working alongside the line-following programmer. I researched PID control concepts and applied proportional correction in the camera-tracking routine, then tested and debugged the rover’s behavior on the course.

I also managed 3D printing for the claw mechanism and servo gear: coordinating STL files, preparing and configuring prints, and producing revised parts efficiently. That made this project a hands-on connection between code, physical tolerances, and actuator behavior.

From a CAD model to a working claw

Top-view SolidWorks model showing the rover chassis, battery, sensors, and claw layout
Component layout in CAD.
Isometric CAD view of the rack-and-pinion claw and rover assembly
The rack-and-pinion claw assembly.

The gripper converted servo rotation into opposing rack motion. Printing and testing exposed several practical issues: outdated files, a split claw part, and gear fit that was initially too loose and then too tight. Reprints and mechanical adjustments were part of making the design reliable.

Claw parts arranged in a slicer for 3D printing
Preparing the claw parts for printing.
Printed white claw racks and servo gear on a workbench
The printed claw components and servo gear.

Autonomous behavior

  1. Follow the course. Two digital IR sensors select forward motion and turning corrections through the motor drivers.
  2. Switch tasks. A status variable transitions from line following to the camera-based can-tracking routine when the end condition is detected.
  3. Center the target. The Pixy block’s horizontal position is compared with the camera center. A proportional correction changes the left and right motor commands.
  4. Approach and grasp. Detected block width and height are used as approach thresholds, then the servo closes the claw near the object.
float correction = (middle - x) * trackingKp;
leftMotor.setSpeed(constrain(idleSpeed - (int) correction, 0, 225));
rightMotor.setSpeed(constrain(idleSpeed + (int) correction, 0, 225));

The documented camera-tracking gain is 0.9, with a horizontal center reference of 157.5. This is proportional feedback in the implemented tracking routine; the line-following behavior in the submitted code uses discrete sensor conditions.

Testing the whole system

The work progressed from component tests to integrated runs: checking IR detection and motors, connecting the camera and motor shield, then testing line following, target approach, and claw actuation together.

One especially useful lesson came from visual interference: the camera detected the rover’s red claw instead of the intended red can. Changing the target signature to a green can prevented that conflict during the final competition. The issue showed how mechanical appearance can affect a perception system.

Results & lessons

The rover completed both preliminary and final tracks. In my previous portfolio, I recorded that it advanced to the finals and placed among the five fastest times.

The design report also identifies useful next steps: faster motor commands where appropriate, improved line sensing, and extending the behavior after grasping the can. The project reinforced how much successful autonomous behavior depends on iteration across programming, fabrication, and testing.

  • Applied camera-based feedback to a physical mobile robot.
  • Connected servo commands to a printed mechanical transmission.
  • Managed print preparation and revisions under time and budget constraints.
  • Debugged interactions between sensing, actuation, and the rover’s physical design.