From 266df0a6f868f0e9152c911923fd9423c138fa0c Mon Sep 17 00:00:00 2001 From: Cheryl Wang <90352960+cherylwang20@users.noreply.github.com> Date: Tue, 17 Sep 2024 01:46:28 -0400 Subject: [PATCH 1/2] Update bimanual_v0.py Hotfix for the sign of effort --- myosuite/envs/myo/myochallenge/bimanual_v0.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/myosuite/envs/myo/myochallenge/bimanual_v0.py b/myosuite/envs/myo/myochallenge/bimanual_v0.py index 2da76e9a..8f129232 100644 --- a/myosuite/envs/myo/myochallenge/bimanual_v0.py +++ b/myosuite/envs/myo/myochallenge/bimanual_v0.py @@ -313,7 +313,7 @@ def get_metrics(self, paths, successful_steps=5): goal_dist = np.mean([np.mean(p['env_infos']['rwd_dict']['goal_dist']) for p in paths]) # average activations over entire trajectory (can be shorter than horizon, if done) realized - effort = -1.0 * np.mean([np.mean(p['env_infos']['rwd_dict']['act']) for p in paths]) + effort = 1.0 * np.mean([np.mean(p['env_infos']['rwd_dict']['act']) for p in paths]) metrics = { 'score': score, From f66449692b8ca506e43b89f81473f4cc14a3d95a Mon Sep 17 00:00:00 2001 From: elladyr Date: Tue, 17 Sep 2024 05:38:02 -0400 Subject: [PATCH 2/2] Added time limit to bimanual --- myosuite/envs/myo/myochallenge/bimanual_v0.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/myosuite/envs/myo/myochallenge/bimanual_v0.py b/myosuite/envs/myo/myochallenge/bimanual_v0.py index 8f129232..dea02788 100644 --- a/myosuite/envs/myo/myochallenge/bimanual_v0.py +++ b/myosuite/envs/myo/myochallenge/bimanual_v0.py @@ -257,6 +257,9 @@ def get_reward_dict(self, obs_dict): elbow_err = 5 * np.exp(-10 * (obs_dict['elbow_fle'][0] - 1.) ** 2) - 5 goal_dis = np.array( [[np.abs(np.linalg.norm(obj_pos[:2] - goal_pos, axis=-1))]]) + + isTimeLimit = obs_dict['time'] > 3.0 + rwd_dict = collections.OrderedDict( ( # Optional Keys @@ -271,7 +274,7 @@ def get_reward_dict(self, obs_dict): ("sparse", 0), ("goal_dist", goal_dis), ("solved", goal_dis < self.proximity_th), - ("done", goal_dis < self.proximity_th), + ("done", isTimeLimit), ) )