From 63ed69427f4cb7fec870c04463ef0ce052d1bcd5 Mon Sep 17 00:00:00 2001 From: Wesley Maa Date: Wed, 1 Jan 2025 23:37:36 -0800 Subject: [PATCH] fix noise --- sim/envs/base/legged_robot.py | 2 +- sim/envs/humanoids/gpr_config.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sim/envs/base/legged_robot.py b/sim/envs/base/legged_robot.py index ed4b3461..1cc6e5af 100644 --- a/sim/envs/base/legged_robot.py +++ b/sim/envs/base/legged_robot.py @@ -479,7 +479,7 @@ def _resample_default_positions(self): self.default_dof_pos[i] = self.cfg.init_state.default_joint_angles[name] if self.add_noise: - self.default_dof_pos[i] += torch.randn(1) * self.cfg.noise.noise_ranges.default_pos + self.default_dof_pos[i] += torch.randn(1).item() * self.cfg.noise.noise_ranges.default_pos # ---------------------------------------- def _init_buffers(self): diff --git a/sim/envs/humanoids/gpr_config.py b/sim/envs/humanoids/gpr_config.py index f8c0708b..9bd940d2 100644 --- a/sim/envs/humanoids/gpr_config.py +++ b/sim/envs/humanoids/gpr_config.py @@ -168,7 +168,7 @@ class noise_scales: quat = 0.03 height_measurements = 0.1 - class nosie_ranges: + class noise_ranges: default_pos = 0.03 # +- 0.05 rad class init_state(LeggedRobotCfg.init_state):