This project was developed within the framework of MRAC Workshop 2.1: Team Collaborative Workflow and Modular System Development. The workshop focuses on learning, internalizing, and applying collaborative software development practices using Git and GitHub through the development of a modular robotic system. In this context, the group was tasked with designing and implementing a robotic flip bottle challenge using a robotic arm, with an emphasis on system engineering, thorough documentation, and reproducibility.
Overview
Flipping a water bottle so that it lands upright may look like a simple game, but from a robotics perspective it is a surprisingly complex task.
It involves non-linear dynamics, precise timing, uncertainty in physical properties, and the challenge of transferring learned behavior from simulation to the real world.
This project explores how an industrial robot (UR10e) can learn to perform a bottle flip through a structured pipeline that combines simulation, learning, and real-world execution, using ROS2 as the system backbone and Docker for reproducibility.
The project emphasizes process, architecture, and robustness, showing how complex robotic behaviors can be developed step by step.
The goal of the system is to throw a bottle such that:
- The bottle performs a 360° rotation
- The bottle lands in a vertical position
- The process is repeatable
System Overview
The project is structured as a modular robotic system composed of multiple interacting components.
At a high level, the system is divided into three domains:
- The development environment
- The simulation and learning environment
- The real robotic system

All components communicate through ROS2, which allows each part of the system to be developed, tested, and replaced independently.
PHASE 1: Enviroment Setup
The first step focuses on creating a stable and reproducible development environment.
The project runs on Windows, but instead of installing all dependencies directly on the host system, it uses:
- WSL2 to run Linux
- Docker to encapsulate the software environment
- ROS2 Humble as the robotics middleware

This setup ensures that the same environment can be reproduced across different machines and avoids common dependency conflicts. The robot software, simulation tools, and learning libraries all run inside a Docker container.
PHASE 2: Simulation of the Bottle Flip
Before interacting with the real robot, the bottle flip task is developed entirely in simulation.
The robot, the bottle, and the physical environment are modeled using a physics engine. This allows the system to execute many throw attempts safely and efficiently. Each simulated launch produces data describing the bottle’s trajectory, rotation, and final landing orientation.

Simulation plays a crucial role in this project because the physics of a partially filled bottle are difficult to model analytically. Instead of hard-coding rules, the system learns from repeated trials.
PHASE 3: Learning the Throwing Behavior
Using data generated in simulation, the system enters a learning phase.
The goal of this phase is to learn a throwing policy: a relationship between how the robot moves and whether the bottle lands upright. By iteratively evaluating simulated throws and adjusting parameters, the system gradually improves its success rate.

This learning process remains fully contained within the simulation environment, allowing rapid experimentation without risk to hardware.
PHASE 4: Validation and Visualization
Before transferring the learned behavior to the real robot, the results are carefully inspected and validated.
Visualization tools are used to analyze:
- robot trajectories,
- release timing,
- and safety constraints such as joint limits and collisions.
This step acts as a safety and sanity check, ensuring that the learned motions are physically feasible and appropriate for execution on a real industrial robot.
PHASE 5: Sim-to-Real Transfer
Once validated, the learned behavior is transferred from simulation to the real robot.
This transition is handled gradually. The robot first executes conservative, low-speed motions before moving toward the full throwing action. Differences between simulation and reality—such as friction, compliance, and small timing errors—are expected and carefully managed.

Sensor feedback, including camera data, is used to observe the outcome of each real-world attempt and evaluate success.
PHASE 6: Real-World Execution
In the final phase, the system performs the complete bottle flip task autonomously:
- grasping the bottle,
- executing the throwing motion,
- releasing it at the correct moment,
- and evaluating whether it lands upright.
Success is not defined solely by the bottle standing upright, but by the fact that the system operates as a coherent, reusable pipeline that integrates simulation, learning, and physical execution.
Complete DEMO Workflow





Conclusion
This project demonstrates how seemingly simple physical tasks can reveal significant complexity when approached through robotics.
By combining ROS2, Docker, simulation, and machine learning, the project establishes a robust workflow that enables experimentation, learning, and safe deployment on real hardware. The same methodology can be applied to a wide range of robotic manipulation and fabrication tasks, highlighting the importance of system design over isolated solutions.
