Skip to content
Snippets Groups Projects
Commit c5f60322 authored by Jonas Schneider's avatar Jonas Schneider
Browse files

Import 1.50.x series code

parent 6d561816
No related branches found
Tags v0.11.1
No related merge requests found
Showing with 547 additions and 146 deletions
version: 1.0.{build}
environment:
global:
# SDK v7.0 MSVC Express 2008's SetEnv.cmd script will fail if the
# /E:ON and /V:ON options are not enabled in the batch script intepreter
# See: http://stackoverflow.com/a/13751649/163740
CMD_IN_ENV: "cmd /E:ON /V:ON /C .\\continuous-integration\\appveyor\\run_with_env.cmd"
platform:
- x64
install:
- mkdir %userprofile%\.mujoco
- curl %MUJOCO_FOR_WINDOWS% -o %userprofile%\.mujoco\mjpro.tar.gz
- curl https://github.com/glfw/glfw/releases/download/3.2.1/glfw-3.2.1.bin.WIN64.zip -o %userprofile%\glfw.zip
- cd %userprofile%\.mujoco\
- tar -zxvf mjpro.tar.gz
- echo "%PYTHON_VERSION% C:\Miniconda35-x64 %userprofile%"
- set PATH=C:\Miniconda35-x64;C:\Miniconda35-x64\Scripts;%PATH%
- conda config --set always_yes yes --set changeps1 no
- conda update -q conda
- conda info -a
- conda create -q -n test-environment python=3.5 numpy scipy
- activate test-environment
- SET PATH=%userprofile%\.mujoco\mjpro150\bin;%PATH%;
- SET RENDERING_OFF=1
- cd C:\projects\pymj
- pip install -r requirements.txt
- pip install -r requirements.dev.txt
build: off
test_script:
- pytest -s --verbose --durations=10 --instafail
generated_cymj*
_pyxbld*
dist
cache
.idea/*
*~
.*~
*#*#
*.o
*.dat
*.prof
*.lprof
*.local
.realsync
.DS_Store
**/*.egg-info
.cache
*.ckpt
*.log
.ipynb_checkpoints
venv/
.vimrc
*.settings
*.svn
.project
.pydevproject
tags
*sublime-project
*sublime-workspace
# Intermediate outputs
__pycache__
**/__pycache__
*.pb.*
*.pyc
*.swp
*.swo
# generated data
*.rdb
*.db
*.avi
# mujoco outputs
MUJOCO_LOG.TXT
model.txt
.window_data
.idea/*.xml
outputfile
tmp*
cymj.c
**/.git
.gitignore 100644 → 100755
generated_cymj*
_pyxbld*
dist
cache
.idea/*
*~
.*~
*#*#
*.o
*.dat
*.prof
*.lprof
*.local
.realsync
.DS_Store
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg
# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
**/*.egg-info
.cache
nosetests.xml
coverage.xml
*,cover
.hypothesis/
# Translations
*.mo
*.pot
# Django stuff:
*.ckpt
*.log
# Sphinx documentation
docs/_build/
# PyBuilder
target/
gcc-dylibs
MANIFEST
/tmp
.ipynb_checkpoints
venv/
.vimrc
*.settings
*.svn
.project
.pydevproject
tags
*sublime-project
*sublime-workspace
# Intermediate outputs
__pycache__
**/__pycache__
*.pb.*
*.pyc
*.swp
*.swo
# generated data
*.rdb
*.db
*.avi
# mujoco outputs
MUJOCO_LOG.TXT
model.txt
.window_data
.idea/*.xml
outputfile
tmp*
cymj.c
**/.git
3.5.2/envs/pymj
dist: trusty
sudo: required
cache:
apt: true
language: python
addons:
apt:
packages:
- python-dev
python:
- "2.7"
- "3.5"
install: pip install tox-travis
script: tox
language: generic
dist: trusty
before_install:
- Xvfb :12 -screen 0 800x600x24 +extension RANDR &
- mkdir -p ~/.mujoco
- curl https://openai-public.s3-us-west-2.amazonaws.com/mujoco/$MUJOCO_KEY_BUNDLE.tar.gz | tar xz -C ~/.mujoco
env:
- DISPLAY=:12
- curl $MUJOCO_FOR_LINUX | tar -xz ./mjkey.txt
- docker build -t image-under-test .
notifications:
slack:
secure: h/Mxm8K+avH/2W0818zCHmLloRPMFN4NJL01+VShvAkH80/acfjeq/+mMdWXXPL/oOB6kSHDk+GDhwR6+s03ZcPMn5INTFvFYqUc6UWmT+NXtOPxGTN0xda6MdYUkWQUKaMyjFrweZQOMOASFBIzPOq4XeVbM5aB8s4EJhnfAcYZhp/idwKbToVihN4KZgxlvZIFc8iEp1o9uSl5qrsaeYYYXRkb6mauacAwOo4/Chu+cOnoLUOnvhBFE3rV3doDNrbnoalO8XiExtgx5CIAYWrlMni7r2Q+LlzgwdyTH19ZtybPxJTZIIWSBQ2UtcoYdIEDcc36GcUwz1VUGg32mLJJnY2xw80CWR4ixFPpLwwP5Y99WTn8v094B4nmFTWOwNWXp3EkqtTN9XcJoRBqXB5ArucIPqrx57dOCljSKx22gL6WaF2p3stSAxIGFektGyGnisaELrFZG1C63aHoUPicj3gUlijmAoUmYaDRf6P1wnpXqBpKDAWWhAMSatvx1ekmEJgR7OQklQnnfjx9kENDUygNUWS4IQwN2qYieuzHFL3of7/30mTM43+Vt/vWN8GI7j01BXu6FNGGloHxjH1pt3bLP/+uj5BJsT2HWF+Z8XR4VE6cyVuKsQAFgCXwOkoDHALbcwsspONDIt/9ixkesgh1oFt4CzU3UuU5wYs=
on_success: change
script:
- docker run --rm image-under-test
FROM ubuntu:14.04
# We need the CUDA base dockerfile to enable GPU rendering
# on hosts with GPUs.
FROM nvidia/cuda:8.0-devel-ubuntu16.04
RUN apt-get update && apt-get install -y \
python2.7 \
python2.7-dev \
python-pip \
unzip \
xorg-dev \
RUN apt-get update -q \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y \
curl \
git \
libgl1-mesa-dev \
xvfb \
libxinerama1 \
libxcursor1 \
libglu1-mesa \
cmake \
gfortran \
libblas-dev \
libatlas-dev \
liblapack-dev \
libjpeg62 \
libjpeg62-dev \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
COPY requirements.txt /mujoco-py/requirements.txt
RUN pip install -r /mujoco-py/requirements.txt
COPY . /mujoco-py
ENV PYTHONPATH=/mujoco-py
WORKDIR /mujoco-py
ENTRYPOINT ["bin/docker-entrypoint.sh"]
CMD ["nosetests", "tests/"]
libgl1-mesa-glx \
libosmesa6-dev \
python3-pip \
python3-numpy \
python3-scipy \
unzip \
vim \
wget \
xpra \
xserver-xorg-dev \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
RUN curl -o /usr/local/bin/patchelf https://s3-us-west-2.amazonaws.com/openai-sci-artifacts/manual-builds/patchelf_0.9_amd64.elf \
&& chmod +x /usr/local/bin/patchelf
ENV LANG C.UTF-8
RUN mkdir -p /root/.mujoco \
&& wget https://www.roboti.us/download/mjpro150_linux.zip -O mujoco.zip \
&& unzip mujoco.zip -d /root/.mujoco \
&& rm mujoco.zip
COPY ./mjkey.txt /root/.mujoco/
ENV LD_LIBRARY_PATH /root/.mujoco/mjpro150/bin:$LD_LIBRARY_PATH
COPY vendor/Xdummy /usr/local/bin/Xdummy
RUN chmod +x /usr/local/bin/Xdummy
# Workaround for https://bugs.launchpad.net/ubuntu/+source/nvidia-graphics-drivers-375/+bug/1674677
COPY ./vendor/10_nvidia.json /usr/share/glvnd/egl_vendor.d/10_nvidia.json
WORKDIR /mujoco_py
# Copy over just requirements.txt at first. That way, the Docker cache doesn't
# expire until we actually change the requirements.
COPY ./requirements.txt /mujoco_py/
COPY ./requirements.dev.txt /mujoco_py/
RUN pip3 install -r requirements.txt
RUN pip3 install -r requirements.dev.txt
# Delay moving in the entire code until the very end.
ENTRYPOINT ["/mujoco_py/vendor/Xdummy-entrypoint"]
CMD ["pytest"]
COPY . /mujoco_py
RUN python3 setup.py install
# mujoco-py
The MIT License
Copyright (c) 2016 OpenAI (http://openai.com)
Copyright (c) 2017 OpenAI (http://openai.com)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
......@@ -19,3 +21,16 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
# Mujoco models
This work is derived from [MuJuCo models](http://www.mujoco.org/forum/index.php?resources/) used under the following license:
```
This file is part of MuJoCo.
Copyright 2009-2015 Roboti LLC.
Mujoco :: Advanced physics simulation engine
Source : www.roboti.us
Version : 1.31
Released : 23Apr16
Author :: Vikash Kumar
Contacts : kumar@roboti.us
```
include requirements.txt
include requirements.dev.txt
recursive-include mujoco_py *.h *.py *.pyx *.pxd *.pxi *.xml *.c *.so
include mujoco_py/gl/*.c
include setup.py
.PHONY: all clean build test mount_shell shell upload check-env
MUJOCO_LICENSE_PATH ?= ~/.mujoco/mjkey.txt
all: test
clean:
rm -rf mujoco_py.egg-info
rm -rf */__pycache__
rm -rf */*/__pycache__
rm -rf mujoco_py/generated/_pyxbld*
rm -rf mujoco_py/generated_cymj*
rm -rf mujoco_py/cythonlock_*.pyc
rm -rf dist
rm -rf build
build: check-license
cp $(MUJOCO_LICENSE_PATH) mjkey.txt
docker build -t mujoco_py . || rm mjkey.txt && rm mjkey.txt
test: build
# run it interactive mode so we can abort with CTRL+C
docker run --rm -i mujoco_py pytest
mount_shell:
docker run --rm -it -v `pwd`:/dev mujoco_py /bin/bash -c "pip uninstall -y mujoco_py; rm -rf /mujoco_py; (cd /dev; /bin/bash)"
shell:
docker run --rm -it mujoco_py /bin/bash
upload:
rm -rf dist
python setup.py sdist
twine upload dist/*
test:
nose2
check-license:
ifeq ("","$(wildcard $(MUJOCO_LICENSE_PATH))")
$(error "License key not found at location $(MUJOCO_LICENSE_PATH). Use MUJOCO_LICENSE_PATH to specify its path")
endif
# MuJoCo Python Bindings
# mujoco-py [![Documentation](https://img.shields.io/badge/docs-latest-brightgreen.svg?style=flat)](https://openai.github.io/pymj/build/html/index.html) [![Build Status](https://travis-ci.com/openai/pymj.svg?token=aA2GupFxnzsRTN56psRJ&branch=master)](https://travis-ci.com/openai/pymj) [![Build status](https://ci.appveyor.com/api/projects/status/dsg86qpalv9bi568?svg=true)](https://ci.appveyor.com/project/wojzaremba/pymj)
[![Build Status](https://travis-ci.org/openai/mujoco-py.svg?branch=master)](https://travis-ci.org/openai/mujoco-py)
[MuJoCo](http://mujoco.org/) is a physics engine for detailed, efficient rigid body simulations with contacts. `mujoco-py` allows using MuJoCo from Python.
MuJoCo is a physics engine which can do very detailed efficient
simulations with contacts. This library lets you use MuJoCo from
Python.
## Synopsis
Note that MuJoCo tends to change significantly between versions, so
this library is likely to stay pinned to 1.31 for the near future.
### Install MuJoCo
# Installing this library
You can install this library using:
1. Obtain a 30-day free trial on the [MuJoCo website](https://www.roboti.us/license.html)
or free license if you are a student.
The license key will arrive in an email with your username and password.
2. Download the MuJoCo version 1.50 binaries for
[Linux](https://www.roboti.us/active/mjpro150_linux.zip),
[OSX](https://www.roboti.us/active/mjpro150_osx.zip), or
[Windows](https://www.roboti.us/active/mjpro150_windows.zip).
3. Unzip the downloaded `mjpro150` directory into `~/.mujoco/mjpro150`,
and place your license key (the `mjkey.txt` file from your email)
at `~/.mujoco/mjkey.txt`.
### Install and use `mujoco-py`
To include `mujoco-py` in another package, add it to your requirements like so:
```
mujoco-py<1.50.2,>=1.50.1
```
pip install mujoco-py
To play with it interactively, follow these steps:
```
$ pip install -U 'mujoco-py<1.50.2,>=1.50.1'
$ python
import mujoco_py
from os.path import dirname
model = mujoco_py.load_model_from_path(dirname(dirname(mujoco_py.__file__)) +"/xmls/claw.xml")
sim = mujoco_py.MjSim(model)
MuJoCo isn't open-source, so you'll also need to set download the
MuJoCo binaries and obtain license key.
print(sim.data.qpos)
# [ 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.]
## Obtaining the binaries and license key
sim.step()
print(sim.data.qpos)
# [ 2.09217903e-06 -1.82329050e-12 -1.16711384e-07 -4.69613872e-11
# -1.43931860e-05 4.73350204e-10 -3.23749942e-05 -1.19854057e-13
# -2.39251380e-08 -4.46750545e-07 1.78771599e-09 -1.04232280e-08]
```
1. Obtain a 30-day free trial on the MuJoCo website:
https://www.roboti.us/license.html. The license key will arrive in
an email with your username and password.
2. Download the MuJoCo version 1.31 binaries for
[Linux](https://www.roboti.us/active/mjpro131_linux.zip),
[OSX](https://www.roboti.us/active/mjpro131_osx.zip), or
[Windows](https://www.roboti.us/active/mjpro131_windows.zip).
3. Download your license key (the `mjkey.txt` file from your email)
and unzip the downloaded mjpro bundle.
4. Place these in `~/.mujoco/mjkey.txt` and `~/.mujoco/mjpro131`. You
can alternatively set the following environment variables:
See the [full documentation](https://openai.github.io/pymj/build/html/index.html) for advanced usage.
```
export MUJOCO_PY_MJKEY_PATH=/path/to/mjkey.txt
export MUJOCO_PY_MJPRO_PATH=/path/to/mjpro131
```
## Usage Examples
## Testing
A number of examples demonstrating some advanced features of `mujoco-py` can be found in [`examples/`](/./examples/). These include:
- [`body_interaction.py`](./examples/body_interaction.py): shows interactions between colliding bodies
- [`disco_fetch.py`](./examples/disco_fetch.py): shows how `TextureModder` can be used to randomize object textures
- [`internal_functions.py`](./examples/internal_functions.py): shows how to call raw mujoco functions like `mjv_room2model`
- [`markers_demo.py`](./examples/markers_demo.py): shows how to add visualization-only geoms to the viewer
- [`serialize_model.py`](./examples/serialize_model.py): shows how to save and restore a model
- [`setting_state.py`](./examples/setting_state.py): shows how to reset the simulation to a given state
- [`simpool.py`](./examples/simpool.py): shows how `MjSimPool` can be used to run a number of simulations in parallel
- [`tosser.py`](./examples/tosser.py): shows a simple actuated object sorting robot application
Run:
See the [full documentation](https://openai.github.io/pymj/build/html/index.html) for advanced usage.
## Development
To run the provided unit and integrations tests:
```
make test
```
## Credits
`mujoco-py` is maintained by the OpenAI Robotics team. Contributors include:
- Alex Ray
- Bob McGrew
- Jonas Schneider
- Jonathan Ho
- Peter Welinder
- Wojciech Zaremba
File moved
SPHINXOPTS =
SPHINXBUILD = python -msphinx
SPHINXPROJ = mujoco-py
SOURCEDIR = .
BUILDDIR = build
.PHONY: all clean
all:
@$(SPHINXBUILD) -M html "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
clean:
@$(SPHINXBUILD) -M clean "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
File added
File added
File added
File added
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 796e1527cf38c16076806cf6da80d531
tags: 645f666f9bcd5a90fca523b33c5a78b7
<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Overview: module code &mdash; mujoco-py 1.50.0.14 documentation</title>
<link rel="stylesheet" href="../_static/css/theme.css" type="text/css" />
<link rel="index" title="Index"
href="../genindex.html"/>
<link rel="search" title="Search" href="../search.html"/>
<link rel="top" title="mujoco-py 1.50.0.14 documentation" href="../index.html"/>
<script src="../_static/js/modernizr.min.js"></script>
</head>
<body class="wy-body-for-nav" role="document">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search">
<a href="../index.html" class="icon icon-home"> mujoco-py
</a>
<div class="version">
1.50.0.14
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
<input type="text" name="q" placeholder="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<ul>
<li class="toctree-l1"><a class="reference internal" href="../reference.html">API reference</a></li>
<li class="toctree-l1"><a class="reference internal" href="../internals.html">Internals</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../index.html">mujoco-py</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="../index.html">Docs</a> &raquo;</li>
<li>Overview: module code</li>
<li class="wy-breadcrumbs-aside">
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<h1>All modules for which code is available</h1>
<ul><li><a href="mujoco_py/builder.html">mujoco_py.builder</a></li>
<li><a href="mujoco_py/cymj.html">mujoco_py.cymj</a></li>
<li><a href="mujoco_py/mjviewer.html">mujoco_py.mjviewer</a></li>
</ul>
</div>
<div class="articleComments">
</div>
</div>
<footer>
<hr/>
<div role="contentinfo">
<p>
&copy; Copyright 2017, OpenAI.
</p>
</div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'../',
VERSION:'1.50.0.14',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true,
SOURCELINK_SUFFIX: '.txt'
};
</script>
<script type="text/javascript" src="../_static/jquery.js"></script>
<script type="text/javascript" src="../_static/underscore.js"></script>
<script type="text/javascript" src="../_static/doctools.js"></script>
<script type="text/javascript" src="../_static/js/theme.js"></script>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.StickyNav.enable();
});
</script>
</body>
</html>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment