OpenAI Gym environments for simulating the nematode C. elegans
- python==3.8
Swimmer-v3
requiresmujoco-py
dependencies;Swimmer-v4
requiresmujoco
dependencies- install
worm-assets
and its dependencies
- visit http://roboti.us/ and download MuJoCo 2.0
mujoco200_linux.zip
, unzip it and getmujoco200_linux/
, rename it tomujoco200/
and put it in~/.mujoco
folder - download activation key
mjkey.txt
and put it in~/.mujoco
folder - add environment variables in
~/.bashrc
file, and runsource ~/.bashrc
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/ubuntu/.mujoco/mujoco200/bin export MUJOCO_PY_MUJOCO_PATH=/home/ubuntu/.mujoco/mujoco200
- install mujoco-py:
pip install mujoco-py==2.0.2.13
- install gym:
pip install gym==0.22.0
Many errors may spring up while installing mujoco-py
dependencies.
- run
sudo apt update
andsudo apt-get update
first, and try the following sudo apt install gcc
sudo apt install libosmesa6-dev libgl1-mesa-glx libglfw3
sudo apt install libgl1-mesa-glx --reinstall
sudo apt install libgl1-mesa-dev
sudo apt-get install libc-dev
conda install patchelf
orsudo apt-get install patchelf
- install mujoco:
pip install mujoco
- install gym:
pip install gym
- install imageio:
pip install imageio
- install moviepy:
pip install moviepy
- make sure that
mujoco-py
is NOT installed
- install the project in editable mode from local project path
pip install -e .
Add the following lines in the script, it'll output info messages.
import gym
gym.logger.set_level(gym.logger.DEBUG)
Capsule_v0
: Capsule-v0 models skating effect with anisotropic frictionellipsoid2d_v0
: Ellipsoid2D-v0 with only z-axis rotation dofellipsoid_v0
: Ellipsoid-v0 with specificn_bodies
,joint_range
and meshesellipsoid_v1
: Ellipsoid-v1 with specificn_bodies
,joint_range
, meshes and y-axis rotational degree of freedomhead
: head setup enabling free rotation at head and neckjoint
: remove joints and its corresponding actuatorsmuscle_ellipsoid2d_v0
: ellipsoid swimmer with tendon muscles and only z-axis rotation dofmuscle_ellipsoid_v0
: ellipsoid swimmer with tendon musclesmuscle_swimmer_v0
: muscle swimmer with specificn_bodies
,joint_range
,body_len
andmuscle_len
muscle_worm_v0
: muscle swimmer with specificjoint_range
,body_len
,muscle_len
andarrangement
position_actuator
: position actuatorssphere_v0
: Sphere-v0 with specificn_bodies
,joint_range
and meshessphere_v1
: Sphere-v1 with specificn_bodies
,joint_range
, meshes and y-axis rotational degree of freedomswimmer_v3
: Swimmer-v3 modified to allow loading model from xml_strswimmer_v3_v1
: Swimmer-v3 with specificn_bodies
,joint_range
andbody_len
swimmer_v4
: Swimmer-v4 modified to allow loading model from xml_strtrapped
: trap specific bodies
agar
: agar environment containing composite object as agar based NGMcamera
: camera setupcompositional_env
: child models can be attached to parent models in order to create compositional sceneschemotaxis
: chemotaxis environment containing a cylinder as chemical sourceforage
: forage environment containing cylinders as chemical sources and box geoms as perimeterframe_sensor
: frame sensors for framepos and framequatfriction
: friction environment containing box geoms as sections of floor with different friction settinggravity
: gravity setupmaze
: maze environment containing box geoms as perimeter and wallspool
: pool environment for simulating swimming behavior in 3D spaceposition
: position sensors of 3D center of mass and positionsensor
: actuator sensorstendon
: tendon sensors of tendon length and velocityterrain
: terrain environmenttouch
: touch sensors at the head and tailtracking
: tracking environment containing a controllable sphere as chemical source
distribution_observation
: wrapper for environmental substance distributionmuscle_action
: wrapper for decoding locomotion outputs of body wall muscles into control signalsrecorder
: wrapper for selecting camerasensor_observation
: wrapper for sensor dataskip_frame
: wrapper for skipping frames
circle
: circular action for arena and no action for robotrandom
: random actionzero
: no action
- skin format: https://mujoco.readthedocs.io/en/latest/XMLreference.html#skin
- install early version of dm-control that supports MuJoCo 2.0
pip install dm-control==0.0.364896371
- parse and serialize MuJoCo skin files with dm_control.mjcf.skin
- Gym: https://github.com/openai/gym
- how to create new environments for Gym: https://github.com/openai/gym/blob/master/docs/creating_environments.md
- third party environments: https://github.com/openai/gym/blob/master/docs/third_party_environments.md