techlist.io

Sim To Real

5 posts

OpenAI2018-07-294 min readCurated summary

Learning dexterity

# Learning Dexterity: Training a Robot Hand Entirely in Simulation OpenAI's Dactyl system trains a Shadow Dexterous Hand to reorient physical objects using a reinforcement learning policy learned entirely in simulation, with no fine-tuning on the real robot. The core idea is domain randomization: rather than trying to make the simulator physically accurate, the policy is trained across a wide distribution of randomized physical and visual parameters, so that the real world becomes just one more variation it has already seen. The result is a robot that rediscovers human-like grasps and manipulates blocks and other shapes on hardware, reaching up to 46 to 50 consecutive rotations with vision or motion-tracking feedback. ## The Problem - Dexterous manipulation has lagged behind locomotion in robotics, and the Shadow hand has 24 degrees of freedom compared to 7 for a typical arm. - The robot must handle noisy, delayed sensor readings, occluded fingertips, and unobservable properties such as friction and slippage. - Reinforcement learning works well in simulation but has produced limited results on physical robots. ## Why Not Simulate Realistically or Train on Hardware - Simulators can generate enough data to train complex policies, but manipulation physics (contact, deformable fingertips, tendon stretching, rolling resistance) is hard to model accurately. - Training directly on hardware would take years of real experience for a task like object reorientation. - Domain randomization sidesteps this tradeoff: the simulator prioritizes variety over realism, so policies generalize to the real world. ## Control and Vision Architecture - **Control policy:** An LSTM lets the network infer environment dynamics from its history. It achieved about twice as many rotations as a memoryless policy. Training used Rapid, the scaled PPO implementation from OpenAI Five, on 6,144 CPU cores and 8 GPUs, collecting about 100 years of experience in 50 hours. - **Vision network:** A convolutional network takes three RGB camera views and estimates the object's pose. It was trained only on simulated images rendered in Unity with randomized visual properties. Multiple cameras resolve occlusion and ambiguity. - The two networks are independent and combined at deployment, so the hand can manipulate an object by seeing it. ## Emergent Strategies - Dactyl discovered grasp types from the GRASP taxonomy (tip pinch, palmar pinch, tripod, quadpod, power grasp, and five-finger precision grasp) without being taught them explicitly. - For tip pinches, it favored the thumb and little finger, whereas humans typically use the index or middle finger. The robot's extra little-finger degree of freedom likely explains this choice. ## Results - Randomized policies achieved far more rotations than non-randomized ones. A non-randomized policy managed a median of 0 successes, while the fully randomized policy reached a median of 11.5 with vision and 13 with motion tracking, and a maximum of 46 and 50 respectively. - Vision-based pose estimation performed nearly as well as direct motion-tracking readings. - Without randomization, a policy needed about 3 years of simulated experience to rotate an object. Full randomization required about 100 years, and most of the training time went into robustness to dynamics. ## Surprises and Negative Results - **Tactile sensing was unnecessary.** The policy used only fingertip locations and object pose, ignoring the available touch sensors, because a limited sensor set was easier to model in simulation. - **Randomizations transferred across shapes.** Randomizations designed for a block worked on an octagonal prism without modification. A sphere performed poorly, likely because rolling behavior was not randomized. - **Systems engineering mattered as much as algorithms.** One engineer's faster laptop masked a timing bug that hurt performance for everyone else. - **Faster control did not help.** Reducing the action interval from 80 ms to 40 ms increased training time without improving real-world performance. - **Real data did not help vision.** Simulator-only training matched the accuracy of mixed sim-and-real training, and real tracking data suffered from latency, measurement error, and fragility to configuration changes. ## Conclusion Dactyl demonstrates that scaling domain randomization and recurrent reinforcement learning can solve dexterous manipulation tasks that were previously out of reach for robotics, using a simulation-first pipeline. The authors frame it as one step in a cycle of developing a learning algorithm, scaling it on hard simulated tasks, and transferring the result to the real world.

OpenAI2017-10-182 min readCurated summary

Generalizing from simulation

Robot controllers can now be trained entirely in simulation and deployed on physical robots, where they react to unplanned changes in the environment while solving simple tasks. The simulator doesn't need to match the real world in appearance or dynamics. Instead, relevant aspects such as friction, action delays, and sensor noise are randomized during training, and the policy needs only a small amount of real-world self-calibration. The authors argue that randomizing the simulator will be the most important route to general-purpose robots. ## Dynamics Randomization - Training randomizes 95 properties that govern the environment's dynamics, including each link's mass, the friction and damping of the manipulated object, the height of the table, action latency, and observation noise. - An LSTM-based policy trained this way can push a hockey puck around a table. Feed-forward networks fail at the task, while LSTMs use past observations to infer the world's dynamics and adjust their behavior. ## Vision-to-Action Control with Reinforcement Learning - A robot was trained end-to-end in simulation with reinforcement learning, then deployed on hardware. The resulting system maps visual input directly to actions without special sensors and adapts to visual feedback. - Conventional RL works well only when small changes in action produce incremental reward changes, which suits tasks like walking. Most manipulation tasks lack such rewards. A dense reward for block stacking would have to encode arm-to-block proximity, approach orientation, lift height, and distance to the target. - After months of failed attempts at pick-and-place with conventional RL, the team developed Hindsight Experience Replay (HER). HER learns from a binary success/failure reward by treating a failed trajectory as if it had been the intended goal, so every attempt still produces useful learning signal. - The implementation uses an actor-critic setup with asymmetric information. The critic sees the full simulator state and estimates future rewards, while the actor sees only RGB and depth images, which are available on the real robot. The critic's accurate feedback thus trains an actor that relies only on real-world sensor data. - Domain randomization on visual shapes produces a vision system robust enough for the physical world. ## Computational Costs - Dynamics randomization slows training by about 3x. - Learning from images instead of state is about 5–10x slower.

OpenAI2017-10-172 min readCurated summary

Sim-to-real transfer of robotic control with dynamics randomization

Simulators give robot-learning agents abundant, safe training data, but policies trained in them often exploit simulator-specific quirks and fail on real hardware because of modeling error. This paper bridges that "reality gap" by randomizing the simulator's dynamics during training. The resulting policies adapt to a wide range of dynamics, including ones far from those they were trained on, so they transfer to the real world without any physical training. On a robotic-arm object-pushing task trained only in simulation, the policies performed comparably on a real robot, reliably moving an object to a target from random starting configurations. ## Dynamics Randomization as a Sim-to-Real Method - The core idea is to vary the physical parameters of the simulator, such as mass and friction, across episodes during training rather than fixing them to one estimate. - Exposure to this variety pushes the policy to infer the current dynamics from its experience and adjust its behavior, instead of memorizing one simulator's behavior. - Because the real world's dynamics are one more instance within the randomized range, the policy can generalize to it without any real-robot training. ## Results on Object Pushing - The method was evaluated on a robotic-arm task that requires pushing an object to a desired location. - Policies trained exclusively in simulation maintained similar performance on the physical robot, reliably reaching goals from random initial configurations. ## Design Choices and Robustness - The authors examined how various design decisions affect transfer performance. - The resulting policies remain robust to significant calibration error in the simulator's parameters, which reduces the need for precise system identification before deployment.

OpenAI2017-10-172 min readCurated summary

Asymmetric actor critic for image-based robot learning

This post presents an approach to image-based robot learning that uses the simulator's full state information during training without requiring it at deployment. The actor-critic method trains the critic on full states while the policy receives only rendered RGBD images. The authors report that this asymmetry significantly improves performance on simulated tasks, and that combined with domain randomization it transfers to a real robot, for picking, pushing, and moving a block, without any real-world training data. ## Why Simulation-Based Robot RL - Reinforcement learning works well in many sequential decision-making domains, but training on physical robots is expensive and can be dangerous. - This motivates learning control policies in a physics simulator. - Prior sim-to-real work has transferred policies successfully, but the authors argue it often doesn't fully exploit what the simulator offers. ## Asymmetric Actor-Critic Training - The simulator provides full state observability, which is unavailable on a real robot. - The critic is trained on full states, so it can use this privileged information to evaluate actions. - The actor (policy) takes only partial observations, specifically rendered RGBD images, matching what a real robot would have. - Because only the actor is needed at deployment, the image-based policy runs without access to full state. ## Simulated Experiments - The authors evaluate the method on a range of simulated tasks. - Using asymmetric inputs significantly improves performance over the image-based policy trained without this asymmetry. ## Sim-to-Real Transfer - The method is combined with domain randomization to bridge the gap between simulated and real visual inputs. - Real robot experiments cover picking, pushing, and moving a block. - The transfer succeeds without training on any real-world data. ## Takeaway Privileged simulator information can be used to improve image-based policies when it is available only at training time, a way of getting more from simulation than simply copying the same inputs into the policy.

OpenAI2017-07-042 min readCurated summary

Hindsight Experience Replay

The paper introduces Hindsight Experience Replay (HER), a technique that lets reinforcement learning agents learn efficiently from sparse, binary rewards without hand-engineered reward functions. HER works with any off-policy RL algorithm and acts as a form of implicit curriculum. The authors test it on robotic arm manipulation and show that policies trained in simulation can complete the same tasks on a physical robot. ## The Sparse Reward Problem - Sparse rewards are one of the main obstacles in reinforcement learning, since an agent receives little useful feedback until it succeeds. - The usual workaround is reward engineering, which is labor-intensive and can distort the learned behavior. - HER is designed to avoid this by making binary success or failure signals sufficient for learning. ## Hindsight Experience Replay - HER is a replay-based method that can be combined with an arbitrary off-policy RL algorithm. - It enables sample-efficient learning from binary rewards, which indicate only whether the task was completed. - The authors describe it as an implicit curriculum, meaning it structures the learning process without requiring an explicit sequence of progressively harder tasks. ## Robotic Manipulation Experiments - The method is evaluated on three object-manipulation tasks with a robotic arm: pushing, sliding, and pick-and-place. - In every task, the only reward signal is whether the task was completed. - Ablation studies show that HER is essential, since training in these challenging environments is not feasible without it. ## Transfer to a Physical Robot - Policies trained in a physics simulation are deployed on a real robot. - The physical robot successfully completes the tasks, which indicates that the learned policies transfer from simulation to reality. Where reward design is hard or success is easy to define but hard to shape, HER offers a way to train with simple binary success signals and avoid elaborate reward engineering.