Basics
Task-IDs
Tasks are chosen by defining Task-IDs. The general structure of a Task-Id is <environment>.<task>.<dataset_type>.
For the Task-ID, you have to choose at least the environment name. Missing information will be filled with default setting
specific to the respective environment. Default settings can be seen in the generate() method of the
respective environment class. A list of all available Task-IDs in LocoMuJoCo is given below.
Alternatively, you can use the following code:
from loco_mujoco import LocoEnv
task_ids = LocoEnv.get_all_task_names()
Some environments have additional information in the Task-ID. For example, the HumanoidTorque4Ages and
HumanoidMuscle4Ages environments have different modes for different ages, where an index is added to the task
name to chose which of the 4 Humanoids to choose. The general structure there is
<environment>.<task>.<mode>.<dataset_type>. The smallest humanoid is indexed by 1 while the adult is indexed
by 4; e.g. "HumanoidMuscle4Ages.walk.1.real" or "HumanoidMuscle4Ages.run.4.real".
Given a Task-ID, it is very straightforward to create an environment. For example, for a MushrooRL environment:
from loco_mujoco import LocoEnv
# create an environment with a Muscle Humanoid running with motion capture data (real dataset type)
env = LocoEnv("HumanoidMuscle.run.real")
You can do the same for a Gymnasium environment:
import loco_mujoco # needed to register the environments
import gym
# create an environment with a Muscle Humanoid running with motion capture data (real dataset type)
env = gym.make("LocoMujoco", env_name="HumanoidMuscle.run.real")
Replay Datasets
If you would like to visualize the datasets, you can replay them using the following code:
import numpy as np
from loco_mujoco import LocoEnv
np.random.seed(0)
mdp = LocoEnv.make("HumanoidMuscle.run.real")
mdp.play_trajectory(n_steps_per_episode=500)
This method will read the joint positions in the dataset and set the joint positions of the humanoid accordingly at each time step. Alternatively, you can also replay the dataset from the velocities. To do so, the first state of a trajectory is sampled and all following states will be calculated from velocities using numerical integration. This method is useful to verify that the velocities in the dataset are consistent with the positions. Here is an example:
import numpy as np
from loco_mujoco import LocoEnv
np.random.seed(0)
mdp = LocoEnv.make("Talos.walk.perfect")
mdp.play_trajectory_from_velocity(n_episodes=30, n_steps_per_episode=500)
Both, the play_trajectory and play_trajectory_from_velocity methods are available
for the Gymnasium interface as well.
Note
Dynamics are disregard when replaying a dataset!
Overview of Environments, Tasks and Datasets
Here you can find an overview of all tasks. For each task, you can choose between different datasets. The real dataset contains real (noisy) motion capture datasets without actions. The perfect dataset contains ground truth states and actions form an expert policy. The preference dataset contains preferences of an ground truth expert with states and action (only available on an few tasks). The status of a dataset can be seen down below. ✅ means it is already available, and 🔶 means pending.
Note
The perfect and preference datasets are only available for the default settings of an environment. By default, arms are not included in the observation space. Hence, these datasets are only available for tasks without arms. In comparison, the real dataset also contains arm observations.
Image |
Task-IDs |
Status Datasets |
Description |
|---|---|---|---|
HumanoidMuscle.walk
HumanoidMuscle.run
HumanoidMuscle4Ages.walk.4
HumanoidMuscle.run
HumanoidMuscle4Ages.run.4
|
real: ✅
perfect: ✅
preference: 🔶
|
Task of an adult Muscle Humanoid Walking or Running Straight. |
|
HumanoidMuscle4Ages.walk.3
HumanoidMuscle4Ages.run.3
|
real: ✅
perfect: 🔶
preference: 🔶
|
Task of a (~12 year old) Muscle Humanoid Walking or Running Straight. |
|
HumanoidMuscle4Ages.walk.2
HumanoidMuscle4Ages.run.2
|
real: ✅
perfect: 🔶
preference: 🔶
|
Task of a (~5-6 year old) Muscle Humanoid Walking or Running Straight. |
|
HumanoidMuscle4Ages.walk.1
HumanoidMuscle4Ages.run.1
|
real: ✅
perfect: 🔶
preference: 🔶
|
Task of a (~2 year old) Muscle Humanoid Walking or Running Straight. |
|
HumanoidMuscle.walk
HumanoidMuscle.run
HumanoidMuscle4Ages.walk.4
HumanoidMuscle.run
HumanoidMuscle4Ages.run.4
|
real: ✅
perfect: ✅
preference: 🔶
|
Task of an adult Torque Humanoid Walking or Running Straight. |
|
HumanoidMuscle4Ages.walk.3
HumanoidMuscle4Ages.run.3
|
real: ✅
perfect: 🔶
preference: 🔶
|
Task of a (~12 year old) Torque Humanoid Walking or Running Straight. |
|
HumanoidMuscle4Ages.walk.2
HumanoidMuscle4Ages.run.2
|
real: ✅
perfect: 🔶
preference: 🔶
|
Task of a (~5-6 year old) Torque Humanoid Walking or Running Straight. |
|
HumanoidMuscle4Ages.walk.1
HumanoidMuscle4Ages.run.1
|
real: ✅
perfect: 🔶
preference: 🔶
|
Task of a (~2 year old) Torque Humanoid Walking or Running Straight. |
|
UnitreeH1.walk
|
real: ✅
perfect: ✅
preference: 🔶
|
UnitreeH1 Straight Walking Task. |
|
UnitreeH1.run
|
real: ✅
perfect: ✅
preference: 🔶
|
UnitreeH1 Straight Running Task. |
|
UnitreeH1.carry
|
real: ✅
perfect: 🔶
preference: 🔶
|
UnitreeH1 Straight Carry Task. |
|
Talos.walk
|
real: ✅
perfect: ✅
preference: 🔶
|
Talos Straight Walking Task. |
|
Talos.carry
|
real: ✅
perfect: 🔶
preference: 🔶
|
Talos Straight Carry Task. |
|
Atlas.walk
|
real: ✅
perfect: ✅
preference: 🔶
|
Atlas Straight Walking Task. |
|
Atlas.carry
|
real: ✅
perfect: 🔶
preference: 🔶
|
Atlas Straight Carry Task. |
|
UnitreeA1.simple
|
real: ✅
perfect: ✅
preference: 🔶
|
UnitreeA1 Straight Walking Task. |
|
UnitreeA1.hard
|
real: ✅
perfect: ✅
preference: 🔶
|
UnitreeA1 Walking in 8 Different Direction Task. |