This package contains reusable components for defining control tasks that are
related to locomotion. New users are encouraged to start by browsing the
examples/
subdirectory, which contains preconfigured RL environments
associated with various research papers. These examples can serve as starting
points or be customized to design new environments using the components
available from this library.
This library facilitates the creation of environments that require walkers to perform a task in an arena.
-
walkers refer to detached bodies that can move around in the environment.
-
arenas refer to the surroundings in which the walkers and possibly other objects exist.
-
tasks refer to the specification of observations and rewards that are passed from the "environment" to the "agent", along with runtime details such as initialization and termination logic.
See the documentation for dm_control
.
from dm_control import composer
from dm_control.locomotion.examples import basic_cmu_2019
import numpy as np
# Build an example environment.
env = basic_cmu_2019.cmu_humanoid_run_walls()
# Get the `action_spec` describing the control inputs.
action_spec = env.action_spec()
# Step through the environment for one episode with random actions.
time_step = env.reset()
while not time_step.last():
action = np.random.uniform(action_spec.minimum, action_spec.maximum,
size=action_spec.shape)
time_step = env.step(action)
print("reward = {}, discount = {}, observations = {}.".format(
time_step.reward, time_step.discount, time_step.observation))
dm_control.viewer
can also be used to visualize and interact with the
environment, e.g.:
from dm_control import viewer
viewer.launch(environment_loader=basic_cmu_2019.cmu_humanoid_run_walls)
This library contains environments that were adapted from several research papers. Relevant references include: