Skip to content

Commit

Permalink
Use uniform random for object pose.
Browse files Browse the repository at this point in the history
  • Loading branch information
mmurooka committed Jan 25, 2025
1 parent 5f1ed31 commit 1632c8c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions robo_manip_baselines/common/rollout/RolloutBase.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,9 @@ def setup_args(self, parser=None, argv=None):
argv = sys.argv
self.args = parser.parse_args(argv[1:])

if self.args.world_random_scale is not None:
self.args.world_random_scale = np.array(self.args.world_random_scale)

@abstractmethod
def setup_policy(self):
pass
Expand Down
4 changes: 3 additions & 1 deletion robo_manip_baselines/envs/mujoco/ur5e/MujocoUR5eInsertEnv.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ def modify_world(

hole_pos = self.original_hole_pos + self.hole_pos_offsets[world_idx]
if world_random_scale is not None:
hole_pos += np.random.normal(scale=world_random_scale, size=3)
hole_pos += np.random.uniform(
low=-1.0 * world_random_scale, high=world_random_scale, size=3
)
self.model.body("hole").pos = hole_pos

return world_idx

0 comments on commit 1632c8c

Please sign in to comment.