Skip to content

Commit

Permalink
add info success
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigodelazcano committed Feb 10, 2023
1 parent b3fba54 commit ace181e
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions gymnasium_robotics/envs/maze/point_maze.py
Expand Up @@ -369,18 +369,24 @@ def reset(

obs, info = self.point_env.reset(seed=seed)
obs_dict = self._get_obs(obs)
info["success"] = bool(
np.linalg.norm(obs_dict["achieved_goal"] - self.goal) <= 0.45
)

return obs_dict, info

def step(self, action):
obs, _, _, _, info = self.point_env.step(action)
obs_dict = self._get_obs(obs)

info["success"] = bool(
np.linalg.norm(obs_dict["achieved_goal"] - self.goal) <= 0.45
)
reward = self.compute_reward(obs_dict["achieved_goal"], self.goal, info)

terminated = self.compute_terminated(obs_dict["achieved_goal"], self.goal, info)
truncated = self.compute_truncated(obs_dict["achieved_goal"], self.goal, info)

reward = self.compute_reward(obs_dict["achieved_goal"], self.goal, info)

return obs_dict, reward, terminated, truncated, info

def update_target_site_pos(self):
Expand Down

0 comments on commit ace181e

Please sign in to comment.