DuckieBot: Autonomous Robot Navigation

Kinematics Code · Vision Code

Duckiebots are small, affordable differential-drive robots built on a Raspberry Pi, designed for autonomous driving research and education. I worked on this as part of CMPUT 503 — a hands-on robotics course covering perception, control, and systems integration.

I built and deployed ROS nodes on real hardware: starting with low-level wheel encoder odometry to drive precise distances and rotations, then layering in computer vision for colour-based line detection and HSV-tuned lane boundary tracking. I implemented and compared P, PD, and PID controllers for lane following, ultimately achieving stable full-circle autonomous navigation using a P controller with real-time camera feedback.

Lane following

Kinematics

  • Traced a “D”-shaped path with LED state signalling across three motion phases [video]
  • Recorded and plotted odometry from ROS bags to analyze real vs. intended trajectory

D-shape graph

Demos: Reverse parking · Drive square

Computer Vision & Lane Following

  • Corrected lens distortion using intrinsic camera calibration parameters with OpenCV
  • Detected red, blue, and green lines in real-time using HSV masking and contour extraction, triggering distinct robot behaviours per colour [red] · [green] · [blue]
  • Implemented P, PD, and PID controllers for lane following; P alone proved most effective given rapid camera feedback [P] · [PD] · [PID]
  • Achieved full-circle autonomous lane following with throttle clipping and fallback reference handling for lost lane markers [video]

Red line detection


Collaboration: Alex Liu & Minh Pham.