OpenAI Open source Robot simulation Python Library, parallel simulation processing speed increased by 400%

Source: Internet
Author: User

10000da.cn
vboyule.cn
jiaeidaypt.cn

In the past year of research, the OpenAI team has open source a high-performance Python library for robotic simulations developed using Mujocoengine. Lei Feng Network learned that the Python library is one of the core tools for OpenAI team to learn more about robotics, and now the team is releasing the mujoco-py (Mujoco bindings for Python 3) as a major version of Mujoco. Mujoco-py 1.50.1.0 brings many new features and significant performance gains. Lei Feng Network learned that the new features include the following points:

    • Efficient processing of parallel simulations

    • Automatic 3D rendering with GPU acceleration

    • Direct access to Mujoco functions and data structures

    • Supports all Mujoco 1.50 functions, such as improved contact solvers

Batch Simulation

Many methods of trajectory (trajectory) optimization and reinforcement learning, such as LQR,PI2 and Trpo, can benefit from running multiple simulations in parallel. Mujoco-py uses data parallelism through OpenMP and direct access to memory management through Cython and numpy, making batch simulations more efficient.

The initial use of the new version of the Mjsimpool interface is shown to be faster than the previous version of 400%, and is still approximately 180% of the previous version in an optimized and restricted usage pattern (getting the same level of parallel computing through Python's multi-processing toolkit). Much of the acceleration is due to the shortened access times of MUJOCO data structures.

You can learn about Mjsimpool in this case. https://github.com/openai/mujoco-py/blob/master/examples/simpool.py

High Performance Texture randomization

Domain randomization techniques are used in many of the OpenAI projects. The latest version of Mujoco-py supports automatic (headless) GPU rendering, which is 40 times times faster than CPU-based rendering and can produce hundreds of frames of synthetic image data per second. In the above (deceleration) animation, OpenAI uses a random technique to change the texture of a robot to help the robot identify its body (when moving it from the simulator to reality). See examples/disco_fetch.py for an example of random texture generation.

VR implementation with Mujoco-py

APIs exposed by Mujoco-py are sufficient to enable virtual reality to interact without any additional C + + code. OpenAI uses mujoco-py to migrate the C + + VR samples from Mujoco to Python. If you have HTC Vive VR settings, you can try this example (this support is considered experimental, but OpenAI already uses it internally).

API and Usage

The simplest way to start using mujoco-py is to use Mjsim class. It is a wrapper around the simulation model and data (wrapper), allowing you to easily simulate and render images from the camera sensor. The following is a simple example:

From mujoco_py import Load_model_from_path, Mjsim

Model = Load_model_from_path ("Xmls/tosser.xml")

SIM = Mjsim (model)

Sim.step ()

Print (Sim.data.qpos)

# = [ -1.074e-05 1.043e-04-3.923e-05 0.000e+00 0.000e+00]

For higher-order users, OpenAI provides a large number of low-level interfaces to direct access to MUJOCO C structures and intrinsic functions

OpenAI Open source Robot simulation Python Library, parallel simulation processing speed increased by 400%

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.