Skip to content
Closed
Changes from 1 commit
Commits
Show all changes
112 commits
Select commit Hold shift + click to select a range
32dc22d
(temp) make mamujoco requirement mandatory
Kallinteris-Andreas Jan 9, 2023
061aa3e
Merge branch 'Farama-Foundation:main' into main
Kallinteris-Andreas Jan 9, 2023
14e492f
Merge branch 'Farama-Foundation:main' into main
Kallinteris-Andreas Jan 10, 2023
510f1c4
MaMuJoCo Doc update
Kallinteris-Andreas Jan 10, 2023
1a845a0
add ant2x4 image
Kallinteris-Andreas Jan 10, 2023
7fe9362
`MaMuJoCo` DOC Update (adding action space PICs)
Kallinteris-Andreas Jan 11, 2023
e6e49f1
more pics
Kallinteris-Andreas Jan 11, 2023
2c10773
typo fix
Kallinteris-Andreas Jan 11, 2023
53736ba
typo fixes
Kallinteris-Andreas Jan 11, 2023
59772fb
fix `shinx` warning
Kallinteris-Andreas Jan 11, 2023
10704ba
Merge branch 'main' into main
Kallinteris-Andreas Jan 11, 2023
1bd9ab4
Merge branch 'Farama-Foundation:main' into main
Kallinteris-Andreas Jan 12, 2023
22e1110
`MaMuJoCo` DOC update
Kallinteris-Andreas Jan 12, 2023
e0d7e06
minor formating changes
Kallinteris-Andreas Jan 12, 2023
a631fbe
add `kwargs`
Kallinteris-Andreas Jan 12, 2023
9fd69db
Merge branch 'Farama-Foundation:main' into main
Kallinteris-Andreas Jan 12, 2023
528d00f
Merge branch 'Farama-Foundation:main' into main
Kallinteris-Andreas Jan 24, 2023
22d54bc
add `mujuco-v5` (init)
Kallinteris-Andreas Jan 24, 2023
81d98e2
`pre-commit`
Kallinteris-Andreas Jan 24, 2023
b65c031
Merge branch 'Farama-Foundation:main' into main
Kallinteris-Andreas Mar 18, 2023
fe9a547
Merge branch 'Farama-Foundation:main' into main
Kallinteris-Andreas Apr 7, 2023
e9a1643
add hopper_v5
Kallinteris-Andreas May 10, 2023
ba585c8
add walker2d
Kallinteris-Andreas May 10, 2023
1b4a0a3
add Half Cheetah
Kallinteris-Andreas May 10, 2023
479c3e1
typo fix
Kallinteris-Andreas May 10, 2023
bc2de82
add pusher
Kallinteris-Andreas May 10, 2023
2ec47a5
add swimmer
Kallinteris-Andreas May 10, 2023
a3e8906
pre-commit
Kallinteris-Andreas May 11, 2023
a3454bf
typo fix
Kallinteris-Andreas May 11, 2023
ef626cf
`xml_file` arg fixes
Kallinteris-Andreas May 11, 2023
3de59d9
added `InvertedPendulum-v5`
Kallinteris-Andreas May 13, 2023
a945196
cleanup
Kallinteris-Andreas May 13, 2023
a1b5899
rename
Kallinteris-Andreas May 13, 2023
e3c8939
fix camera on new models
Kallinteris-Andreas May 13, 2023
b0f5edf
add inv_double_pend
Kallinteris-Andreas May 14, 2023
2567cd4
fix `humanoid` `info`
Kallinteris-Andreas May 14, 2023
7debcd5
`humanoid` add include obs arguments
Kallinteris-Andreas May 14, 2023
29ce9a8
update reacher DOC
Kallinteris-Andreas May 14, 2023
8978413
update obs shape (humanoid)
Kallinteris-Andreas May 14, 2023
a857d9c
`Ant` cleanup and fix `info`
Kallinteris-Andreas May 14, 2023
8ac23b0
update `Ant` doc
Kallinteris-Andreas May 14, 2023
567d0fe
re-add to humanoid `contact_cost`
Kallinteris-Andreas May 15, 2023
cb1c32d
fix obs shape
Kallinteris-Andreas May 15, 2023
081236b
inv_double_pend update doc
Kallinteris-Andreas May 15, 2023
22a35ce
Ant doc update
Kallinteris-Andreas May 17, 2023
361cb0f
reacher add changelogg
Kallinteris-Andreas May 17, 2023
ac7a0a2
`xml_file` doc fix for hopper and walker
Kallinteris-Andreas May 17, 2023
0bb5798
update humanoid doc
Kallinteris-Andreas May 17, 2023
eade7e2
Ant obs doc fix
Kallinteris-Andreas May 17, 2023
ed32b61
add `__credits__`
Kallinteris-Andreas May 17, 2023
177e321
`pre-commit`
Kallinteris-Andreas May 17, 2023
c57b0dc
doc update
Kallinteris-Andreas May 17, 2023
4044812
doc args cleanup
Kallinteris-Andreas May 18, 2023
5ccaca8
fix pusher changelogs
Kallinteris-Andreas May 18, 2023
18bada3
`reacher` & `pusher` add xml_file argument
Kallinteris-Andreas May 18, 2023
711a9ca
fix typos in `humanoid`
Kallinteris-Andreas May 18, 2023
6e99ff3
rename obs args
Kallinteris-Andreas May 19, 2023
caa8fe9
ant add `include_cfrc_ext_in_observation`
Kallinteris-Andreas May 19, 2023
e9d8ba6
register new envs
Kallinteris-Andreas May 19, 2023
eb838b5
fix register
Kallinteris-Andreas May 19, 2023
571d057
typo fix
Kallinteris-Andreas May 19, 2023
8ef1c90
fix humanoid pickle
Kallinteris-Andreas May 19, 2023
670e485
fix humanoid pickle (for real this time)
Kallinteris-Andreas May 19, 2023
f02f7b4
add `reset_noise_scale` to double_pend
Kallinteris-Andreas May 24, 2023
8f75f24
add new inv_double_pend args
Kallinteris-Andreas May 24, 2023
a050636
inv_double_pend re_order ez pickle init to the start
Kallinteris-Andreas May 24, 2023
4d5b052
add humanoidstandup
Kallinteris-Andreas May 24, 2023
25dfb87
Merge branch 'Farama-Foundation:main' into main
Kallinteris-Andreas May 24, 2023
867cfc9
update humanoid standup `info`
Kallinteris-Andreas May 25, 2023
b6e1996
`pre-commit`
Kallinteris-Andreas May 25, 2023
b89e50a
cleanup
Kallinteris-Andreas May 26, 2023
ce82a8e
hopper add `info` "z_distance_from_origin"
Kallinteris-Andreas May 26, 2023
b879488
fix
Kallinteris-Andreas May 26, 2023
ff585f7
add `frame_skip` argument
Kallinteris-Andreas May 26, 2023
9bdc5df
add tendon `info`
Kallinteris-Andreas May 26, 2023
d4271aa
fix exclude refactor
Kallinteris-Andreas May 26, 2023
42f5439
update doc
Kallinteris-Andreas May 26, 2023
15259d5
update obs creation
Kallinteris-Andreas May 26, 2023
fb96314
typo fix
Kallinteris-Andreas May 26, 2023
b8aaf6d
cleanup
Kallinteris-Andreas May 26, 2023
e2ce260
fixed humanoid arguments docs
Kallinteris-Andreas May 26, 2023
2674f97
add dynamic obs_size calculation
Kallinteris-Andreas May 26, 2023
5a025b6
add `metadata["observation_structure"]`
Kallinteris-Andreas May 27, 2023
191e7ab
cartpole add args
Kallinteris-Andreas May 27, 2023
344550a
typo fix
Kallinteris-Andreas May 27, 2023
a265c47
added `reacher`&`pusher` reward weights
Kallinteris-Andreas May 27, 2023
802e22d
cleanup
Kallinteris-Andreas May 27, 2023
f60b453
cleanup
Kallinteris-Andreas May 29, 2023
e8b045f
cleanup
Kallinteris-Andreas May 29, 2023
a7c883d
`pre-commit`
Kallinteris-Andreas May 29, 2023
9c3c9e0
add `default_camera_config` argunment
Kallinteris-Andreas May 29, 2023
938b4e9
fix `ant/humanoid` `info["x/y_position"]`
Kallinteris-Andreas Jun 1, 2023
8800d5f
`ant` add `forward_reward_weight`
Kallinteris-Andreas Jun 1, 2023
3c56866
ant doc
Kallinteris-Andreas Jun 1, 2023
f67639e
`ant` cleaned up xy pos aquasition
Kallinteris-Andreas Jun 1, 2023
ebc96c0
added `main_body`
Kallinteris-Andreas Jun 1, 2023
5263fe6
fix `healthy_reward`
Kallinteris-Andreas Jun 2, 2023
89efd65
pre-commit
Kallinteris-Andreas Jun 2, 2023
ca360f9
fix ant velocity
Kallinteris-Andreas Jun 2, 2023
3e6fc80
dict
Kallinteris-Andreas Jun 2, 2023
8921dcd
update renderer
Kallinteris-Andreas Jun 3, 2023
360b6dc
add `walker2d` `info[z_distance_from_origon]`
Kallinteris-Andreas Jun 5, 2023
f96d888
add `reset_info`
Kallinteris-Andreas Jun 5, 2023
9f910fb
refactored observation structures to a member variable
Kallinteris-Andreas Jun 5, 2023
85e9eda
cleanup observation_structure
Kallinteris-Andreas Jun 5, 2023
aa1b9e2
Final? documention update
Kallinteris-Andreas Jun 10, 2023
577f21a
cleanup
Kallinteris-Andreas Jun 16, 2023
c406418
fix distance_from_origin info
Kallinteris-Andreas Jun 16, 2023
faea55c
pre-commit
Kallinteris-Andreas Jun 16, 2023
7875975
Merge branch 'Farama-Foundation:main' into main
Kallinteris-Andreas Jun 23, 2023
358f55d
Update maze_v4.py
Kallinteris-Andreas Jun 23, 2023
f94a2c3
cleanup
Kallinteris-Andreas Jun 27, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
update humanoid doc
  • Loading branch information
Kallinteris-Andreas committed May 17, 2023
commit 0bb5798f87e6ac3d83f59266d4d5679ff24fd0b2
84 changes: 68 additions & 16 deletions gymnasium_robotics/envs/mujoco/humanoid_v5.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class HumanoidEnv(MujocoEnv, utils.EzPickle):
This environment is based on the environment introduced by Tassa, Erez and Todorov
in ["Synthesis and stabilization of complex behaviors through online trajectory optimization"](https://ieeexplore.ieee.org/document/6386025).
The 3D bipedal robot is designed to simulate a human. It has a torso (abdomen) with a pair of
legs and arms. The legs each consist of two links, and so the arms (representing the knees and
legs and arms. The legs each consist of three body parts, and the arms 2 body parts (representing the knees and
elbows respectively). The goal of the environment is to walk forward as fast as possible without falling over.

## Action Space
Expand All @@ -42,28 +42,27 @@ class HumanoidEnv(MujocoEnv, utils.EzPickle):
| 7 | Torque applied on the rotor between torso/abdomen and the left hip (x-coordinate) | -0.4 | 0.4 | left_hip_x (left_thigh) | hinge | torque (N m) |
| 8 | Torque applied on the rotor between torso/abdomen and the left hip (z-coordinate) | -0.4 | 0.4 | left_hip_z (left_thigh) | hinge | torque (N m) |
| 9 | Torque applied on the rotor between torso/abdomen and the left hip (y-coordinate) | -0.4 | 0.4 | left_hip_y (left_thigh) | hinge | torque (N m) |
| 10 | Torque applied on the rotor between the left hip/thigh and the left shin | -0.4 | 0.4 | left_knee | hinge | torque (N m) |
| 11 | Torque applied on the rotor between the torso and right upper arm (coordinate -1) | -0.4 | 0.4 | right_shoulder1 | hinge | torque (N m) |
| 12 | Torque applied on the rotor between the torso and right upper arm (coordinate -2) | -0.4 | 0.4 | right_shoulder2 | hinge | torque (N m) |
| 13 | Torque applied on the rotor between the right upper arm and right lower arm | -0.4 | 0.4 | right_elbow | hinge | torque (N m) |
| 14 | Torque applied on the rotor between the torso and left upper arm (coordinate -1) | -0.4 | 0.4 | left_shoulder1 | hinge | torque (N m) |
| 15 | Torque applied on the rotor between the torso and left upper arm (coordinate -2) | -0.4 | 0.4 | left_shoulder2 | hinge | torque (N m) |
| 16 | Torque applied on the rotor between the left upper arm and left lower arm | -0.4 | 0.4 | left_elbow | hinge | torque (N m) |
| 10 | Torque applied on the rotor between the left hip/thigh and the left shin | -0.4 | 0.4 | left_knee | hinge | torque (N m) |
| 11 | Torque applied on the rotor between the torso and right upper arm (coordinate -1) | -0.4 | 0.4 | right_shoulder1 | hinge | torque (N m) |
| 12 | Torque applied on the rotor between the torso and right upper arm (coordinate -2) | -0.4 | 0.4 | right_shoulder2 | hinge | torque (N m) |
| 13 | Torque applied on the rotor between the right upper arm and right lower arm | -0.4 | 0.4 | right_elbow | hinge | torque (N m) |
| 14 | Torque applied on the rotor between the torso and left upper arm (coordinate -1) | -0.4 | 0.4 | left_shoulder1 | hinge | torque (N m) |
| 15 | Torque applied on the rotor between the torso and left upper arm (coordinate -2) | -0.4 | 0.4 | left_shoulder2 | hinge | torque (N m) |
| 16 | Torque applied on the rotor between the left upper arm and left lower arm | -0.4 | 0.4 | left_elbow | hinge | torque (N m) |

## Observation Space

Observations consist of positional values of different body parts of the Humanoid,
followed by the velocities of those individual parts (their derivatives) with all the
positions ordered before all the velocities.
followed by the velocities of those individual parts (their derivatives) with all the
positions ordered before all the velocities.

By default, observations do not include the x- and y-coordinates of the torso. These may
be included by passing `exclude_current_positions_from_observation=False` during construction.
In that case, the observation space will have 378 dimensions where the first two dimensions
In that case, the observation space will be a `Box(-Inf, Inf, (378,), float64)` where the first two observations
represent the x- and y-coordinates of the torso.
Regardless of whether `exclude_current_positions_from_observation` was set to true or false, the x- and y-coordinates
will be returned in `info` with keys `"x_position"` and `"y_position"`, respectively.

However, by default, the observation is a `ndarray` with shape `(376,)` where the elements correspond to the following:
However, by default, the observation is a `Box(-Inf, Inf, (376,), float64)`. The elements correspond to the following:

| Num | Observation | Min | Max | Name (in corresponding XML file) | Joint | Unit |
| --- | --------------------------------------------------------------------------------------------------------------- | ---- | --- | -------------------------------- | ----- | -------------------------- |
Expand All @@ -77,7 +76,7 @@ class HumanoidEnv(MujocoEnv, utils.EzPickle):
| 7 | x-angle of the abdomen (in pelvis) | -Inf | Inf | abdomen_x | hinge | angle (rad) |
| 8 | x-coordinate of angle between pelvis and right hip (in right_thigh) | -Inf | Inf | right_hip_x | hinge | angle (rad) |
| 9 | z-coordinate of angle between pelvis and right hip (in right_thigh) | -Inf | Inf | right_hip_z | hinge | angle (rad) |
| 19 | y-coordinate of angle between pelvis and right hip (in right_thigh) | -Inf | Inf | right_hip_y | hinge | angle (rad) |
| 10 | y-coordinate of angle between pelvis and right hip (in right_thigh) | -Inf | Inf | right_hip_y | hinge | angle (rad) |
| 11 | angle between right hip and the right shin (in right_knee) | -Inf | Inf | right_knee | hinge | angle (rad) |
| 12 | x-coordinate of angle between pelvis and left hip (in left_thigh) | -Inf | Inf | left_hip_x | hinge | angle (rad) |
| 13 | z-coordinate of angle between pelvis and left hip (in left_thigh) | -Inf | Inf | left_hip_z | hinge | angle (rad) |
Expand Down Expand Up @@ -111,7 +110,9 @@ class HumanoidEnv(MujocoEnv, utils.EzPickle):
| 41 | angular velocity of the angle between right upper arm and right_lower_arm | -Inf | Inf | right_elbow | hinge | anglular velocity (rad/s) |
| 42 | coordinate-1 (multi-axis) of the angular velocity of the angle between torso and left arm (in left_upper_arm) | -Inf | Inf | left_shoulder1 | hinge | anglular velocity (rad/s) |
| 43 | coordinate-2 (multi-axis) of the angular velocity of the angle between torso and left arm (in left_upper_arm) | -Inf | Inf | left_shoulder2 | hinge | anglular velocity (rad/s) |
| 44 | angular velocitty of the angle between left upper arm and left_lower_arm | -Inf | Inf | left_elbow | hinge | anglular velocity (rad/s) |
| 44 | angular velocity of the angle between left upper arm and left_lower_arm | -Inf | Inf | left_elbow | hinge | anglular velocity (rad/s) |
| excluded | x-coordinate of the torso (centre) | -Inf | Inf | root | free | position (m) |
| excluded | y-coordinate of the torso (centre) | -Inf | Inf | root | free | position (m) |

Additionally, after all the positional and velocity based values in the table,
the observation contains (in order):
Expand All @@ -127,6 +128,53 @@ class HumanoidEnv(MujocoEnv, utils.EzPickle):
where *nbody* stands for the number of bodies in the robot and *nv* stands for the
number of degrees of freedom (*= dim(qvel)*)

The body parts are:

| id (for `v2`,`v3`,`v4`) | body part |
| --- | ------------ |
| 0 | worldBody (note: all values are constant 0) |
| 1 | torso |
| 2 | lwaist |
| 3 | pelvis |
| 4 | right_thigh |
| 5 | right_sin |
| 6 | right_foot |
| 7 | left_thigh |
| 8 | left_sin |
| 9 | left_foot |
| 10 | right_upper_arm |
| 11 | right_lower_arm |
| 12 | left_upper_arm |
| 13 | left_lower_arm |

The joints are:

| id (for `v2`,`v3`,`v4`) | joint |
| --- | ------------ |
| 0 | root |
| 1 | root |
| 2 | root |
| 3 | root |
| 4 | root |
| 5 | root |
| 6 | abdomen_z |
| 7 | abdomen_y |
| 8 | abdomen_x |
| 9 | right_hip_x |
| 10 | right_hip_z |
| 11 | right_hip_y |
| 12 | right_knee |
| 13 | left_hip_x |
| 14 | left_hiz_z |
| 15 | left_hip_y |
| 16 | left_knee |
| 17 | right_shoulder1 |
| 18 | right_shoulder2 |
| 19 | right_elbow|
| 20 | left_shoulder1 |
| 21 | left_shoulder2 |
| 22 | left_elfbow |

The (x,y,z) coordinates are translational DOFs while the orientations are rotational
DOFs expressed as quaternions. One can read more about free joints on the
[Mujoco Documentation](https://mujoco.readthedocs.io/en/latest/XMLreference.html).
Expand Down Expand Up @@ -177,7 +225,6 @@ class HumanoidEnv(MujocoEnv, utils.EzPickle):
If `terminate_when_unhealthy=False` is passed, the episode is ended only when 1000 timesteps are exceeded.

## Arguments

No additional arguments are currently supported in v2 and lower.

```python
Expand All @@ -198,11 +245,16 @@ class HumanoidEnv(MujocoEnv, utils.EzPickle):
| `forward_reward_weight` | **float** | `1.25` | Weight for _forward_reward_ term (see section on reward) |
| `ctrl_cost_weight` | **float** | `0.1` | Weight for _ctrl_cost_ term (see section on reward) |
| `contact_cost_weight` | **float** | `5e-7` | Weight for _contact_cost_ term (see section on reward) |
| `contact_cost_range` | **float** | `(-np.inf, 10.0) | |
| `healthy_reward` | **float** | `5.0` | Constant reward given if the humanoid is "healthy" after timestep |
| `terminate_when_unhealthy` | **bool** | `True` | If true, issue a done signal if the z-coordinate of the torso is no longer in the `healthy_z_range` |
| `healthy_z_range` | **tuple** | `(1.0, 2.0)` | The humanoid is considered healthy if the z-coordinate of the torso is in this range |
| `reset_noise_scale` | **float** | `1e-2` | Scale of random perturbations of initial position and velocity (see section on Starting State) |
| `exclude_current_positions_from_observation` | **bool** | `True` | Whether or not to omit the x- and y-coordinates from observations. Excluding the position can serve as an inductive bias to induce position-agnostic behavior in policies |
| `include_cinert_from_observation` | **bool** | `True` | Whether to include *cinert* elements in the observations.|
| `include_cvel_from_observation` | **bool** | `True` | Whether to include *cvel* elements in the observations. |
| `include_qfrc_actuator_from_observation` | **bool** | `True` | Whether to include *qfrc_actuator* elements in the observations. |
| `include_cfrc_ext_from_observation` | **bool** | `True` | Whether to include *cfrc_ext* elements in the observations. |

## Version History

Expand Down