T2T: Text-to-Tangram Robotic Assembly

Team 22 — EECS 206A — UC Berkeley Fall 2025

Ansh • Anthony • Atharva • Athul • Jaimyn

Introduction

Goals

A tangram puzzle is a set of 7 uniquely-colored pieces—1 square, 1 parallelogram, and 5 right isosceles triangles—that people try to arrange to match different prompts/objects (e.g. bear, house, swan, etc.).

Our goal is to build an end-to-end system that ingests a language description of a desired object to imitate and outputs the desired control actions to arrange the pieces in a configuration which resembles the given language description. The UR7e robot arm will then accept these instructions, and assemble the shape.

In summary, there are 3 main components:

  1. A planning algorithm that generates feasible target tangram configurations from text input.
  2. A vision module for tangram pose estimation.
  3. A system to generate robot trajectories that will go from a starting tangram configuration to a target tangram configuration.

Justification

Our group pursued this Text-to-Tangram (T2T) system to explore the intersection of natural language understanding and precise physical manipulation. This project aims to produce aesthetic results that demonstrate a robot's ability to translate human intent into art. By transforming linguistic prompts into precise, aesthetic, and physical geometric arrangements, we view this work as a tangible step toward developing robots as genuine creative collaborators.

Also, we felt that this project was on the frontier of AI and robotics innovation. Our experimentation revealed that even state-of-the-art Vision Language Models (VLMs) struggled with the spatial reasoning required for tangram assembly in our environment. We found that Gemini 3 Pro, released in mid-November 2025, was the only model capable of successfully orchestrating our MCP/Pygame environment. This reliance on the latest reasoning models highlights the complexity of the task and positions our system as a benchmark for what is possible at the edge of planning and design.

Design

Design Criteria

The goal for our project is to autonomously assemble a tangram puzzle in a configuration that aligns with a given text input prompt. In this problem, we assume that the system does not have the desired tangram configuration provided to it ahead of time, which it instead must generate, and that there is no human feedback during any stage of the process. In terms of physical execution, we do not assume that the original configuration of the tangram pieces are known, only that they are placed flat on the table in full view of the camera, within rough proximity of the Aruco tag on the table. By the end of the process, the robot should have relocated all tangram pieces into a new configuration that is semantically recognizable as having followed the prompt (this objective is somewhat subjective, given the naturally open-ended nature of the tangram puzzle).

Design Choices

LLM-based Planning (MCP Environment)

In order to execute on this objective, we designed an overall pipeline that leverages a large language model (LLM) in a Model Context Protocol (MCP) environment to produce our desired two-dimensional configuration of the tangram pieces. We believe that among available methods for generation, for example nearest neighbors from an existing dictionary of configurations or an explicit text-conditioned image generation model, the LLM in this controlled environment would be the best equipped to produce configurations that are both physically feasible with the given tangram pieces (no hallucination of new pieces, for example) while also customized to the infinite range of possible text inputs.

This selection does come at the cost of execution time, however, as the MCP pipeline involves a long series of LLM inference calls in order to produce one single configuration result. In this case, we felt that such generation costs were worth the benefits in generation quality. If this application were to be deployed in a practical context, where throughput may be more of a concern than design novelty, then an alternative method with a focus on inference time might be preferable.

Custom Suction Gripper

For physical execution, we focus on a pipeline using a UR7e robotic arm with custom suction gripper to rearrange the tangram pieces according to image input from the generation stack. In this design, we leverage the UR7e's natural embodiment benefits when it comes to manipulation tasks. By creating a suction-based attachment for our robot gripper, we allow the robot to retrieve and manipulate the tangram pieces from a single overhead contact on the wide, smooth surface of the pieces, rather than the comparatively more challenging grasp of the thin sides. In the case of triangular pieces, in which there are no pairs of parallel sides to support parallel-jaw grasping, this invariance to piece shape is a particular benefit.

In practice, this selection does limit the potential range of tangram configurations to the UR7e's reachable workspace, as it is not a mobile robot, but we feel that this is secondary to the main assembly task. The use of a 3D-printed custom gripper attachment, rather than the original parallel-jaw gripper, does present some downsides in terms of durability, but the tangram use case in which much force or load is expected. In a practical engineering environment, selecting a more specific robot embodiment for this form of 2D manipulation, such as a SCARA manipulator or gantry robot, might be preferable in terms of the potential speed benefits. The reduced number of actuators in these systems would also reduce the number of potential failure points when compared to the UR7e with 6 actuated joints. In terms of the end effector, a pneumatic suction method, rather than our mechanical solution, would allow for greater suction force, in turn helping improve grasp consistency. Imperfect piece surfaces might be a concern in this setting, where a more powerful gripper could help overcome small deformities. We did not explore these alternatives primarily as a matter of contextual resources.

Vision-based Pose Estimation

In terms of piece detection and pose orientation, we focus on a vision-based system with a single RGB camera (we use a RealSense depth camera, but ended up only leveraging its RGB capacity). In this avenue, we leverage traditional computer vision methods like color-based masking and polynomial fitting, because the multi-colored geometric pieces naturally yield themselves to this form of rudimentary detection. Because we assume that the pieces begin flat on the table's surface, there is no need for depth estimation.

One cost of this approach is that the table height and specific color parameters must be specifically tuned to the assembly environment. If lighting conditions change in the room, then piece detection will fail. Similarly, if the table height shifts, then the pose estimates must be hard-coded to the new height accordingly. To overcome this issue, one could use a learned image segmentation model for piece masking (as we investigated with SAM3), or a learned pose estimation model like FoundationPose, but these lead to overhead inference costs and inject additional model noise into what is fundamentally a more simple problem than what they are designed for. For a practical engineering setting, one might focus on a more dedicated perception system, just as a fixed depth camera positioned overhead parallel to the table surface, which would help remove the limitations surrounding both of the above variables. However, for our purposes in which we must share the robot hardware with other groups and constantly reassemble our configuration, we focus on computation as a means of lending increased adaptivity over per-step consistency.

Implementation

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

Suction Gripper CAD

Gripper Mounted on Robot

Gripper Mounted on Robot

Laser-cut Acrylic Tangrams

Laser-cut Acrylic Tangrams

Finally, testing this gripper on our wooden tangram pieces revealed 2 deficiencies:

  1. 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.
  2. 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.

MCP Pygame Environment

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:

  1. 2D Pose estimation from an input target configuration (expressed as a 2D image)
  2. 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.

2D Pose Detection Output

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.

3D Pose Detection on Real Tangrams

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. 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. 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. 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. 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.
System Architecture Diagram

Results

Conclusion

Challenges Encountered

  • ●Noisy perception: Tried using Meta's SAM3, but was too big to deploy; tried hosting on another server, but didn't work
  • ●Noisy Aruco detection: Lighting variations caused inconsistent detection
  • ●Occlusion of Aruco tags by robot arm: Fix: Only calculate transforms once and save!
  • ●MoveIt failures: Trajectory planned but failed to execute
  • ●Inconsistent release: Fix: 3 settings (closed, open, neutral) on gripper – partial opening of hand
  • ●Integration: Coordinating all system components together

In this project, we have demonstrated our ability to build a system that can effectively plan novel tangram arrangements and execute them on the fly with custom hardware we have designed. We think this is an excellent step towards creating robots with artistic and aesthetic capabilities, and the means of enacting them on the world. We're really excited about what we've accomplished, and the complex and bespoke engineering we've had to do for this project has given us a new appreciation for our own human senses. Taking the insights of advances in NLP and computer vision, we also believe that, in the future, tasks like these will be accomplished by a single general system, rather than the specialized system which we have implemented above.

Future Improvements

  • ✓As time goes on, smaller, faster LLMs will improve performance with lower latency!
  • ✓Currently, our perception stack is very fragile (light, Aruco detection, etc) – Being able to use a quantized/lighter SAM3 model would improve our detection and reduce the noisiness of our pose estimation.
  • ✓Another option we have is to use a second camera, again for the purpose of improving our pose estimation capabilities, and reducing the impact of Aruco tag occlusion.
  • ✓One of the ideas we had going in, was to be able to play Tangram pictionary, where the robot and a person take turns choosing a prompt, arranging the pieces, while the other player has to guess the prompt. Building out the infrastructure to do this could be super interesting! This would probably require lower planning latency though.
  • ✓Improve IK success rates/trajectory quality and performance.

Team

Ansh

Ansh

First year MS EECS student co-advised by Prof. Avideh Zakhor and Prof. Ken Goldberg. His research interests lie in robotics, computer vision, and autonomous vehicles.

Contributions: Pose estimation, physical execution pipeline, System integration and testing

Anthony

Anthony

EECS 5th year MS advised by Prof. Angjoo Kanazawa, and his research interests lie in computer vision, human motion, and robotics.

Contributions: Vision pipeline development, system integration and testing

Atharva

Atharva

4th year CS + Stats major doing research at the ICON lab. He dreams of the day when he can tell a robot to wash his dishes.

Contributions: Path planning, MCP pipeline

Athul

Athul

4th year MechE + EECS major doing RL research with Prof. Murat Arcak. He thinks the UR7e is scary.

Contributions: Custom suction gripper design, MCP pipeline, website

Jaimyn

Jaimyn

4th year EECS major who performs robotics research under Prof. Ken Goldberg. His research interests lie generally within the fields of robotics for automation and machine learning for robotics, for which he has some industry experience and a number of publications. For this project.

Contributions: Pose estimation and physical execution pipeline

Additional Materials

References

  1. A. Goldberg, K. Kondap, T. Qiu, Z. Ma, L. Fu, J. Kerr, H. Huang, K. Chen, K. Fang, and K. Goldberg. "Blox-Net: Generative Design-for-Robot-Assembly Using VLM Supervision, Physics Simulation, and a Robot with Reset." 2024.
  2. N. Ravi, V. Gabeur, Y.-T. Hu, R. Hu, C. Ryali, T. Ma, H. Khedr, R. Rädle, C. Rolland, L. Gustafson, E. Mintun, J. Pan, K. V. Alwala, N. Carion, C.-Y. Wu, R. Girshick, P. Dollár, and C. Feichtenhofer. "SAM 2: Segment Anything in Images and Videos." 2024.