Hardware
Notably, tangram pieces are small and thin, which would pose quite a challenge for gripping with a two-fingered robot arm (and the triangular shapes add to the complexity of gripping as well!). In addition, dealing with the effects of collisions and creating enough space for the end effector to pick up the piece, would greatly increase the sophistication that our planning algorithm would require for effective performance.
To counteract this, we designed our own bespoke suction gripper that converts the action of the gripper claws closing into a suctioning action on the syringe, allowing for the suction gripper to pick up a piece. Conversely, when the gripper claws open, the syringe is depressed, which drops the piece.
Crucially, this mechanism allows us to pick up and drop pieces with minimal effect on neighboring pieces, allowing us to keep our motion planning algorithm quite simple.

Suction Gripper CAD

Gripper Mounted on Robot

Laser-cut Acrylic Tangrams
Finally, testing this gripper on our wooden tangram pieces revealed 2 deficiencies:
- The cross-section of the suction cup wasn't fully enclosed within the smallest tangram pieces, compromising the quality of seal on the piece and reducing the reliability of pick ups.
- The wooden texture of the pieces also slightly compromised the quality of our seal.
To fix both problems, we laser cut our own tangram pieces out of colored acrylic sheets.
Key Components:
- UR7e Robot Arm
- Custom 3D-printed suction gripper attachment
- Syringe-based suction mechanism
- Laser-cut colored acrylic tangram pieces
- Intel RealSense depth camera (RGB only)
- Aruco markers for calibration
Tangram Planning
During initial testing, we used a dataset of tangram arrangements that we web-scraped from tangram-channel.com, applying our pose detection algorithms to extract piece poses. However, one of the components of our project that we were most excited about was the ability to autonomously generate new arrangements, and leverage the capabilities of LLMs to make adjustment directions in natural language that could then be executed during planning.
Initially, we were planning on just having VLMs generate the target images zero-shot, but we ultimately found this wasn't feasible; preliminary testing demonstrated that VLMs would often end up hallucinating different parts by either changing their shapes, relative sizes, or colors.
We instead fixed this problem by creating a Pygame environment as a virtual representation of the arrangements of the tangram shapes. We then equipped the environment with MCP function calls facilitating shape movement (translation or rotation) and environment visualization (getting an image of the environment, getting the positions of all shapes, determining if any intersections exist, etc.). We gave the LLM access to this tool to iterate on a plan until it was successful, and using the final environment state as our schematic to target.
Note that no motion planning is done during this stage; this part is solely about turning a text prompt into a plausible tangram arrangement that can then be executed by the robot, using the tools/methods described for the easier versions of the task.
In coming up with this idea, we took an approach similar to Blox-Net from the AUTOLab. The paper is about using blocks to construct models in 3D (like a giraffe or the Eiffel Tower). However, planning in three dimensions is difficult and the added complexity of this required a physics simulator. Fortunately, the 2D nature of our problem sidestepped much of this.
Pose Estimation Module
In order to actually perform tangram assembly, we require two forms of tangram pose estimation:
- 2D Pose estimation from an input target configuration (expressed as a 2D image)
- 3D Pose estimation on the work table surface
2D Pose Estimation
In order to perform 2D pose estimation, we first focus on generating image masks for each of our tangram pieces. We assume that the pieces are each of visually distinct colors, so the careful selection of appropriate HSV ranges allows us to produce approximate masks that distinguish each piece from the rest of the image.
With masks generated, we are then able to use cv2.approxPolyDP to fit polygonal contours to each of our pieces, which additionally provides us with coordinates for the corners of each piece. By defining the center of each part using the centroid of these corners, and pre-defining the position of polygonal corners relative to each piece's zero-angle configuration, we are able to immediately extract (x, y, theta) estimations from our piece polygons. These constitute our pose estimation for each piece in 2D.

3D Pose Estimation
Luckily for us, we are actually able to translate 3D pose estimation into the same problem as 2D pose estimation! To do this, we can leverage the 8-point algorithm to estimate the homographic projection between our camera's image plane (viewing the table surface from an angle) and the table plane itself by mapping the corners of our table Aruco tag to a fixed square. Undoing this relative transformation by performing the corresponding inverse warp then produces a projection of the table's surface that approximates an overhead view. This process is known as rectification.
After rectification, we can apply our 2D pose estimation pipeline in order to compute the (x, y, theta) position of each piece, relative to the table Aruco tag. Because rectification also scales the image according to the Aruco tag, this 2D pose result gives us a raw estimation in terms of the pieces' 3D x and y coordinates, as well as orientation about the z axis. We assume that the pieces lie on the surface of a flat table, so their z coordinates and orientations with respect to the remaining rotational axes are fixed.
The 2D pose estimates from our image of target positions can also be transformed in this way, where the center of the target image is assigned at a fixed translational offset to the Aruco tag center. As a result, we are able to publish all 14 3D poses (the 7 current real-world poses and 7 desired assembly poses) on their own respective ROS2 topics.

Note: We also developed an image segmentation pipeline using SAM3 to produce binary masks of the images based on semantic text input. This produces qualitatively much cleaner masks that are more stable when it comes to lighting variations, but presents issues in terms of identifying all of the pieces at once. It often misses one or two of the pieces by instead re-selecting a different piece in the same color scale. Integrating this process with our existing runtime process included executing SAM3 on a separate server, so after some overhead issues we decided to stick to the analytical HSV solution.
Path Planning and Execution
In order to actually assemble our tangram given the pose estimates, we leverage a conceptually simple pick-and-place pipeline like the one presented in Lab 7 of this class. Using the TF package, we are able to link the observed pose of our table Aruco marker a with the base link of the UR7e robot (by visually observing the transformation between the table and robot base Aruco markers), providing a much-needed connection between the pieces' 3D table poses and the corresponding robot end-effector positions.
By subscribing to the ROS2 topics that publish our current and target piece poses with respect to the table Aruco tag (see 3D Pose Estimation), we can compute the corresponding end effector transformations that will allow for the pick-and-place motion. Because of the addition of the suction gripper attachment, which we do not have modeled within the programming environment itself, we compute an additional offset to account for the suction head's offset from the tool base.
Using the MoveIt inverse kinematics functionality developed in Lab 7, we can then plan a hard-coded series of robot actions between the pick and place poses for each of the 7 tangrams, resulting in a final robot assembly process.
Overall Pipeline
With each of our individual components developed, our overall tangram assembly pipeline is as follows:
- 1
LLM Planning: Using our tangram planning module, we provide our LLM with the desired text prompt for our tangram assembly and have it design a corresponding arrangement of the pieces. This arrangement of tiles can then be exported as an image file.
- 2
Target Pose Extraction: Given the image file for our target configuration, our 2D Pose Estimation program is able to extract and broadcast all of the tangram piece target poses to their respective ROS2 topics.
- 3
Current Pose Detection: In parallel, the 3D Pose Estimation system processes RGB input being streamed from the RealSense camera and computes the corresponding 3D poses of the tangram pieces in the real-world environment. These poses are also published on their respective ROS2 topics.
- 4
Robot Execution: Given both sets of pose topics as inputs, the Planning and Execution program plans a series of motion trajectories and gripper actions to successively pick and place each of the 7 tangram pieces, moving them from their initial positions into the final tangram assembly configuration.
