Skip to content

Commit

Permalink
Do not treat humanoid contact force as separate objective
Browse files Browse the repository at this point in the history
  • Loading branch information
LucasAlegre committed Oct 25, 2024
1 parent 7931b98 commit f4261ba
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion mo_gymnasium/envs/mujoco/humanoid_v5.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,10 @@ def __init__(self, **kwargs):
def step(self, action):
observation, reward, terminated, truncated, info = super().step(action)
velocity = info["x_velocity"]
negative_cost = 10 * info["reward_ctrl"] + info["reward_contact"]
negative_cost = info["reward_ctrl"] / self._ctrl_cost_weight # Revert the scale applied in the original environment
vec_reward = np.array([velocity, negative_cost], dtype=np.float32)

vec_reward += self.healthy_reward # All objectives are penalyzed when the agent falls
vec_reward += info["reward_contact"] # Do not treat contact forces as a separate objective

return observation, vec_reward, terminated, truncated, info

0 comments on commit f4261ba

Please sign in to comment.