From 745375f6e5b1023a0c84fcbd337e8397fa84c54a Mon Sep 17 00:00:00 2001 From: Kallinteris Andreas <30759571+Kallinteris-Andreas@users.noreply.github.com> Date: Wed, 15 Mar 2023 00:00:31 +0200 Subject: [PATCH] `MuJoCo/Ant-v4` DOC fix contact_forces observation (#387) --- gymnasium/envs/mujoco/ant_v4.py | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/gymnasium/envs/mujoco/ant_v4.py b/gymnasium/envs/mujoco/ant_v4.py index 620a9b7e8..582226412 100644 --- a/gymnasium/envs/mujoco/ant_v4.py +++ b/gymnasium/envs/mujoco/ant_v4.py @@ -81,13 +81,31 @@ class AntEnv(MujocoEnv, utils.EzPickle): | 23 | angular velocity of angle between torso and back left link | -Inf | Inf | hip_3 (back_leg) | hinge | angle (rad) | | 24 | angular velocity of the angle between back left links | -Inf | Inf | ankle_3 (back_leg) | hinge | angle (rad) | | 25 | angular velocity of angle between torso and back right link | -Inf | Inf | hip_4 (right_back_leg) | hinge | angle (rad) | - | 26 |angular velocity of the angle between back right links | -Inf | Inf | ankle_4 (right_back_leg) | hinge | angle (rad) | + | 26 | angular velocity of the angle between back right links | -Inf | Inf | ankle_4 (right_back_leg) | hinge | angle (rad) | If version < `v4` or `use_contact_forces` is `True` then the observation space is extended by 14*6 = 84 elements, which are contact forces (external forces - force x, y, z and torque x, y, z) applied to the - center of mass of each of the links. The 14 links are: the ground link, - the torso link, and 3 links for each leg (1 + 1 + 12) with the 6 external forces. + center of mass of each of the objects. The 14 object are: + + in `v4` or earlier: + | id | object | + | --- | ------------ | + | 0 | worldObject (note: forces are always full of zeros) | + | 1 | torso | + | 2 | front_left_leg | + | 3 | aux_1 (front left leg) | + | 4 | ankle_1 (front left leg) | + | 5 | front_right_leg | + | 6 | aux_2 (front right leg) | + | 7 | ankle_2 (front right leg) | + | 8 | back_leg (back left leg) | + | 9 | aux_3 (back left leg) | + | 10 | ankle_3 (back left leg) | + | 11 | right_back_leg | + | 12 | aux_4 (back right leg) | + | 13 | ankle_4 (back right leg) | + 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).