Project Overview
Final project for Duke University's Introduction to Robotics course.
Group members: Morgan McCloud, Annabelle Chu, Jinze Lyu, Nohemi Sepulveda
Our project leverages robotics and computer vision to automate the decorative frosting of desserts. Using a camera-guided robotic arm equipped with an icing extruder, the system identifies each dessert’s position and applies intricate, layered decorative patterns with precision and high repeatability. By combining real-time visual feedback with a controlled extrusion process, we create consistent, visually appealing designs on cookies, cupcakes, and donuts.
This robotics project was designed with ROS2 Iron.
System Workflow
Preparation
Fill syringe with desired frosting and attach to robot end-effector
Place desserts in the robot's workspace
Computer Vision and Motion Planning
Run motion planning and computer vision script
Copy configuration YAML to folder with motion planning script
Execution
Motion planning detects config YAML and robot frosting the desserts
Flowchart of human-robot interaction with Frosty Bot
Frosty Bot system diagram
Individual Contribution
I was in charge of the motion planning for the robot arm. Given x and y coordinates in robot space of various pastries, the robot would need to navigate to and draw a specific pattern on each of the desserts. I first adapted the example code from Lab 6 (ECE383 Fall 2024) to initialize the arm. I then worked with Jinze create a configuration file YAML format that will give information to the motion planning code about where the pastries are in space.
Motion planning code steps:
The robot would move to a configuration that gave a birds eye view of the taskspace for Jinze's computer vision code to detect pastries
Wait for a YAML with detected pastries to be dropped in the relative folder
For each pastry detected in the task space:
Determine the pattern to be drawn (spiral for cupcakes, radial cosine for donuts, and star for cookies)
Offset the pattern by the position provided by the YAML
Start the motor to begin extruding frosting and follow waypoints to draw the respective design on the dessertrost the pastries accordingly. I devised an algorithmic approach to determining the waypoints of a pattern so it could be drawn with different centerpoints so long as the pastry was in the taskspace. It could draw a star, radial cosine, and swirl with multiple layers.
Video of motion planning in RViz
Pattern Generation
Spiral
The algorithm to generate the spiral pattern is based off of the Archimedes Spiral. The overall size of the pattern and separation between points were adjusted to fit the general size of a cupcake by adjusting the following constants in the XY coordinate equations:
x(t) = x_center + r(t)*cos(theta(t))
y(t) = y_center + r(t)*sin(theta(t))
t = current time step
r(t) = r0 + v*t
r0 = offset of spiral starting location
v = how 'quickly' the spiral happens
theta(t) = omega*t
omega = how 'tight' the spirals are
x_center and y_center obtained from configuration file
Radial Cosine
The radial cosine is effectively a cosine that wraps around a circle. This pattern can have a variable frequency of cosine waves wrapped around the center and can have a variable amplitude. The frequency and amplitude were tuned for the aesthetics of frosting a donut. The general equation for the radial cosine is as follows:
x(t) = r(t)*cos(t) + x_center
y(t) = r(t)*sin(t) + y_center
t = current time step
r(t) = R + A*cos(n*t)
R = radius of the circle the cosine is wrapped around
A = amplitude of cosine wave
n = number of cosine oscilations around the circle
x_center and y_center obtained from configuration file
Star
The star can be generated with any number of 'spikes', and for this application, we decided on five. The size of the star was based on the general size of the cookie - the dessert it was frosted onto. The XY coordinates were determined by:
Finding the angle each spike would project from the X axis
Using defined inner and outer radii of the star, determine the vertices of the star
Interpolate between the vertices
Offset the star by the given center point of the pastry in real space
Example pattern generations for a spiral, radial cosine, and star using the algorithms used during motion planning.
Physical system demonstration!
Videos of robot using computer vision to frost different 3D printed pastry phantoms