Abstract
Bridging the "reality gap" remains a significant challenge in applying Deep Reinforcement Learning (RL) to real-world robotic tasks. This paper introduces a robust sim-to-real framework for contact-rich robotic assembly, specifically the peg-in-hole task. The approach utilizes CycleGAN for visual style transfer and a novel force control mapping to ensure safe physical interaction. By training a Soft Actor-Critic (SAC) agent in simulation and deploying it on a real UR5e robot, the system achieves high success rates using only a single camera and minimal real-world data.
Introduction
Deep Reinforcement Learning (RL) holds great promise for automating complex robotic tasks. However, training agents directly in physical environments is often impractical due to time constraints, computational costs, and the risk of hardware damage. While simulators provide a safe and efficient training ground, the discrepancy between simulated and real-world environments—the "reality gap"—often leads to poor performance upon deployment.
This gap is particularly pronounced in assembly tasks where precise visual alignment and physical contact are critical. Discrepancies in visual rendering or physics modeling can cause a robot to jam components or damage itself. This work addresses these challenges by decoupling visual perception from physical execution through domain adaptation and compliant force control.
Methodology
The proposed framework consists of three primary components designed to facilitate seamless transfer from simulation to reality.
1. Learning in Simulation
A Soft Actor-Critic (SAC) agent is trained within a Bullet-based physics engine. To improve learning efficiency and handle high-dimensional visual data, an autoencoder is employed to compress camera images into a 128-dimensional latent representation. Training on this compressed space proved essential for policy convergence; experiments showed that training on raw pixels failed to reach successful performance.
2. Visual Domain Adaptation
To overcome visual differences between the simulator and the real world, the framework utilizes CycleGAN. This generative model maps real-world camera observations into the visual style of the simulator. A key advantage of CycleGAN is its ability to learn from unpaired data, eliminating the need for perfectly synchronized images from both domains.
3. Force Control Transfer
While the simulation uses position control, real-world assembly requires safety during contact. The authors implement a mapping that converts the policy's position increments ($\Delta P$) into force commands ($C_{real} = K \Delta P$). This transformation enables a compliant force-control strategy, allowing the robot to safely navigate contact and "slide" the peg into the hole without damaging the hardware.
Experimental Setup
The system was evaluated on a peg-in-hole assembly task. Simulated data was generated across four distinct scenes with varying colors (red, white) and textures (wood, metal) to test generalization. Real-world experiments were conducted using a UR5e robot equipped with a RealSense D415 camera. Notably, the CycleGAN required only 200–300 real-world images for effective training, demonstrating the framework's data efficiency.
Results and Discussion
The framework demonstrated high performance and robustness in both domains. In simulation, the agent achieved success rates between 96% and 99% for most environments. Upon transfer to the physical robot, the system maintained success rates of 86% for red blocks and 88% for white blocks.
Key insights from the experiments include:
- Latent Space Representation: Compressing visual data into a latent representation was the critical factor that allowed the RL policy to converge.
- Directional Intelligence: Mapping position changes to force vectors allowed the agent to leverage its learned directional logic while maintaining physical compliance.
- Robustness: The agent successfully recovered from external disturbances, such as manual camera occlusion or physical pushes to the robot arm during task execution.
Conclusion
This work presents an effective strategy for sim-to-real transfer in robotic assembly. By combining visual domain adaptation via CycleGAN with a compliant force control mapping, the framework achieves high success rates with minimal real-world data. Future work will focus on expanding the action space to include rotational degrees of freedom and applying the method to more complex industrial assembly scenarios.
Summary updated