Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MuJoCo/Ant clarify the lack of use_contact_forces on v3 (and older) #342

Merged
Merged
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions gymnasium/envs/mujoco/ant_v4.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class AntEnv(MujocoEnv, utils.EzPickle):
| 26 |angular velocity of the angle between back right links | -Inf | Inf | ankle_4 (right_back_leg) | hinge | angle (rad) |


If `use_contact_forces` is `True` then the observation space is extended by 14*6 = 84 elements, which are contact forces
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.
Expand Down Expand Up @@ -116,7 +116,7 @@ class AntEnv(MujocoEnv, utils.EzPickle):

The total reward returned is ***reward*** *=* *healthy_reward + forward_reward - ctrl_cost*.

But if `use_contact_forces=True`
But if `use_contact_forces=True` or version < `v4`
The total reward returned is ***reward*** *=* *healthy_reward + forward_reward - ctrl_cost - contact_cost*.

In either case `info` will also contain the individual reward terms.
Expand Down